Re: DataObjects, Oracle, and DSN weirdness

From: Date: Fri, 25 Aug 2006 06:40:26 +0000
Subject: Re: DataObjects, Oracle, and DSN weirdness
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-24987@lists.php.net to get a copy of this message
On 8/24/06, Jeff Loiselle <jeff.loiselle@gmail.com> wrote:
Hello, For some reason in my newest Oracle project the standard DSN does not work. I don't know much about Oracle except for the fact that I'm made to use it. But the DSN has always been normal in the past. So my latest troubles are that...
Yes....I hate oracle but also am forced to use it.
This does not work: oci8://user:pass@someserver/database But this does: oci8://user:pass@someserver
The problem is that if you supply a database then the DB later tries to connect with the database name as the username. This is due to oracle's horrible direct connection between users and schemas.
So if i lose the database portion of the DSN it connects. Unfortunately, this causes problems with the createTables.php script I think. I get the error: ERROR: could not read ini file
This is likely because the ini file is now named ".ini" since there is no database in the DSN. I have used DataObjects with oracle both with and without the database name. Without it I got a .ini and .links.ini file and they worked ok. Looks like that's not working for you, though (are you on Windows perhaps?).
a) am i getting this error because of the lack of a database?
Likely.
b) i have no problem connecting in my PHP file without the database there. why is that i can connect but createTables hates me?
Windows not allowing a filename to start with .? (although technically the FS does support it...)
c) is there a workaround for this or should i just hack it and submit a patch?
Perhaps a patch to give a manual name for the ini files would be useful. However I first suggest you try connecting with the schema's user. For instance, if your database is named "MyDatabase" try logging in as the user "MyDatabase". That may be the only way to get this to work. (Actually, some support for MDB2 for connecting with a different user would be nice but this would mean rewriting all table name in the query to include the schema name and we really can't do that....) Another patch that may work would be a way to manually set the database name for DB_DO. This way the DSN wouldn't include it and oracle wouldn't barf on you but it could use this database name for the ini files and prepend it to the table names automatically. -- Justin Patrin

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