Dbd Error Ociserverattach Ora 12154
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and failed to connect to database instance: ora-12541: tns:no listener (dbd error: ociserverattach). policies of this site About Us Learn more about Stack Overflow the company ora-12154: tns:could not resolve the connect identifier specified Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error ORA-12154 on DBI->connect to Oracle database with Oracle Instant Client in Solaris 10 up vote 0 down vote favorite I've been pulling my hair out over this problem for two days now: I'm trying to get a perl script to interface with an Oracle database. I have a new server I'd like to deploy my application on. This script previously worked. Here's what I've done so far: Placed my tnsnames.ora file in instantclient/network/admin: ls -la network/admin/ total 8 drwxrwxrwx 2 m staff 512 Apr 19 09:54 . drwxrwxrwx 3 m staff 512 Mar 28 15:56 .. -rwxrwxrwx 1 m staff 777 Apr 19 09:54 tnsnames.ora My Perl script looks like this: 12 use CGI; 13 use DBI; 14 use Data::Dumper; 15 use strict; 16 28 $ENV{ORACLE_HOME} = "/xxx/instantclient/"; 29 32 $ENV{'LD_LIBRARY_PATH'} = "xxx/instantclient/lib"; 33 35 use DBD::Oracle; 36 37 print "DBI::VERSION: $DBI::VERSION\n"; 38 print "$DBD::Oracle::VERSION\n"; 66 my $dbh = DBI->connect("dbi:Oracle:host=computer;port=1521;sid=mydatabase", "user", "pass"); 67 my $sth = $dbh->prepare("SELECT sysdate FROM dual"); 68 my $rv = $sth->execute; 69 DBI::dump_results($sth) if $rv; 70 $dbh->disconnect; 71 72 print "$database $dbUser $dbPassword \n"; 73 74 my $dbh = DBI->connect( $database, $dbUser, $dbPassword ) or die("PROBLEM WITH LINE:\n$! , stopped"); This script produces this output: DBI::VERSION: 1.609 DBD::Oracle version: 1.24 '19-APR-13' 1 rows dbi:Oracle:mydatabase user pass DBI connect('mydatabase','user',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at ./code.pl line 74 My tnsnames.ora file contains the following entry: mydatabase = (DESCRIPTION = (A
CommunityOracle User Group CommunityTopliners CommunityOTN Speaker BureauJava CommunityError: You don't have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page. Please enter a title. You can not post a blank message. Please type your message and try again. More discussions in Instant Client All PlacesOracle CommunityArchived ForumsOracle Database Archived ForumsInstant Client This discussion is archived 2 Replies Latest reply on Jun http://stackoverflow.com/questions/16114916/error-ora-12154-on-dbi-connect-to-oracle-database-with-oracle-instant-client-in 5, 2012 9:47 AM by 941419 DBD::Oracle & Instant client - don't find tnsnames.ora 941419 Jun 4, 2012 9:23 AM Hello, I'm trying to use tns names in Perl scripts to connect with Instant client. I always get the ORA-12154 error when connecting with Perl : ORA-12154: TNS:could not resolve the https://community.oracle.com/thread/2399445 connect identifier specified (DBD ERROR: OCIServerAttach). The perl command that raise the error is : +$dbh = DBI->connect("dbi:Oracle:MYDB","user","password") or die $DBI::errstr."\n";+ I checked my Oracle installation and everything seems fine. Connection with sqlplus work without problem using the same connection string (sqlplus user/passowrd@MYDB). I stat'ed my tnsnames.ora file to check if it's accessed : it is with sqlplus, but not with my perl script. Instant Client has been installed with the zip files made available by Oracle (not RPM). ORACLE_HOME points to the installation directory and tnsnames.ora is located in $ORACLE_HOME//network/admin/. Server is a Red Hat Entreprise 5. In my knowledge DBD::Oracle use OCI so there should not have difference between sqlplus and DBD::Oracle. Am I wrong ? Anyone have had this problem before ? Thanks for your help Florent I have the same question Show 0 Likes(0) 2581Views Tags: none (add) instantclientContent tagged with instantclient, perlContent tagged w
PROBLEM: Recently, we've encountered a problem in one of our test systems. Whenever a user uses perl to connect to the database, the script crashes and creates a core dump. https://things2notefor.wordpress.com/tag/dbd-error-ociserverattach/ However, when using SQL*Plus or tnsping, no error is encountered or core dump created. Our environment is running on Solaris 10 (x86-64) and Oracle 10g. TROUBLESHOOTING: At first we looked at the environment settings and found that everything is set accordingly. Next thing I did is to run a truss command and as expected it gave me the file (missing sqlnet.ora) it dbd error is looking for before it crashes. So I created the sqlnet.ora under $ORACLE_HOME/network/admin directory, ran the perl script and voila (!), no more core dump. However, I encountered another problem. The script does not connect to the database and the error is a misleading error (ORA-12154) as tnsping works, SQL*Plus connection works with no issue! lab-ora:/tmp/conn.pl DBI connect(‘lab_ora','devusr',…) failed: ORA-12154: TNS:could not resolve the dbd error ociserverattach connect identifier specified (DBD ERROR: OCIServerAttach) at conn.pl line 4 Database connection not made: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at conn.pl line 4. So this time, I enabled a sqlnet.ora trace by specifying the following parameters in sqlnet.ora: TRACE_LEVEL_CLIENT = SUPPORT TRACE_DIRECTORY_CLIENT = /tmp TRACE_LEVEL_CLIENT parameter values are OFF, USER, ADMIN, SUPPORT. By default, or if not specified, it's value is OFF. Set the value depending on how much detailed you want your trace file to have. (For details and description please refer to Metalink Note 216912.1 ). I've set ours to SUPPORT hoping I would get the information I need to fix this misleading error. TRACE_DIRECTORY_CLIENT can be set to any valid directory in your system and the user that own's your oracle client should have a write privilege on that directory, in this case, its /tmp. After several trace files, it got more confusing and misleading as the trace file indicates that it cannot find the TNS "path". So I came to think that the problem might related to a corrupted OCI driver. Thus we decided to reinstall the oracle client