jdbc连接oracle11g出现ora-12505错误怎么解决?

jdbc连接oracle11g出现ora-12505错误怎么解决?,第1张

ORA-12505解决2010-09-09 22:41在冲和使用oracle时遇到了一个问题:\x0d\x0aORA-12505, TNS:listener does not currently know of SID given in connect descriptor\x0d\x0aThe Connection descriptor used by the client was:\x0d\x0alocalhost:1521:orcl\x0d\x0a\x0d\x0a查判判燃阅了很多网上的内容,知道了是oracle 的sid注册有问题。\x0d\x0a\x0d\x0a按照网上的步骤解决如下:\x0d\x0a1.在oracle目录下查找listener.ora文掘虚件,修改成如下格式的:\x0d\x0a# listener.ora Network Configuration File: D:\oracle10g\network\admin\listener.ora\x0d\x0a# Generated by Oracle configuration tools.\x0d\x0a\x0d\x0aSID_LIST_LISTENER =\x0d\x0a(SID_LIST =\x0d\x0a(SID_DESC =\x0d\x0a (SID_NAME = PLSExtProc)\x0d\x0a (ORACLE_HOME = D:\oracle10g)\x0d\x0a (PROGRAM = extproc)\x0d\x0a)\x0d\x0a(SID_DESC =\x0d\x0a (GLOBAL_DBNAME = ORCL)\x0d\x0a (ORACLE_HOME = D:\oracle10g)\x0d\x0a (SID_NAME = orcl)\x0d\x0a)\x0d\x0a)\x0d\x0a\x0d\x0aLISTENER =\x0d\x0a(DESCRIPTION_LIST =\x0d\x0a(DESCRIPTION =\x0d\x0a (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))\x0d\x0a (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))\x0d\x0a)\x0d\x0a)

希望对你有帮助!rac的者段连接url和单实例不一样,12505是说你的sid有错误。举例来讲,如果你的rac实例sid是orcl,那么你集群的sid是orcl,但每台机器的sid不同,分别是orcl1,orcl2,…,orcln。在配置weblogic连接池的时候使用rac专用的url连接才可以。举例如下:单实例普通写法:jdbc:oracle:thin:@192.168.1.1:1521:orclrac:jdbc:oracle:thin:@(description=(address=(protocol=tcp)(host=192.168.1.1)(port=1521))(address=(protocol=tcp)(host=192.168.1.2)(port=1521))(load_balance=yes)(failover=yes)(failover_mode=(type=select)(method=basic))(connect_data=(server=dedicated)(service_name=orcl)))请注意,这是两节点rac的例子,host的地址需要写rac集群每台机伍嫌瞎器的虚地址,而腔空不能用实地址,否则不能实现故障转移。选项中的load_balance=yes是负载均衡开启failover=yes是故障转移开启failover_mode=(type=select)是故障转移级别


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12356813.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存