最近又重新安装了oracle10g ,又碰见这个错误,想起来好像每次安装10g都会遇到这样的问题,随手记下,方便下次查阅。 正常情况下,在 sqlplus 下一切正常,但是通过jar包驱动访问数据库报ora-12505错误。那么下面的解决方案往往有效: 找到listener.ora文件
最近又重新安装了oracle10g ,又碰见这个错误,想起来好像每次安装10g都会遇到这样的问题,随手记下,方便下次查阅。
正常情况下,在sqlplus下一切正常,但是通过jar包驱动访问数据库报ora-12505错误。那么下面的解决方案往往有效:
找到listener.ora文件:我的Oracle是安装在D盘,路径为:D:\oracle\product\10.2.0\db_1\network\admin\listener.ora
修改前的配置如下:# listener.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
修改后的配置如下:
# listener.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = D:\oracle\product\10.2.0\db_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
红色部分为增加的内容,个人建议绿色部分写成localhost或者127.0.0.1,而不是计算机名称——默认是计算机名称。
重启监听器