You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to connect to an Oracle DB using database fails with the message
Could not create a db handle: DBI connect('database=test','username',...)
failed: ORA-12154: TNS:could not resolve the connect identifier
specified (DBD ERROR: OCIServerAttach)
Using the same config params to manually create the DB handle works correctly, though, so the following code will create a DB handle after emitting the warning above.
local $@;
eval {
$dbh = database;
};
if ($@) {
carp "Could not create a db handle: $@";
$dbh = DBI->connect(
'dbi:' . config->{plugins}{Database}{driver} . ':' . config->{plugins}{Database}{database},
config->{plugins}{Database}{username},
config->{plugins}{Database}{password},
config->{plugins}{Database}{dbi_params}
) or die $DBI::errstr;
}
ORA-12154 refers to an error where a config file is either unreachable, incorrectly specified, or has some other similar error. More details:
Given that manual creation works, the various environment params must be set correctly, so it must be something in the DBH creation that is going wrong.
The plugin works fine when used with an SQLite db, so it's an Oracle-specific issue. I'm connecting to an Oracle 11g db, if that is helpful.
Thanks!
The text was updated successfully, but these errors were encountered:
Attempting to connect to an Oracle DB using
database
fails with the messageUsing the same config params to manually create the DB handle works correctly, though, so the following code will create a DB handle after emitting the warning above.
ORA-12154
refers to an error where a config file is either unreachable, incorrectly specified, or has some other similar error. More details:Given that manual creation works, the various environment params must be set correctly, so it must be something in the DBH creation that is going wrong.
The plugin works fine when used with an SQLite db, so it's an Oracle-specific issue. I'm connecting to an Oracle 11g db, if that is helpful.
Thanks!
The text was updated successfully, but these errors were encountered: