tnsping解析但无法使用脚本连接

时间:2013-04-12 02:57:29

标签: r oracle11g rodbc

我无法从我的R / Python脚本连接到oracle数据库。以下是代码。 TNSPing实用程序能够使用LDAP解析数据库。我也粘贴了TNSPING输出。

TNSPing输出

C:\Windows\System32>tnsping UHK00500_SECCOMPAS_APPL

TNS Ping Utility for 32-bit Windows: Version 11.2.0.2.0 - Production on 12-APR-2
013 10:26:26

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
c:\apps\oracle\network\admin\sqlnet.ora

Used LDAP adapter to resolve the alias
Attempting to contact (DESCRIPTION = (SDU = 8192) (TDU = 8192) (ADDRESS_LIST = (
ADDRESS = (PROTOCOL = TCP)(HOST = PHKLOD2002-SCAN.ap.hedani.net)(PORT = 1522)) (
LOAD_BALANCE = on) (FAILOVER = on ) ) (CONNECT_DATA = (SERVICE_NAME = UHK00500_S
ECCOMPAS_APPL.WORLD) (FAILOVER_MODE = (TYPE = session) (METHOD = basic) (RETRIES
 = 20) (DELAY = 5))))
OK (60 msec)

R脚本输出

Oracle 11g驱动程序

  

chan< - odbcDriverConnect(“驱动程序= OraHome112_32中的Oracle; DBQ = UHK00500_SECCOMPAS_APPL; UID =工具包; PWD = ** ”)       警告信息:       1:在odbcDriverConnect(“驱动程序= OraHome112_32中的Oracle; DBQ = UHK00500_SECCOMPAS_APPL; UID =工具包; PWD = ** ”)中:         [RODBC] ERROR:状态08004,代码12154,消息[Oracle] [ODBC] [Ora] ORA-12154:TNS:无法解析指定的连接标识符   2:在odbcDriverConnect中(“驱动程序= OraHome112_32中的Oracle; DBQ = UHK00500_SECCOMPAS_APPL; UID =工具包; PWD = ** ”):     ODBC连接失败

ODBC驱动程序输出

  

chan< - odbcDriverConnect(“Driver = {Microsoft ODBC for Oracle}; Server = UHK00500_SECCOMPAS_APPL; Uid = toolkit; Pwd = ** ”)   警告信息:   1:在odbcDriverConnect中(“Driver = {Microsoft ODBC for Oracle}; Server = UHK00500_SECCOMPAS_APPL; Uid = toolkit; Pwd = * ”):     [RODBC] ERROR:状态08001,代码12154,消息[Microsoft] [Oracle的ODBC驱动程序] [Oracle] ORA-12154:TNS:无法解析指定的连接标识符   2:在odbcDriverConnect中(“Driver = {Microsoft ODBC for Oracle}; Server = UHK00500_SECCOMPAS_APPL; Uid = toolkit; Pwd = ** ”):     ODBC连接失败

有人可以建议我在这里检查一下以解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

不确定是什么问题,但重新启动我的R实例后连接很好。