Terry, I'm a little confused. The error you are getting clearly indicates to me you do not have a TNS entry in tnsnames.ora for that ORACLE_SID. >From the error docs:
$ oerr ora 12154 12154, 00000, "TNS:could not resolve service name" // *Cause: The service name specified is not defined correctly in the // TNSNAMES.ORA file. // *Action: Make the following checks and correct the error: // - Verify that a TNSNAMES.ORA file exists and is in the proper // place and accessible. See the operating system specific manual // for details on the required name and location. // - Check to see that the service name exists in one of the // TNSNAMES.ORA files and add it if necessary. // - Make sure there are no syntax errors anywhere in the file. // Particularly look for unmatched parentheses or stray characters. // Any error in a TNSNAMES.ORA file makes it unusable. See // Chapter 4 in the SQL*Net V2 Administrator's Guide. If // possible, regenerate the configuration files using the Oracle // Network Manager. So, from the machine you are trying to run the Perl program from, can you: 1. tnsping D102L 2. sqlplus scott/[EMAIL PROTECTED] What other environment variables might you have set (i.e. TWO_TASK)? -- Ron Reidy Lead DBA Array BioPharma, Inc. -----Original Message----- From: Terry Maragakis [mailto:[EMAIL PROTECTED] Sent: Friday, February 02, 2007 12:50 PM To: [email protected] Subject: DBD Oracle connection problem I am having a problem establishing a connection with my database. The following connection specification in my program $dbh = DBI->connect("DBI:Oracle:D102L",'scott/tiger',''); Is giving me the error: DBI connect('D102L','scott/tiger',...) failed: ORA-12154: TNS:could not resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at ./test.pl line 17 When I have my environment variable ORACLE_SID set to 'D102L' I can establish the connection without specifying the database name: $dbh = DBI->connect("DBI:Oracle:",'scott/tiger',''); (works fine) I did get the following warnings during the DBD compilation, the problem may be related to those: dbdimp.c: In function `ora_db_login6': dbdimp.c:385: warning: cast to pointer from integer of different size dbdimp.c:399: warning: cast to pointer from integer of different size dbdimp.c:409: warning: cast to pointer from integer of different size dbdimp.c:413: warning: cast to pointer from integer of different size dbdimp.c: In function `dbd_rebind_ph_char': dbdimp.c:1169: warning: cast from pointer to integer of different size sqlplus works without any problems. The environment is Solaris 10 x86 64 bit. Oracle version is 10.2 64 bit and I am running the perl program on the database server. Any ideas? This electronic message transmission is a PRIVATE communication which contains information which may be confidential or privileged. The information is intended to be for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. Please notify the sender of the delivery error by replying to this message, or notify us by telephone (877-633-2436, ext. 0), and then delete it from your system.
