ITPub博客

首页 > 数据库 > Oracle > oracle集群数据库的连接字符串及ORA-12505异常

oracle集群数据库的连接字符串及ORA-12505异常

原创 Oracle 作者:zenzuguo 时间:2010-02-08 17:05:02 0 删除 编辑

url="jdbc:oracle:thin:@(DESCRIPTION=
(LOAD_BALANCE=on) (FAILOVER=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=host2)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=service_name)))"

example:

String url="jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = host1)(PORT = 1521))" +
"(ADDRESS = (PROTOCOL = TCP)(HOST = host2)(PORT = 1521)) (LOAD_BALANCE = yes)" +
"(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = epop3)))";

如果不用这个会出现

如下错误:

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/106285/viewspace-1031195/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-12-30

  • 博文量
    84
  • 访问量
    828864