用srvctl 命令停止RAC 資料庫某個例項
有時候,我們會碰到客戶提出需求,為rac資料庫下的某個例項應用停掉,來做機器的正常維護,比如換HBA卡等
這個時候就需要我們DBA介入了,而且只關閉某個例項,而不影響到另外的例項和整個資料庫的正常執行
下面就具體步驟列出來:假設我們要停RAC2例項
1.用crs_stat顯示資源的全部狀態
[oracle@RAC2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
2.用srvctl停監聽
[oracle@RAC2 ~]$ srvctl stop listener -n rac2
[oracle@RAC2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application OFFLINE OFFLINE --可以看到監聽資源已經停止
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
3.用srvctl停rac2例項
[oracle@RAC2 ~]$ srvctl stop instance -d racdb -i racdb2
[oracle@RAC2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application OFFLINE OFFLINE --可以看到例項2已經停止
4.用srvctl停例項2下面的asm
[oracle@RAC2 ~]$ srvctl stop asm -n rac2 -i +ASM2
[oracle@RAC2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application OFFLINE OFFLINE --可以看到例項2下面的asm已經停止
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application OFFLINE OFFLINE
5.用srvctl停止節點2上面的資源 manage nodeapp
[oracle@RAC2 ~]$ srvctl stop nodeapps -n rac2
CRS-0216: Could not stop resource 'ora.rac2.LISTENER_RAC2.lsnr'.
[oracle@RAC2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE --可以看到例項2下面的gsd,ons,vip資源都已經停止
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application OFFLINE OFFLINE
6.停止CRS
首先用 ps -ef|grep d.bin 命令查詢程式
[oracle@RAC2 ~]$ ps -ef|grep d.bin
oracle 19373 19372 0 14:19 ? 00:00:07 /home/oracle/10gR2/db/bin/evmd.bin
root 19534 18342 2 14:19 ? 00:00:32 /home/oracle/10gR2/db/bin/crsd.bin reboot
root 19959 19543 0 14:19 ? 00:00:00 /home/oracle/10gR2/db/bin/oprocd.bin run -t 1000 -m 500 -f
oracle 20137 19576 0 14:19 ? 00:00:08 /home/oracle/10gR2/db/bin/ocssd.bin
oracle 30785 21369 0 14:45 pts/1 00:00:00 grep d.bin
[root@RAC2 bin]# ./crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
可以看出crs相關程式已經停止了
[root@RAC2 bin]# ps -ef|grep d.bin
root 31791 7853 0 14:49 pts/1 00:00:00 grep d.bin
[oracle@RAC1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application OFFLINE OFFLINE
ora....C2.lsnr application OFFLINE OFFLINE
ora.rac2.gsd application OFFLINE OFFLINE
ora.rac2.ons application OFFLINE OFFLINE
ora.rac2.vip application OFFLINE OFFLINE
ora.racdb.db application ONLINE ONLINE rac1
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application OFFLINE OFFLINE
可以看出沒有例項2的相關資源online了
這個時候我們就可以關閉rac2機器了,進行相關維護操作
機器起來後 就會自動啟動rac2上的所有資源,包括監聽和資料庫
這裡手工啟動演示下
[root@RAC2 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
[root@RAC2 bin]# ps -ef|grep d.bin
oracle 1712 1711 4 14:56 ? 00:00:00 /home/oracle/10gR2/db/bin/evmd.bin
root 1850 31619 4 14:56 ? 00:00:00 /home/oracle/10gR2/db/bin/crsd.bin reboot
root 2318 1859 0 14:56 ? 00:00:00 /home/oracle/10gR2/db/bin/oprocd.bin run -t 1000 -m 500 -f
oracle 2462 1912 14 14:56 ? 00:00:00 /home/oracle/10gR2/db/bin/ocssd.bin
root 2494 7853 0 14:56 pts/1 00:00:00 grep d.bin
可以看到相關程式已經啟動,需要等幾分鐘才會啟動rac2相關資源
[oracle@RAC1 network-scripts]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac1
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-598146/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RAC資料庫啟用、禁用一個例項資料庫
- 使用srvctl管理RAC資料庫資料庫
- 連線RAC資料庫中單個例項(一)資料庫
- 連線RAC資料庫中單個例項(二)資料庫
- RAC資料庫恢復到單例項資料庫資料庫單例
- 透過 srvctl來管理單例項11g資料庫單例資料庫
- 單例項資料庫expdp遷移到RAC庫單例資料庫
- 【RAC】刪除RAC資料庫節點(一)——刪除資料庫例項資料庫
- srvctl 是否能夠將RAC資料庫像單例項資料庫的方式一步一步啟動資料庫單例
- rac 命令 srvctl 報錯
- 【RAC】在RAC環境中SQL*Plus命令對資料庫及例項的影響SQL資料庫
- duplicate複製資料庫(rac-單例項)資料庫單例
- 恢復RAC資料庫到單例項(ASM)資料庫單例ASM
- RAC禁止某個客戶端登入資料庫客戶端資料庫
- 單例項恢復RAC資料庫步驟(三)單例資料庫
- 單例項恢復RAC資料庫步驟(二)單例資料庫
- 單例項恢復RAC資料庫步驟(一)單例資料庫
- RAC環境只啟動單例項資料庫單例資料庫
- 【RAC】將單例項備份集恢復為rac資料庫單例資料庫
- 【RAC】將RAC備份集恢復為單例項資料庫單例資料庫
- 多個資料庫是否可以共有一個Oracle 11g RAC例項KG資料庫Oracle
- RAC如何在不停止資料庫例項和叢集服務的情況下修改IP地址資料庫
- RAC中的srvctl和crs命令
- 停止ASM例項ASM
- 10G RAC: srvctl 命令總結
- oracle 資料庫例項Oracle資料庫
- 資料庫和例項資料庫
- 將RAC備份集恢復為單例項資料庫單例資料庫
- 用命令檢視Mysql中某個資料庫的大小?MySql資料庫
- JDBC連線自定義sqlserver資料庫例項名(多個例項)JDBCSQLServer資料庫
- findmnt 命令的八個應用例項
- 從單例項資料庫轉換到RAC環境——RAC的建立和配置單例資料庫
- 單資料庫捕獲應用例項——流資料庫
- 資料庫中的XML應用例項 (轉)資料庫XML
- 單例項資料庫工具轉化多例項資料庫單例資料庫
- 單例項資料庫手工轉化多例項資料庫單例資料庫
- 安裝rac資料庫時例項的編號由誰指定資料庫
- 11gR2 RAC手動新增節點資料庫例項資料庫