Re: MDB2 oci8 use SID in connect string
| From: | Justin Patrin | Date: | Sun, 23 Sep 2007 04:38:00 +0000 |
| Subject: | Re: MDB2 oci8 use SID in connect string | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-27964@lists.php.net to get a copy of this message | ||
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.
--
Justin Patrin