Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBD::Oracle & Instant client - don't find tnsnames.ora

user12271612Apr 8 2015 — edited Apr 11 2015

Hi, all! :-)

Guys, pls, help me!

My OS: CentOS 6.6, i386

Installed:

oracle-instantclient12.1-basic-12.1.0.2.0-1.i386

oracle-instantclient12.1-devel-12.1.0.2.0-1.i386

oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.i386

perl-DBI-1.609-4.el6.i686

and latest perl-DBD-Oracle-1.74 from CPAN.

Apache 2.2.15, mod_perl 2.0.4

SELinux disabled.

ORACLE_HOME = /usr/lib/oracle/12.1/client, LD_LIBRARY_PATH = /usr/lib/oracle/12.1/client/lib

tnsnames.ora exist in /usr/lib/oracle/12.1/client/network/admin

I wrote a simple perl script to test connection:

use strict;

use DBI;

my $dbh = DBI ->connect("dbi:Oracle:crm", 'login', 'password',{RaiseError => 1} );

$dbh->disconnect();

When i trying to run script from command line - all ok, no errors (yes, i can execute queries, etc.. )

But!

With apache i got an error:

DBI connect('crm','login',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at /opt/otrs/bin/cgi-bin/oratest.pl line 9

I am trying to add ORACLE_HOME with PerlSetEnv, and script see it (i checked through %ENV), but no luck.

This post has been answered by Avi Miller-Oracle on Apr 8 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2015
Added on Apr 8 2015
31 comments
8,545 views