解决oracle11g的ORA-12505问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决oracle11g的ORA-12505问题相关的知识,希望对你有一定的参考价值。
今天在使用SQL Developer的时候连不上去,报ORA-12505错误,但是SQLPLUS可以连接。
检查服务名,是OracleServiceORCL,那SID应当就是orcl,但是使用该SID仍然无法连接。
查阅资料后解决方法如下:
1. 打开数据库实例的目录(我的是C:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN)
找到listener.ora文件(listener监听器进程的配置文件),使用文本编辑器打开。
内容如下:
- # listener.ora Network Configuration File: C:\app\Administrator\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 = C:\app\Administrator\product\11.2.0\dbhome_1)
- (PROGRAM = extproc)
- (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
- )
- )
- LISTENER =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
- )
- )
- ADR_BASE_LISTENER = C:\app\Administrator
2. 添加SID信息(红色字体部分)
- # listener.ora Network Configuration File: C:\app\Administrator\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 = C:\app\Administrator\product\11.2.0\dbhome_1)
- (PROGRAM = extproc)
- (ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
- )
- <span style="color:#ff0000;">(SID_DESC =
- (GLOBAL_DBNAME = orcl)
- (ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
- (SID_NAME = orcl)
- )
- </span> )
- LISTENER =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
- (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
- )
- )
- ADR_BASE_LISTENER = C:\app\Administrator
3. 重新启动 OracleServiceORCL 和 OracleOraDb11g_home1TNSListener 服务。最后试一试,连接成功!
附:
PL/SQL DEVELOPER 和 SQLPLUS 采用 service_name 进行连接
而应用程序是按照 sid_name 进行连接,所以出现 PL/SQL DEVELOPER和SQLPLUS 能够连接而应用程序却无法连接的问题。
使用 SELECT INSTANCE_NAME FROM V$INSTANCE 语句,就可以查看当前数据库实例的sid_name了。
出处:http://blog.csdn.net/mdifferent/article/details/7887832
以上是关于解决oracle11g的ORA-12505问题的主要内容,如果未能解决你的问题,请参考以下文章
oracle11g sql dever链接提示ora-12505,sql plus可以正常连接
oracle 11g ora:12505 Listener refused the connection求大神帮忙