oracle叢集資料庫的連線字串及ORA-12505異常

zenzuguo發表於2010-02-08

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章