ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

原文来自于:http://blog.sina.com.cn/s/blog_7c0e26230100t0ci.html

这个错误是因为Listener出了问题,请检查一下你的listener.ora文件,看下是否存在如下配置:
位置:C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN

1.listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)
如果说是这样,那么请将一段改成
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
) (SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME = E:\oracle\product\10.2.0\db_1)
(SID_NAME = ORCL)
)
)

2.tnsnames.ora
打开后添加
“你的IP” =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = “你的IP”)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = “你要连接的数据库名”)
)
)
以上两部操作完成后,重启所有的Oracle服务。

你可能感兴趣的:(JAVA数据库编程)