RAC 11.2.0.3 維護命令 (一)

snowdba發表於2014-07-14

SRVCTL 啟動、關閉例項

一,檢視當前例項的狀態,節點node1,node2都是Open狀態
[root@node1 ~]# crsctl status res -t  
…..
…..                               
ora.prod.db
      1        ONLINE  ONLINE       node1                    Open               
      2        ONLINE  ONLINE       node2                    Open               

二,執行關閉例項的指令,例項名需要在“ ”號之間,並使用, 號分割
[root@node1 ~]# srvctl stop instance -d PROD -i "PROD1,PROD2”

檢視當前例項的狀態,例項全部關閉
[root@node1 ~]# crsctl status res -t
……
…...                              
ora.prod.db
      1        OFFLINE OFFLINE                               Instance Shutdown  
      2        OFFLINE OFFLINE                               Instance Shutdown  

三,啟動節點node1的例項PROD1,其他節點暫時不啟動
[root@node1 ~]# srvctl start instance -d PROD -i PROD1

檢視當前例項的狀態,例項PROD1開啟,其他例項是關閉狀態
[root@node1 ~]# crsctl status res ora.prod.db -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.db
      1        ONLINE  ONLINE       node1                    Open               
      2        OFFLINE OFFLINE                               Instance Shutdown 

四,啟動其他關閉狀態的例項
[root@node1 ~]# srvctl start instance -d PROD -i PROD2
[root@node1 ~]# crsctl status res ora.prod.db -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.db
      1        ONLINE  ONLINE       node1                    Open               
      2        ONLINE  ONLINE       node2                    Open  


五,SRVCTL 啟動、關閉整個資料庫
[root@node1 ~]# srvctl stop database -d PROD -o immediate
[root@node1 ~]# crsctl status res ora.prod.db -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.db
      1        OFFLINE OFFLINE                               Instance Shutdown  
      2        OFFLINE OFFLINE                               Instance Shutdown  
[root@node1 ~]#
[root@node1 ~]# srvctl start database -d PROD
[root@node1 ~]# crsctl status res ora.prod.db -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS      
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.prod.db
      1        ONLINE  ONLINE       node1                    Open               
      2        ONLINE  ONLINE       node2                    Open        

六,透過查詢的方式驗證例項是否啟動
SYS@PROD1> col INST_NAME for a15
SYS@PROD1> select * from v$active_instances;

INST_NUMBER INST_NAME
----------- ---------------
          1 node1:PROD1




          2 node2:PROD2

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29047826/viewspace-1218580/,如需轉載,請註明出處,否則將追究法律責任。

相關文章