OCIServerAttach cannot connect to database (error ORA-12154)

From: Heiko Stehli <heiko.stehli_at_hm-informatik.de>
Date: 17 Feb 2002 08:14:14 -0800
Message-ID: <a89836ca.0202170814.244e4966_at_posting.google.com>


I need help in a mysterious thing.

I use Oracle 9.0.1.1.1. On my client I have installed the listener und net service names with Net Manager. A tnsping works and with the Enterprose Manager Console I get a successfully connect to the database.

But with my call to OCIServerAttach I get always the ORA-12154 error. TNS-Name cannot resolved ....

What's wrong with my configuration?

Heiko

My code of OCIServerAttach (without error handling):

OCIHandleAlloc( (dvoid *)m_pEnvHandle,

                (dvoid **) &m_pServerHandle, 
                OCI_HTYPE_SERVER,
                0, 
                NULL ) );

OCIServerAttach( m_pServerHandle, 
                 m_pErrorHandle, 
                 (text *)getDatabase().c_str(), // result: elana
                 (sb4)getDatabase().size(), // result: 5
                 OCI_DEFAULT ) );



This is the output of tnsping:

TNS Ping Utility for 32-bit Windows: Version 9.0.1.1.1 - Production on 17-FEB-2002 17:06:41 Copyright (c) 1997 Oracle Corporation. All rights reserved.

Parameterdateien benutzt:
C:\orant\network\admin\sqlnet.ora
C:\orant\network\admin\tnsnames.ora

Adapter TNSNAMES zur Auflösung des Alias benutzt Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = DELPHI)(PORT = 1521))) (CONNECT_DATA = (SID = ELANA))) This ist the trace output after call of OCIServerAttach:

  • TRACE CONFIGURATION INFORMATION FOLLOWS --- New trace stream is c:\orant\network\log\client.trc New trace level is 6
  • TRACE CONFIGURATION INFORMATION ENDS ---
  • PARAMETER SOURCE INFORMATION FOLLOWS --- Attempted load of system pfile source C:\orant\network\admin\sqlnet.ora Parameter source loaded successfully

Attempted load of local pfile source
D:\projects\Hm(Win)Lib2\Samples\hmlib\dbblob\sqlnet.ora Parameter source was not loaded

 -> PARAMETER TABLE LOAD RESULTS FOLLOW <- Successful parameter table load
 -> PARAMETER TABLE HAS THE FOLLOWING CONTENTS <-

  TRACE_DIRECTORY_SERVER = c:\orant\network\log
  TRACE_DIRECTORY_CLIENT = c:\orant\network\log
  NAMES.DIRECTORY_PATH = (TNSNAMES)

  LOG_DIRECTORY_CLIENT = c:\orant\network\log   TRACE_FILE_SERVER = server
  SQLNET.AUTHENTICATION_SERVICES = (NTS)   TRACE_LEVEL_CLIENT = ADMIN
  LOG_FILE_CLIENT = clientinfo.log
  TRACE_FILE_CLIENT = client
  TRACE_LEVEL_SERVER = USER
--- PARAMETER SOURCE INFORMATION ENDS ---
  • LOG CONFIGURATION INFORMATION FOLLOWS --- Log stream will be "c:\orant\network\log\clientinfo.log" Log stream validation not requested
  • LOG CONFIGURATION INFORMATION ENDS ---
nigini: entry
nigini: Count in NI global area now: 1
nigini: Count in NI global area now: 1
nrigbi: entry
nrigbni: entry

nrigbni: Unable to get data from navigation file tnsnav.ora nrigbni: exit
nrigbi: exit
nigini: exit
niqname: Hst is already an NVstring.
niqname: Inserting CID.
nigtrm: Count in the NI global area is now 0 nnfgdei: entry
nrigbd: entry
nrigbd: exit
nigtrm: Count in the NL global area is now 0
Received on Sun Feb 17 2002 - 17:14:14 CET

Original text of this message