>進(jìn)入 Oracle RAC安裝完畢后,監(jiān)聽、tnsname.ora按照Oracle默認(rèn)配置好后,在服務(wù)器端用sqlplus連接沒有問題,但是用客戶端連接,會出現(xiàn)有時候連不上的錯誤,解決方法: 1、修改監(jiān)聽文件,增加SID_L" />
歡迎進(jìn)入Oracle社區(qū)論壇,與200萬技術(shù)人員互動交流 >>進(jìn)入 Oracle RAC安裝完畢后,監(jiān)聽、tnsname.ora按照Oracle默認(rèn)配置好后,在服務(wù)器端用sqlplus連接沒有問題,但是用客戶端連接,會出現(xiàn)有時候連不上的錯誤,解決方法: 1、修改監(jiān)聽文件,增加SID_LIST_LIS
歡迎進(jìn)入Oracle社區(qū)論壇,與200萬技術(shù)人員互動交流 >>進(jìn)入
Oracle RAC安裝完畢后,監(jiān)聽、tnsname.ora按照Oracle默認(rèn)配置好后,在服務(wù)器端用sqlplus連接沒有問題,但是用客戶端連接,會出現(xiàn)有時候連不上的錯誤,解決方法:
1、修改監(jiān)聽文件,增加SID_LIST_LISTENER,兩臺機(jī)器都要修改,修改完畢后如下:
LISTENER_ORCL1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))
)
)
)
SID_LIST_LISTENER_ORCL1 =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.1.0)
(SID_NAME = ora1)
)
)
2、修改tnsname.ora,兩臺機(jī)器都要修改,例如第一臺機(jī)器:
用Oracle的netca配置的時候,只配置了一個監(jiān)聽LISTENERS_ORCL,手工增加另外兩個監(jiān)聽。
LISTENER_ORCL2 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
)
LISTENER_ORCL1 =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))
)
LISTENERS_ORCL =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))
)
ORCL1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
ORCL2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.2)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
)
)
3、修改pfile,將兩個本地監(jiān)聽設(shè)置上。
可以先導(dǎo)出一份spfile,修改完畢后再導(dǎo)入pfile。增加以下三行:
*.local_listener='LISTENER_ORCL'
ora1.local_listener='LISTENER_ORCL1'
ora2.local_listener='LISTENER_ORCL2'
另外,在啟動oralce時,出現(xiàn)ora-32006的錯誤,數(shù)據(jù)庫倒是起來能用。到網(wǎng)上搜索一通,說是oracle10g以后將*.log_archive_start=TRUE 這個參數(shù)去掉了,把這行從spfile中刪除了,再啟動沒有報錯。是否真的不需要這個參數(shù),還需要再確認(rèn)。
4、oracle驅(qū)動
經(jīng)測試發(fā)現(xiàn),在oracle RAC環(huán)境下,如果down掉一個實例,應(yīng)用出現(xiàn)以下錯誤:
Io 異常: Software caused connection abort: socket write error
org.apache.cocoon.ProcessingException: error on execute servlet:login: javax.servlet.ServletException: error on execute servlet:login
cause: java.sql.SQLException: Io 異常: Software caused connection abort: socket write error
經(jīng)反復(fù)測試,確定原因是oracle的驅(qū)動ojdbc14.jar沒有放到WEB-INF/lib下的原因。此啟動在公共lib下,必須COPY到當(dāng)前工程下,才能實現(xiàn)fail-over的自動切換.
[1] [2]
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com