溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

Oracle 11gr2如何修改RAC集群的scan ip并處理ORA-12514問(wèn)題

發(fā)布時(shí)間:2021-11-09 10:52:12 來(lái)源:億速云 閱讀:335 作者:小新 欄目:關(guān)系型數(shù)據(jù)庫(kù)

小編給大家分享一下Oracle 11gr2如何修改RAC集群的scan ip并處理ORA-12514問(wèn)題,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!

1.查看scan ip的狀態(tài)信息

grid@cwgsdb1:~$ srvctl config scan
SCAN name: rac-scanip, Network: 1/100.100.100.0/255.255.255.0/ipmp0
SCAN VIP name: scan1, IP: /rac-scanip/100.100.100.219

2.停止scan_listener ,scan 

grid@cwgsdb1:~$ srvctl stop scan_listener
grid@cwgsdb1:~$ srvctl stop scan

3.確認(rèn) scan_listener,scan 的狀態(tài)

grid@cwgsdb1:~$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running
grid@cwgsdb1:~$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
grid@cwgsdb1:~$ crs_stat -t | grep scan
ora.scan1.vip  ora....ip.type OFFLINE   OFFLINE               
grid@cwgsdb1:~$ crs_stat -t | grep lsnr
ora....ER.lsnr ora....er.type ONLINE    ONLINE    cwgsdb1     
ora....N1.lsnr ora....er.type OFFLINE   OFFLINE               
ora....B1.lsnr application    ONLINE    ONLINE    cwgsdb1     
ora....B2.lsnr application    ONLINE    ONLINE    cwgsdb2

4.在所有節(jié)點(diǎn)中 /etc/hosts 文件中修改 scan 對(duì)應(yīng)的ip

root@cwgsdb1:~$ cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 cwgsdb1 localhost 
100.100.100.215 cwgsdb1 localhost loghost 
100.100.100.216 cwgsdb2
100.100.100.217 cwgsdb1-vip
100.100.100.218 cwgsdb2-vip
1.1.1.1 cwgsdb1-priv
1.1.1.2 cwgsdb2-priv
 
100.100.100.219 rac-scanip
root@cwgsdb1:~$ vi /etc/hosts
root@cwgsdb1:~$ cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1 cwgsdb1 localhost 
100.100.100.215 cwgsdb1 localhost loghost 
100.100.100.216 cwgsdb2
100.100.100.217 cwgsdb1-vip
100.100.100.218 cwgsdb2-vip
1.1.1.1 cwgsdb1-priv
1.1.1.2 cwgsdb2-priv
 
100.100.100.103 rac-scanip

5.查看srvctl命令所在文件夾

grid@cwgsdb1:~$ cd $ORACLE_HOME
grid@cwgsdb1:/u01/app/11.2.0/grid$ cd bin/
grid@cwgsdb1:/u01/app/11.2.0/grid/bin$ pwd
/u01/app/11.2.0/grid/bin

6.使用root命令修改scan-ip,即修改為/etc/hosts里面scan-ip對(duì)應(yīng)的ip

root@cwgsdb1:/u01/app/oracle/product/11.2.0/dbhome_1/bin# cd /u01/app/11.2.0/grid/bin
root@cwgsdb1:/u01/app/11.2.0/grid/bin# ./srvctl modify scan -n rac-scanip
root@cwgsdb1:/u01/app/11.2.0/grid/bin# ./srvctl config scan
SCAN name: rac-scanip, Network: 1/100.100.100.0/255.255.255.0/ipmp0
SCAN VIP name: scan1, IP: /rac-scanip/100.100.100.103

注:-n后面跟的是/etc/hosts下scan的名稱

7.啟動(dòng)scan_listener,scan并查看狀態(tài)

root@cwgsdb1:/u01/app/11.2.0/grid/bin# su - grid
Oracle Corporation      SunOS 5.11      11.3    September 2015
grid@cwgsdb1:~$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
grid@cwgsdb1:~$ srvctl start scan_listener
grid@cwgsdb1:~$ srvctl start scan
PRCC-1014 : scan1 was already running
PRCR-1004 : Resource ora.scan1.vip is already running
PRCR-1079 : Failed to start resource ora.scan1.vip
CRS-5702: Resource 'ora.scan1.vip' is already running on 'cwgsdb2'
 
grid@cwgsdb1:~$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node cwgsdb2
grid@cwgsdb1:~$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node cwgsdb2
grid@cwgsdb1:~$ srvctl config scan
SCAN name: rac-scanip, Network: 1/100.100.100.0/255.255.255.0/ipmp0
SCAN VIP name: scan1, IP: /rac-scanip/100.100.100.103

8.使用新的scan ip測(cè)試連接

提示ORA-12514 TNS:listener does not currently know of service requested in connect descriptor

使用關(guān)鍵字“scan ip   ORA-12514”在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.

9.嘗試重啟各節(jié)點(diǎn)監(jiān)聽,但問(wèn)題依然存在

oracle@cwgsdb2:~$ srvctl stop listener -n cwgsdb2
oracle@cwgsdb2:~$ srvctl stop listener -n cwgsdb1
oracle@cwgsdb2:~$ srvctl start listener -n cwgsdb1
oracle@cwgsdb2:~$ srvctl start listener -n cwgsdb2

10.通過(guò)修改remote_listener參數(shù)并注冊(cè)數(shù)據(jù)庫(kù)解決該問(wèn)題

SQL> show parameter remote;
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
remote_dependencies_mode             string      TIMESTAMP
remote_listener                      string      rac-scanip:1521
remote_login_passwordfile            string      EXCLUSIVE
remote_os_authent                    boolean     FALSE
remote_os_roles                      boolean     FALSE
result_cache_remote_expiration       integer     0
SQL> alter system set remote_listener='';
 
System altered.
 
SQL> alter system register;
 
System altered.
 
SQL> alter system set remote_listener='rac-scanip:1521';
 
System altered.

經(jīng)過(guò)驗(yàn)證,使用新的scan ip可以成功連接數(shù)據(jù)庫(kù)。至此,scan ip修改完成。

看完了這篇文章,相信你對(duì)“Oracle 11gr2如何修改RAC集群的scan ip并處理ORA-12514問(wèn)題”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI