這篇文章主要講解了“怎么解決RAC數(shù)據(jù)庫環(huán)境修改scanip后客戶端連接異?!?,文中的講解內(nèi)容簡(jiǎn)單清晰,易于學(xué)習(xí)與理解,下面請(qǐng)大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“怎么解決RAC數(shù)據(jù)庫環(huán)境修改scanip后客戶端連接異?!卑桑?/p>
成都創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)服務(wù)商,為中小企業(yè)提供成都做網(wǎng)站、成都網(wǎng)站制作服務(wù),網(wǎng)站設(shè)計(jì),網(wǎng)站托管、服務(wù)器租用等一站式綜合服務(wù)型公司,專業(yè)打造企業(yè)形象網(wǎng)站,讓您在眾多競(jìng)爭(zhēng)對(duì)手中脫穎而出成都創(chuàng)新互聯(lián)公司。摘要:在某個(gè)項(xiàng)目上需要將1套rac數(shù)據(jù)庫遷移到另外1套rac,這2套rac的網(wǎng)段一致、數(shù)據(jù)庫名一致。在遷移之后發(fā)現(xiàn)新的數(shù)據(jù)還是會(huì)往老的數(shù)據(jù)庫插入,然而新數(shù)據(jù)庫并沒有新增數(shù)據(jù)
在某個(gè)項(xiàng)目上需要將1套rac數(shù)據(jù)庫遷移到另外1套rac,這2套rac的網(wǎng)段一致、數(shù)據(jù)庫名一致。這里將老的rac環(huán)境稱作rac a,新的rac環(huán)境稱作rac b,在正式遷移數(shù)據(jù)庫的時(shí)候發(fā)現(xiàn)一個(gè)問題,即使rac b的scan ip與rac a的rac scan ip相同,然而在遷移后發(fā)現(xiàn)程序連的還是是老數(shù)據(jù)庫rac a,數(shù)據(jù)全部存在了老的數(shù)據(jù)庫內(nèi),并沒有新數(shù)據(jù)進(jìn)新的rac b。
經(jīng)過排查后發(fā)現(xiàn),rac a,rac b在修改scan ip之后并沒有重啟數(shù)據(jù)庫或者集群,另外應(yīng)用端程序的數(shù)據(jù)庫連接字符串也沒有問題,為什么數(shù)據(jù)還是會(huì)插入到老數(shù)據(jù)庫,經(jīng)過如下一番場(chǎng)景模擬之后,可以得到答案。
本地部署了2套rac環(huán)境,網(wǎng)段一致,唯一不同的是db_name不一樣rac a
db_name:orcldb
部署后scan ip:172.16.4.125
擬修改新scan ip:172.16.4.140
rac b
db_name:orcl
部署后scan ip:172.16.4.135
擬修改新scan ip:172.16.4.125
(rac b使用rac a的scan ip)
以上是為了模擬數(shù)據(jù)庫遷移后,客戶端程序在不改變數(shù)據(jù)庫連接字符串的情況下,是否可以連接正確的數(shù)據(jù)庫
使用客戶端分別連接2套rac scan ip
在連接之前先查看rac a,rac b的dbid方便后面做驗(yàn)證
情景1:sqlplus使用172.16.4.125連接rac b
結(jié)果:無法連接rac b
情景2:sqlplus使用相同的scan ip 172.16.4.125,但是服務(wù)名用的是rac a的db_name
結(jié)果:查看dbid后,客戶端實(shí)際連接的數(shù)據(jù)庫是rac a,并非是rac b
情景3:在rac b上重啟數(shù)據(jù)庫,客戶再次連接
結(jié)果:rac b重啟之后,查看dbid,sqlplus連接的才是真正的數(shù)據(jù)庫
在項(xiàng)目環(huán)境中遷移數(shù)據(jù)從一個(gè)rac到另外一個(gè)rac當(dāng)時(shí)之所以沒有發(fā)現(xiàn)問題,是因?yàn)檫w移之后的scan ip、db_name都與原來一模一樣,但是數(shù)據(jù)庫并沒有重啟,所以很難在項(xiàng)目現(xiàn)場(chǎng)暴露出問題。
經(jīng)過上述實(shí)驗(yàn)可知,修改rac scan ip之后需要重啟要數(shù)據(jù)庫,另外在MOS 1373350.1上發(fā)現(xiàn)此為11g rac的bug,如果不重啟數(shù)據(jù)庫,也可以通過重置remote_listener參數(shù)解決。mos上雖然說在11.2.0.3已經(jīng)修復(fù),但是在11.2.0.4依然可以有此bug
mos 文檔如下:
Top Issues That Cause Troubles with SCAN VIP and Listeners (文檔 ID 1373350.1) Issue #5: Service not getting registered with SCAN listener after failover of the SCAN listener After SCAN VIP and SCAN listener failover, instance does not register with the SCAN listener. It might happen for only 1 of the scan listener. Client connection gets intermittent ORA-12514 TNS:listener does not currently know of service requested in connect descriptor. Causes: 1. Unpublished Bug 12659561 after scan listener failover, database instance might not register to the scan listener (refer Note 12659561.8 ), fixed in 11.2.0.3.2, merge patch 13354057 for 11.2.0.2 available for certain platform. 2. Unpublished Bug 13066936 Instance does not register services when scan fails over (refer Note 13066936.8 ) Solutions: 1) For both above bugs, the workaround is to unregister and register remote listener on the database instance which does not register to a SCAN listener with following steps. show parameter remote_listener alter system set remote_listener=''; alter system register; alter system set remote_listener='<scan>:<port>'; alter system register; 2) Other points to check if service is not registered with SCAN listener: a. remote_listener and local_listener is defined correctly b. EZCONNECT is defined in sqlnet.ora, eg: NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) c. SCAN name with 3 IPs should NOT be defined in /etc/hosts, it should be defined in DNS d. running nslookup <scan> multiple times should display SCAN VIP in round-robin fashion e. do not set SECURE_REGISTER_<listener> in listener.ora if the class of secure transports (COST) is not configured.
感謝各位的閱讀,以上就是“怎么解決RAC數(shù)據(jù)庫環(huán)境修改scanip后客戶端連接異?!钡膬?nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對(duì)怎么解決RAC數(shù)據(jù)庫環(huán)境修改scanip后客戶端連接異常這一問題有了更深刻的體會(huì),具體使用情況還需要大家實(shí)踐驗(yàn)證。這里是創(chuàng)新互聯(lián),小編將為大家推送更多相關(guān)知識(shí)點(diǎn)的文章,歡迎關(guān)注!
網(wǎng)頁名稱:怎么解決RAC數(shù)據(jù)庫環(huán)境修改scanip后客戶端連接異常-創(chuàng)新互聯(lián)
URL鏈接:http://jinyejixie.com/article4/iscoe.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站制作、云服務(wù)器、企業(yè)建站、App設(shè)計(jì)、網(wǎng)站改版、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容