我正在尝试连接到oracle数据库(PHK01200_SECCOMPAS_APPL.WORLD)从linux盒子(RHEL 6)使用OCCI (oracle instantclient版本12.1(最新))。我得到tns错误,而连接。tnsping工作得很好。请帮忙设置正确的配置。我遗漏了什么?
输出[m499757@hkl20030996 bin]$ ./sqlplus toolkit/******@PHK01200_SECCOMPAS_APPL.WORLD
SQL*Plus: Release 10.2.0.3.0 - Production on Thu May 22 12:32:56 2014
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
ERROR:
ORA-12505: TNS:listener does not currently know of SID given in connect
descriptor
配置细节:
以及。奥拉
PHK01200_SECCOMPAS_APPL.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = PHKLOD2001-xxxx.xx.hedani.net)(PORT = 1522))
)
(CONNECT_DATA =
(SID = PHK01200_SECCOMPAS_APPL)
)
)
Odbc.ini
[PHK01200_SECCOMPAS_APPL]
Driver = OracleODBC-12g
DSN = OracleODBC-12g
ServerName = PHK01200_SECCOMPAS_APPL.WORLD
UserID = toolkit
Password = ******
将odbcinst . ini
[OracleODBC-12g]
Description = Oracle ODBC driver for Oracle 12g
Driver = /cs/gat/share/oracle/64/instantclient/libsqora.so.12.1
Driver64 = /cs/gat/share/oracle/64/instantclient/libsqora.so.12.1
FileUsage = 1
Driver Logging = 7
LDAP.ora
# LDAP.ORA Configuration
# Generated by Oracle configuration tools.
DEFAULT_ADMIN_CONTEXT = "dc=uk,dc=csfb,dc=com"
#DEFAULT_ADMIN_CONTEXT = "dc=corpny,dc=csfb,dc=com"
DIRECTORY_SERVERS= (oid_ldap_server_sg.sg.csfb.com:1522:1524,oid_ldap_server_ny.corpny.csfb.com:1522:1524,oid_l dap_server_ln.csfp.co.uk:1522:1524)
DIRECTORY_SERVER_TYPE = OID
sqlnet.ora
AUTOMATIC_IPC = OFF
TRACE_LEVEL_CLIENT = OFF
TCP.NODELAY = YES
NAMES.DIRECTORY_PATH= (TNSNAMES,LDAP,ONAMES,HOSTNAME)
names.default_domain = world
name.default_zone = world
下面工作。
./sqlplus toolkit/******@PHK01200
在我的python脚本中,我使用下面的连接字符串
"DRIVER={OracleODBC-12g}; Dbq=PHKLOD2001-scan.ap.hedani.net:1522/PHK01200_SECCOMPAS_APPL.WORLD"