Oracle 版本:11.2.0.1.0php
客戶端:Windows Server 2003/PLSQL Developerhtml
Oracle服務器端的ip設置以下:java
##公網ip
192.168.135.201 WIN-2008SERVER1
192.168.135.202 WIN-2008SERVER2
##虛擬ip
192.168.135.211 WIN-2008SERVER1-vip
192.168.135.212 WIN-2008SERVER2-vip
##私網ip
10.168.135.201 WIN-2008SERVER1-pri
10.168.135.202 WIN-2008SERVER2-pri
##SCAN ip
192.168.135.220 scan
node
兩個RAC實例的虛擬ip已經設置爲ip地址而不是名稱,以下:服務器
客戶端PLSQL Developer的tnsnames.ora設置以下:oracle
ORCL = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.135.201)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.135.202)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = basic)
(RETRIES = 180)
(DELAY = 5)
)
)
spa
scan =操作系統
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
192.168.135.200 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.135.200)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
.net
使用PLSQL Developer鏈接ORCL,沒有任何問題。htm
客戶端Windows的hosts文件沒有修改以前,使用PLSQL Developer鏈接Oracle的SCAN ip 192.168.135.200,異常以下:
ORA-12541: TNS: no listener
鏈接Oracle的SCAN名稱scan,異常以下:
ORA-12545: Connect failed because target host or object does not exist
網上有說升級Oracle版本就能夠解決的,沒有嘗試過,不知道能否?
也有說將RAC實例的local_listener修改成虛擬ip就能夠的,可是已是這樣了,不知爲什麼?
最後,客戶端Windows的hosts文件添加Oracle服務器端的虛擬ip和SCAN ip的設置,重啓操做系統以後,使用PLSQL Developer鏈接Oracle的SCAN名稱scan,鏈接成功!
擴展話題:若是SCAN名稱直接設置爲ip地址(不知Oracle是否支持?),客戶端PLSQL Developer鏈接的host名稱也就能夠填寫爲ip地址了,這樣看起來就和連單機Oracle實例很像了。
擴展閱讀:
ORA-12541: TNS:no listener ( ERROR coming when one node of RAC database is off
java應用鏈接oracle 11g R2 rac (用scanip鏈接報錯)
http://blog.csdn.net/weiwangsisoftstone/article/details/38535463
11gR2 clients connect to the database using SCANs
http://www.dbatoolz.com/t/11gr2-clients-connect-to-the-database-using-scans.html
scan-ip部分能夠鏈接,部分鏈接不了