RAC重建SCAN IP
1.檢視原始scanIP
[root@vast1 ~]# su - grid
[grid@vast1 ~]$ srvctl config scan
SCAN name: scan-ip, Network: 1/192.168.80.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scan-ip/192.168.80.111
SCAN VIP name: scan2, IP: /scan-ip/192.168.80.112
SCAN VIP name: scan3, IP: /scan-ip/192.168.80.113
可見scanIP的別名是scan-ip,當前SCANIP為192.168.80.111、192.168.80.112、192.168.80.113
2. 停止監聽
[grid@vast1 ~]$ srvctl stop listener
[grid@vast1 ~]$ crsctl stat res -t
-------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
-------------------------------------------------------------------------------
Local Resources
-------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.FRA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.LISTENER.lsnr
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.asm
ONLINE ONLINE vast1 Started
ONLINE ONLINE vast2 Started
ora.gsd
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.net1.network
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.ons
ONLINE ONLINE vast1
ONLINE ONLINE vast2
-------------------------------------------------------------------------------
Cluster Resources
-------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE vast2
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE vast1
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE vast1
ora.cvu
1 ONLINE ONLINE vast1
ora.oc4j
1 ONLINE ONLINE vast1
ora.rac.db
1 ONLINE ONLINE vast1 Open
2 ONLINE ONLINE vast2 Open
ora.scan1.vip
1 ONLINE ONLINE vast2
ora.scan2.vip
1 ONLINE ONLINE vast1
ora.scan3.vip
1 ONLINE ONLINE vast1
ora.vast1.vip
1 ONLINE ONLINE vast1
ora.vast2.vip
1 ONLINE ONLINE vast2
[grid@vast1 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is not running
3.停止scanIP和scan_listener
先停scan_listener,後停scanIP
[grid@vast1 ~]$ srvctl stop scan_listener
[grid@vast1 ~]$ srvctl stop scan
4.檢視狀態
[grid@vast1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is not running
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is not running
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is not running
--此時監聽可用但沒有執行
[grid@vast1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is not running
SCAN VIP scan2 is enabled
SCAN VIP scan2 is not running
SCAN VIP scan3 is enabled
SCAN VIP scan3 is not running
[grid@vast1 ~]$ crs_stat -t |grep lsnr
ora....ER.lsnr ora....er.type OFFLINE OFFLINE
ora....N1.lsnr ora....er.type OFFLINE OFFLINE
ora....N2.lsnr ora....er.type OFFLINE OFFLINE
ora....N3.lsnr ora....er.type OFFLINE OFFLINE
ora....T1.lsnr application OFFLINE OFFLINE
ora....T2.lsnr application OFFLINE OFFLINE
[grid@vast1 ~]$ exit
5.修改/etc/hosts檔案
[root@vast1 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
##Public Network - (eth0)
192.168.80.31 vast1
192.168.80.32 vast2
##Private Interconnect - (eth1)
10.0.0.11 vast1-priv
10.0.0.12 vast2-priv
##Public Virtual IP (VIP) addresses - (eth0)
192.168.80.131 vast1-vip
192.168.80.132 vast2-vip
##Scan IP
192.168.80.111(4) scan-ip
192.168.80.112(5) scan-ip
192.168.80.113(6)scan-ip
以上為將原IP192.168.80.111改為192.168.80.114,以此類推
修改節點二hosts檔案,內容同節點一相同
[root@vast1 ~]# ssh vast2
root@vast2's password:
Last login: Tue Oct 25 04:19:39 2016 from 192.168.80.1
[root@vast2 ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
##Public Network - (eth0)
192.168.80.31 vast1
192.168.80.32 vast2
##Private Interconnect - (eth1)
10.0.0.11 vast1-priv
10.0.0.12 vast2-priv
##Public Virtual IP (VIP) addresses - (eth0)
192.168.80.131 vast1-vip
192.168.80.132 vast2-vip
##Scan IP
192.168.80.111(4) scan-ip
192.168.80.112(5) scan-ip
192.168.80.113(6) scan-ip
~
[root@vast2 ~]# exit
logout
Connection to vast2 closed.
6.使用root修改叢集scanIP
此步一定要使用root使用者進行修改
[root@vast1 ~]# /u01/app/11.2.0/grid/bin/srvctl modify scan -n scan-ip
7.檢視scanIP
[root@vast1 ~]# /u01/app/11.2.0/grid/bin/srvctl config scan
SCAN name: scan-ip, Network: 1/192.168.80.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /scan-ip/192.168.80.114
SCAN VIP name: scan2, IP: /scan-ip/192.168.80.115
SCAN VIP name: scan3, IP: /scan-ip/192.168.80.116
可見此時IP已經被修改完成
8.開啟scanIP和scan監聽
先開啟scan監聽
[root@vast1 ~]# su - grid
[grid@vast1 ~]$ srvctl start scan
[grid@vast1 ~]$ srvctl start scan_listener
9.檢視狀態
[grid@vast1 ~]$ crs_stat -t | grep scan
ora.scan1.vip ora....ip.type ONLINE ONLINE vast2
ora.scan2.vip ora....ip.type ONLINE ONLINE vast1
ora.scan3.vip ora....ip.type ONLINE ONLINE vast1
[grid@vast1 ~]$ crs_stat -t | grep lsnr
ora....ER.lsnr ora....er.type OFFLINE OFFLINE
ora....N1.lsnr ora....er.type ONLINE ONLINE vast2
ora....N2.lsnr ora....er.type ONLINE ONLINE vast1
ora....N3.lsnr ora....er.type ONLINE ONLINE vast1
ora....T1.lsnr application OFFLINE OFFLINE
ora....T2.lsnr application OFFLINE OFFLINE
10.開啟LISTENER監聽
[grid@vast1 ~]$ srvctl start listener
11.檢視狀態
[grid@vast1 ~]$ crs_stat -t | grep lsnr
ora....ER.lsnr ora....er.type ONLINE ONLINE vast1
ora....N1.lsnr ora....er.type ONLINE ONLINE vast2
ora....N2.lsnr ora....er.type ONLINE ONLINE vast1
ora....N3.lsnr ora....er.type ONLINE ONLINE vast1
ora....T1.lsnr application ONLINE ONLINE vast1
ora....T2.lsnr application ONLINE ONLINE vast2
[grid@vast1 ~]$ crsctl stat res -t
-------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
-------------------------------------------------------------------------------
Local Resources
-------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.FRA.dg
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.LISTENER.lsnr
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.asm
ONLINE ONLINE vast1 Started
ONLINE ONLINE vast2 Started
ora.gsd
OFFLINE OFFLINE vast1
OFFLINE OFFLINE vast2
ora.net1.network
ONLINE ONLINE vast1
ONLINE ONLINE vast2
ora.ons
ONLINE ONLINE vast1
ONLINE ONLINE vast2
-------------------------------------------------------------------------------
Cluster Resources
-------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE vast2
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE vast1
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE vast1
ora.cvu
1 ONLINE ONLINE vast1
ora.oc4j
1 ONLINE ONLINE vast1
ora.rac.db
1 ONLINE ONLINE vast1 Open
2 ONLINE ONLINE vast2 Open
ora.scan1.vip
1 ONLINE ONLINE vast2
ora.scan2.vip
1 ONLINE ONLINE vast1
ora.scan3.vip
1 ONLINE ONLINE vast1
ora.vast1.vip
1 ONLINE ONLINE vast1
ora.vast2.vip
1 ONLINE ONLINE vast2
11.檢視各scan_listener狀態
[grid@vast1 ~]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-OCT-2016 04:32:15
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
[grid@vast1 ~]$ lsnrctl status listener_scan2
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-OCT-2016 04:32:19
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN2
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 25-OCT-2016 04:30:45
Uptime 0 days 0 hr. 1 min. 33 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/vast1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.115)(PORT=1521)))
The listener supports no services
The command completed successfully
[grid@vast1 ~]$ lsnrctl status listener_scan3
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-OCT-2016 04:32:28
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN3
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 25-OCT-2016 04:30:47
Uptime 0 days 0 hr. 1 min. 40 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/vast1/listener_scan3/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.116)(PORT=1521)))
The listener supports no services
The command completed successfully
發現這時候還沒有資料庫的資訊註冊進來,最重要的一步,重啟資料庫。
測試環境中重啟資料庫很容易,但要在生產環境就大不相同了。
(1) 做好備份
(2) 確認資料檔案是否有壞塊
(3) 確認停機時間
12.重啟資料庫
[grid@vast1 ~]$ srvctl stop database -d rac
[grid@vast1 ~]$ srvctl start database -d rac
13.檢視各scan_listener
[grid@vast1 ~]$ lsnrctl status listener_scan1
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-OCT-2016 04:36:46
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 2: No such file or directory
[grid@vast1 ~]$ lsnrctl status listener_scan2
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-OCT-2016 04:36:48
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN2
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 25-OCT-2016 04:30:45
Uptime 0 days 0 hr. 6 min. 3 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/vast1/listener_scan2/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN2)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.115)(PORT=1521)))
Services Summary...
Service "rac" has 2 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Instance "rac2", status READY, has 1 handler(s) for this service...
Service "racXDB" has 2 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Instance "rac2", status READY, has 1 handler(s) for this service...
The command completed successfully
[grid@vast1 ~]$ lsnrctl status listener_scan3
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-OCT-2016 04:36:51
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))
STATUS of the LISTENER
------------------------
Alias LISTENER_SCAN3
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 25-OCT-2016 04:30:47
Uptime 0 days 0 hr. 6 min. 4 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/vast1/listener_scan3/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN3)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.80.116)(PORT=1521)))
Services Summary...
Service "rac" has 2 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Instance "rac2", status READY, has 1 handler(s) for this service...
Service "racXDB" has 2 instance(s).
Instance "rac1", status READY, has 1 handler(s) for this service...
Instance "rac2", status READY, has 1 handler(s) for this service...
The command completed successfully
這裡listener_scan1沒有開啟,是因為listener_scan1在節點二上執行
14.測試各scanIP是否可以拼通
[grid@vast1 ~]$ ping 192.168.80.114
PING 192.168.80.114 (192.168.80.114) 56(84) bytes of data.
64 bytes from 192.168.80.114: icmp_seq=1 ttl=64 time=0.241 ms
64 bytes from 192.168.80.114: icmp_seq=2 ttl=64 time=0.502 ms
--- 192.168.80.114 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1641ms
rtt min/avg/max/mdev = 0.241/0.371/0.502/0.131 ms
[grid@vast1 ~]$ ping 192.168.80.115
PING 192.168.80.115 (192.168.80.115) 56(84) bytes of data.
64 bytes from 192.168.80.115: icmp_seq=1 ttl=64 time=0.012 ms
64 bytes from 192.168.80.115: icmp_seq=2 ttl=64 time=0.030 ms
--- 192.168.80.115 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1929ms
rtt min/avg/max/mdev = 0.012/0.021/0.030/0.009 ms
[grid@vast1 ~]$ ping 192.168.80.116
PING 192.168.80.116 (192.168.80.116) 56(84) bytes of data.
64 bytes from 192.168.80.116: icmp_seq=1 ttl=64 time=0.013 ms
64 bytes from 192.168.80.116: icmp_seq=2 ttl=64 time=0.044 ms
64 bytes from 192.168.80.116: icmp_seq=3 ttl=64 time=0.039 ms
--- 192.168.80.116 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2399ms
---------------------End--------------------------
2016.10.25
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30820196/viewspace-2127091/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RAC 增加SCAN IP
- Oracle RAC修改Scan IP,Public IP的方法Oracle
- Oracle RAC修改public, VIP, SCAN IPOracle
- 11g RAC 修改PUBLIC-IP、VIP、PRIV-IP、SCAN-IP
- Oracle 11g RAC SCAN ip的原理及配置Oracle
- 【RAC】如何修改SCAN IP的IP地址、名稱、埠等資訊
- 新增SCAN IP
- oracle rac scan監聽更改埠號Oracle
- scan ip的手動切換
- Oracle 11gr2修改RAC叢集的scan ip,並處理ORA-12514問題Oracle
- RAC修改IP地址
- Oracle 11G 修改scan_ipOracle
- oracle rac的scan監聽狀態Not All Endpoints RegisteredOracle
- [重慶思莊每日技術分享]-11g rac scan ip 如何手動切換到其他節點上
- Oracle 12C ORA-12545 While Connecting to RAC through SCAN NameOracleWhile
- 更改rac scanIP IP的地址
- [20180427]SCAN_IP DNS 反向解析2.txtDNS
- 【RAC】Oracle rac修改IP地址及埠號命令參考Oracle
- 關於“INS-40922 Invalid Scan Name – Unresolvable to IP address”
- 重建Base Overlay並載入自定義HLS IP
- rac 新增第二public ip 和 vip
- Oracle 12.2 RAC修改public ip address或public ip(subnet (netmask) or interface)Oracle
- SCAN
- 重建共享(db或asm)密碼檔案 in Oracle 19c RAC-20220209ASM密碼Oracle
- Oracle 12. 2 RAC public IP與vip 互換方法Oracle
- PostgreSQL DBA(119) - pgAdmin(LIMIT:Index Scan vs Bitmap Index Scan)SQLMITIndex
- 幽默:重建模、重建和重構
- 【DB寶44】Oracle rac叢集中的IP型別簡介Oracle型別
- 記一次資料庫遷移到rac11204資料庫連線scan找不到主機資料庫
- 索引重建索引
- 重建索引索引
- 阿里雲內容安全介面 敏感詞 green scan、圖片 image scan阿里
- redis的scan用法解析Redis
- redis scan迭代模糊匹配Redis
- oracle重建ocrOracle
- <context:component-scan> 標籤Context
- Cell smart table scan等待事件事件
- [20201109]cluvfy comp scan [-verbose].txt
- Oracle 11.2 DataGuard RAC To RAC搭建Oracle