Ora-12154 Dbd Error Ociserverattach
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Failed To Connect To Database Instance: Ora-12541: Tns:no Listener (dbd Error: Ociserverattach).
and policies of this site About Us Learn more about Stack Overflow ora 12505 dbd error ociserverattach the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation
Ora-12154: Tns:could Not Resolve The Connect Identifier Specified
Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 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
Error code: 12154, message: ORA-12154: TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach. [nQSError: 17014] Could not connect to Oracle database. The error is simply OBIEE reporting that it tried to connect from the BI Server to an Oracle database and the Oracle client returned an error. Distilling it down gives us this error: ORA-12154: TNS:could not resolve the connect identifier specified at OCI call OCIServerAttach. This generally means one of three things: You've got the correct Data http://stackoverflow.com/questions/16114916/error-ora-12154-on-dbi-connect-to-oracle-database-with-oracle-instant-client-in Source Name (DSN) in your connection pool configuration, but not in your tnsnames.ora file You've got the correct DSN in your tnsnames.ora but you've not updated the connection pool, or connection pools You've got the correct DSN in your connection pool and tnsnames.ora, but have multiple tnsnames.ora files and OBIEE is using a different one from the one you've https://rnm1978.wordpress.com/2009/10/22/troubleshooting-obiee-and-ora-12154-tnscould-not-resolve-the-connect-identifier/ got the correct DSN in. To check your connection pool, open the RPD in Adminstration tool and go to the Physical Layer. Expand the Database, and double-click on the Connection Pool (if you're not sure which one, then check all of them!). In the connection pool check the Data Source Name and make sure it matches to what you have in your tnsnames.ora file: To check your tnsnames.ora, first locate it. This ties in with the third point on my list too. Be aware that you may have several copies of this file, so make sure you're opening the correct one. I've not done extensive testing of this but until proven otherwise I would assume that OBIEE uses the tnsnames.ora in $ORACLE_HOME/network/admin/ $ORACLE_HOME should be set in [OracleBI]/setup/user.sh or your user profile. Note that it's the home for the connectivity (usually client), not necessarily your DB. Once you've located the correct tnsnames.ora file check that it has a valid entry for the DSN in your connection pool. You should use the tnsping utility to v
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 http://www.orafaq.com/forum/t/140430/ 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 is dbd error 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 connect dbd error ociserverattach 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. We tested
E-mail to friend 12154 with Perl Oracle DBD and instant client [message #385904] Wed, 11 February 2009 17:15 kwiqsilver Messages: 1Registered: February 2009 Junior Member I'm trying to connect to a remote oracle DB with a Perl script using DBI and the Oracle instant client and I get the 12154 error. I do not have a tnsnames or other configuration type file. Here's the relevant code: $ENV{LD_LIBRARY_PATH} = "$ENV{LD_LIBRARY_PATH}://usr/lib/oracle/11.1/client64/lib/"; $ENV{ORACLE_HOME} = "/usr/lib/oracle/11.1"; my $dbh = DBI->connect("dbi:Oracle:$dbName\@$dbHost:$dbPort", $dbUser, $dbPass) or die("DB Error '$DBI::errstr"); Output: DBI connect('dbName@host:1521','user',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at ./cgi-bin/assigned.pl line 28 DB Error 'ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at ./cgi-bin/assigned.pl line 28. A coworker is using the same connection values to connect via Python. I can telnet to the box on port 1521 (I don't know of any oracle commands I can run to verify that it is oracle that is listening on the port). Client: OS: RedHat Linux Enterprise 4.3 Oracle: InstantClient 11.1.0.7 basic and devel Perl: 5.10 DBD::Oracle: 1.22 Server: Unknown clearquest machine. Report message to a moderator Re: 12154 with Perl Oracle DBD and instant client [message #385930 is a reply to message #385904] Wed, 11 February 2009 23:24 Michel Cadot Messages: 63911Registered: March 2007 Location: Nanterre, France, http://... Senior MemberAccount Moderator ORA-12154: TNS:could not resolve the connect identifier specified *Cause: A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, o