连接数据库时的异常:TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was: localhost:1521:orc
2013-02-11 18:46
381 查看
eclipse连接数据库时出现了这样的异常:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl
并且对于Oracle sql developer 不能正常连接数据库如图:
解决办法:
查找数据库中listener.ora配置文件:
# listener.ora Network Configuration File: E:\app\hp\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\app\hp\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\app\hp\product\11.2.0\dbhome_1\bin\oraclr11.dll")(如果有这句,需要把此句删除)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = E:\app\hp
修改后为:(红色字体为增加的代码)
# listener.ora Network Configuration File: E:\app\hp\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\app\hp\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = E:\app\hp\product\11.2.0\dbhome_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
修改后重新启动服务,这样就ok了!
ADR_BASE_LISTENER = E:\app\hp
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl
并且对于Oracle sql developer 不能正常连接数据库如图:
解决办法:
查找数据库中listener.ora配置文件:
# listener.ora Network Configuration File: E:\app\hp\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\app\hp\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\app\hp\product\11.2.0\dbhome_1\bin\oraclr11.dll")(如果有这句,需要把此句删除)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = E:\app\hp
修改后为:(红色字体为增加的代码)
# listener.ora Network Configuration File: E:\app\hp\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\app\hp\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = E:\app\hp\product\11.2.0\dbhome_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
修改后重新启动服务,这样就ok了!
ADR_BASE_LISTENER = E:\app\hp
相关文章推荐
- eclipse连接数据库时出现ORA-12505, TNS:listener does not currently know of SID given in connect descriptor的解决
- oraclejdbc连接数据库的问题ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor异常
- Oracle 11G数据库报错 :ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- Oracle连接报错ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- 解决连接oracle服务器故障:TNS:listener does not currently know of SID given in connect descriptor
- Spring+ibatis出现ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- ORA12505, TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- Oracle - ORA-12505, TNS:listener does not currently know of SID given in connect descriptor 解决
- Oracle - ORA-12505, TNS:listener does not currently know of SID given in connect descriptor 解决
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505,TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505 TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
- ORA-12505, TNS:listener does not currently know of SID given in connect descriptor