Re: MDB2 oci8 use SID in connect string

From: Date: Sun, 23 Sep 2007 05:32:32 +0000
Subject: Re: MDB2 oci8 use SID in connect string
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-27965@lists.php.net to get a copy of this message
Justin Patrin wrote: > On 9/22/07, Tim Rupp <caphrim007@gmail.com> wrote: >> Hi list, >> >> I've been having a heck of a time fiddling with this problem. I'm >> using the MDB2 oci8 package to connect to our Oracle database. >> >> In the connect method, it specifies a connect string with SERVICE_NAME >> in it. With this in place, >> >> oci8://user:password@server.site.com/service >> >> the connection results in the error >> >> "TNS:Listener does not currently know of service requested in >> connect descriptor" >> >> >> I had the same problem with ADODB a while back, and fixed it by >> setting the connectSID variable to true. I looked at their code and >> noticed that the MDB2 package did not include a similar check. >> >> To make it work, I added another check to see if the option sid= was >> set; something like this >> >> oci8://user:password@server.site.com/?sid=service >> >> This replaces the SERVICE_NAME= string with SID= and allows me to >> connect to the oracle database. >> >> So I have two questions really. One, what is the difference between >> the SERVICE_NAME and SID values in that connect string, and two, I'd >> like to contact the MDB2 maintainer to send them this patch I have in >> the hopes that they will include it in the release. >> > > Oracle doesn't treat users and schemas the same way as other DBs so > the driver treats it differently. There's an option, something like > emulate_database that you should be able to set to false to have it > act more like you're expecting perhaps. > > You can also connect with one user and prefix your tables with the > schema name you want to access. > hmm, no luck. I forced that value to be true in the oci8 driver file but I get the same error message (removing my own changes beforehand). I think the crux of the matter is that SERVICE_NAME string instead of SID. Can the difference between those two be explained? It seems that SERVICE_NAME is the term that's used most often, so an explanation may be enough leverage for me to take the issue up with our DBA. As for connecting with another user, that's the thing, I can't seem to connect (with any user) so long as that SERVICE_NAME string is there. The more info the merrier. I appreciate the help! Thanks, Tim

« previous php.pear.general (#27965) next »