Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- From: johnson@xxxxxxxxxxxxxxxxxxxx (Bruce Johnson)
- Date: Wed, 30 Jul 2008 10:00:54 -0700
On Jul 29, 2008, at 8:55 PM, Jeffrey Seger wrote:
Standard troubleshooting applies:
1. Are you running the script as the same user? and with the same
environment? (If you are running it in a webserver probably not).
Yes. Moreover, setting them explicitly in the script (via the ENV statements) did not fix the issue. The same script runs just fine on our older system.
2. Is this running under apache? If so, are the same environment variables
being set in httpd.conf? Or are the old 8.1.6 variables there maybe?
We tried setting the env vars in apache, also no go.
3. Try running the script with the following code inserted near the
beginning:
foreach my $key (sort keys %ENV){ print "$key=$ENV{$key}\n"} (add in a
<br> if running through a webserver)
Compare the output to `env|sort` when run by the user you are using
tnsping as.
After cutting irrelevant env vars, this is what prints:
oracle@tonic2:~/perl/frs> env |sort
LD_LIBRARY_PATH=/home/oracle/product/11.1.0/db_1/lib
ORACLE_BASE=/home/oracle
ORACLE_HOME=/home/oracle/product/11.1.0/db_1
ORACLE_SID=phmweb
TNS_ADMIN=/home/oracle/product/11.1.0/db_1/network/admin
oracle@tonic2:~/perl/frs> ./testdbi.pl
LD_LIBRARY_PATH=/home/oracle/product/11.1.0/db_1/lib
ORACLE_BASE=/home/oracle
ORACLE_HOME=/home/oracle/product/11.1.0/db_1
ORACLE_SID=phmweb
TNS_ADMIN=/home/oracle/product/11.1.0/db_1/network/admin
DBI connect('phmweb.pharmacy.arizona.edu','people',...) failed: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at ./testdbi.pl line 11
Database connection not made: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) at ./testdbi.pl line 11.
This is why it's driving me nuts. This is identical to the environment where tnsping works. Fortunately I can get around it by bypassing TNS and specifying the 'host=host:port;sid=sid' directly in the connection string, but I'd like to know what's wrong.
The question may be academic anyway, I've been told we're nuking and re-building the server all over again as an exercise anyway. If it recurs, I know how to fix it.
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
.
- Follow-Ups:
- Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- From: Mike Nhan
- Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- References:
- Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- From: Bruce Johnson
- Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- From: Jeffrey Seger
- Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- Prev by Date: Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- Next by Date: Re: Questions related to DBI and DBD::Oracle
- Previous by thread: Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- Next by thread: Re: Weird TNS error with DBI::Oracle 1.21 & oracle 11G
- Index(es):
Relevant Pages
|