ORACLERAC+HPMC停止啟動文件
最近專案組做了一次停止啟動資料庫和雙機的操作,記錄一下:
背景描述:專案組共有兩個資料庫,非實時庫是兩臺機器,做成了ORACLE+RAC+HPMC
實時庫是兩臺機器,ORACLE+HPMC
實際操作:
[@more@]
非實時
停止
一、 先停止ORACLERAC
1. 停止資料庫服務和例項
檢視資源,可以看到RAC正常執行
oracle@cpda02 /oracle $ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application ONLINE ONLINE cpda01
ora.cpda01.gsd application ONLINE ONLINE cpda01
ora.cpda01.ons application ONLINE ONLINE cpda01
ora.cpda01.vip application ONLINE ONLINE cpda01
ora....02.lsnr application ONLINE ONLINE cpda02
ora.cpda02.gsd application ONLINE ONLINE cpda02
ora.cpda02.ons application ONLINE ONLINE cpda02
ora.cpda02.vip application ONLINE ONLINE cpda02
ora....a1.inst application ONLINE ONLINE cpda01
ora....a2.inst application ONLINE ONLINE cpda02
ora.da.db application ONLINE ONLINE cpda01
在任意的機器上以ORACLE使用者執行
oracle@cpda02 /oracle $ srvctl stop database -d da
檢視資源
oracle@cpda02 /oracle $ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application ONLINE ONLINE cpda01
ora.cpda01.gsd application ONLINE ONLINE cpda01
ora.cpda01.ons application ONLINE ONLINE cpda01
ora.cpda01.vip application ONLINE ONLINE cpda01
ora....02.lsnr application ONLINE ONLINE cpda02
ora.cpda02.gsd application ONLINE ONLINE cpda02
ora.cpda02.ons application ONLINE ONLINE cpda02
ora.cpda02.vip application ONLINE ONLINE cpda02
ora....a1.inst application OFFLINE OFFLINE cpda01
ora....a2.inst application OFFLINE OFFLINE cpda02
ora.da.db application OFFLINE OFFLINE cpda01
可以看到資料庫服務和例項已經被停止
2. 停止第一個節點的資源:
oracle@cpda02 /oracle $ srvctl stop nodeapps -n cpda01
檢視資源
oracle@cpda02 /oracle $ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application OFFLINE OFFLINE cpda01
ora.cpda01.gsd application OFFLINE OFFLINE cpda01
ora.cpda01.ons application OFFLINE OFFLINE cpda01
ora.cpda01.vip application OFFLINE OFFLINE cpda01
ora....02.lsnr application ONLINE ONLINE cpda02
ora.cpda02.gsd application ONLINE ONLINE cpda02
ora.cpda02.ons application ONLINE ONLINE cpda02
ora.cpda02.vip application ONLINE ONLINE cpda02
ora....a1.inst application OFFLINE OFFLINE cpda01
ora....a2.inst application OFFLINE OFFLINE cpda02
ora.da.db application OFFLINE OFFLINE cpda01
可以看到第一臺機器的資源已經停止,對外的服務IP也無法訪問了
3. 再停止第二臺機器的資源
oracle@cpda02 /oracle $ srvctl stop nodeapps -n cpda02
檢視資源
oracle@cpda02 /oracle $ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application OFFLINE OFFLINE cpda01
ora.cpda01.gsd application OFFLINE OFFLINE cpda01
ora.cpda01.ons application OFFLINE OFFLINE cpda01
ora.cpda01.vip application OFFLINE OFFLINE cpda01
ora....02.lsnr application OFFLINE OFFLINE cpda02
ora.cpda02.gsd application OFFLINE OFFLINE cpda02
ora.cpda02.ons application OFFLINE OFFLINE cpda02
ora.cpda02.vip application OFFLINE OFFLINE cpda02
ora....a1.inst application OFFLINE OFFLINE cpda01
ora....a2.inst application OFFLINE OFFLINE cpda02
ora.da.db application OFFLINE OFFLINE cpda01
可以看到第二臺機器的資源已經停止,對外的服務IP也無法訪問了
4. 最後停止CRS
在兩個節點以root使用者執行
#cd /sbin/init.d
#./init.crs stop
可以看到CRS成功停止,注意這塊CRS如果不停止,則停止MC叢集的時候會出現問題
到此,ORACLERAC資源已經全部停止
二、 再停止MC叢集
1. 停止叢集包
# cmhaltpkg -v da01
One or more packages or package instances have been halted.
cmhaltpkg: Completed successfully on all packages specified
2. 停止叢集雙機
# cmhaltcl -v
Disabling all packages from starting on nodes to be halted.
Disabling all packages from running on cpda01.
Package da01 is already disabled on node cpda01
Disabling all packages from running on cpda02.
Package da01 is already disabled on node cpda02
Warning: Do not modify or enable packages until the halt operation is completed.
The group member is still running on cpda02.
Use the -f option to forcefully halt the cluster/node including halting group members.
# cmviewcl -v
CLUSTER STATUS
da up
NODE STATUS STATE
cpda01 up running
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c18t2d5 up
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 1/0/1/1/0/6/0 lan0
PRIMARY up 1/0/2/1/0 lan2
STANDBY up 1/0/10/1/0 lan3
NODE STATUS STATE
cpda02 up running
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c18t2d5 up
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 1/0/1/1/0/6/0 lan0
PRIMARY up 1/0/2/1/0 lan2
STANDBY up 1/0/10/1/0 lan3
MULTI_NODE_PACKAGES
PACKAGE STATUS STATE AUTO_RUN SYSTEM
da01 down halted enabled no
NODE_NAME STATUS STATE SWITCHING
cpda01 down halted disabled
NODE_NAME STATUS STATE SWITCHING
cpda02 down halted disabled
這塊沒有關掉CLUSTER包,只好採用強制的方法來關閉(加 -f)
當然下面這塊用cmhaltcl –f –v也是可以的
# cmhaltnode -f cpda01
Disabling all packages from starting on nodes to be halted.
Package da01 is already disabled on node cpda01
Warning: Do not modify or enable packages until the halt operation is completed.
Waiting for nodes to halt .... done
Successfully halted all nodes specified.
Halt operation complete.
# cmhaltnode -f cpda02
Disabling all packages from starting on nodes to be halted.
Package da01 is already disabled on node cpda02
Warning: Do not modify or enable packages until the halt operation is completed.
Waiting for nodes to halt ... done
Successfully halted all nodes specified.
Halt operation complete.
# cmviewcl -v
CLUSTER STATUS
da down
NODE STATUS STATE
cpda01 down unknown
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c18t2d5 unknown
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY unknown 1/0/1/1/0/6/0 lan0
PRIMARY unknown 1/0/2/1/0 lan2
STANDBY unknown 1/0/10/1/0 lan3
NODE STATUS STATE
cpda02 down unknown
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c18t2d5 unknown
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY unknown 1/0/1/1/0/6/0 lan0
PRIMARY unknown 1/0/2/1/0 lan2
STANDBY unknown 1/0/10/1/0 lan3
MULTI_NODE_PACKAGES
PACKAGE STATUS STATE AUTO_RUN SYSTEM
da01 down halted enabled no
NODE_NAME STATUS STATE SWITCHING
cpda01 down
NODE_NAME STATUS STATE SWITCHING
cpda02 down
說明叢集已經停止成功,至此停止完畢
啟動
一、 啟動雙機及包
# cmruncl -v
cmruncl: Validating network configuration...
cmruncl: Network validation complete
cmruncl: Validating cluster lock disk .... Done
Waiting for cluster to form ...... done
Cluster successfully formed.
Check the syslog files on all nodes in the cluster to verify that no warnings occurred during startup.
# cmviewcl –v
CLUSTER STATUS
da up
NODE STATUS STATE
cpda01 up running
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c18t2d5 up
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 1/0/1/1/0/6/0 lan0
PRIMARY up 1/0/2/1/0 lan2
STANDBY up 1/0/10/1/0 lan3
NODE STATUS STATE
cpda02 up running
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c18t2d5 up
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 1/0/1/1/0/6/0 lan0
PRIMARY up 1/0/2/1/0 lan2
STANDBY up 1/0/10/1/0 lan3
MULTI_NODE_PACKAGES
PACKAGE STATUS STATE AUTO_RUN SYSTEM
da01 up running enabled no
NODE_NAME STATUS STATE SWITCHING
cpda01 up running enabled
NODE_NAME STATUS STATE SWITCHING
cpda02 up running enabled
說明非實時庫的叢集啟動正常
二、 啟動ORACLERAC
用命令檢視ORACLERAC的資源情況:
oracle@cpda02 /oracle $ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application OFFLINE OFFLINE cpda01
ora.cpda01.gsd application OFFLINE OFFLINE cpda01
ora.cpda01.ons application OFFLINE OFFLINE cpda01
ora.cpda01.vip application OFFLINE OFFLINE cpda01
ora....02.lsnr application OFFLINE OFFLINE cpda02
ora.cpda02.gsd application OFFLINE OFFLINE cpda02
ora.cpda02.ons application OFFLINE OFFLINE cpda02
ora.cpda02.vip application OFFLINE OFFLINE cpda02
ora....a1.inst application OFFLINE OFFLINE cpda01
ora....a2.inst application OFFLINE OFFLINE cpda02
ora.da.db application OFFLINE OFFLINE cpda01
啟動ORACLERAC資源:
以root使用者在兩臺機器上執行
#cd /sbin/init.d
#./init.crs start
會出現30 second 後 run的字樣
然後檢視資源:
oracle@cpda02 /oracle $ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application OFFLINE OFFLINE cpda01
ora.cpda01.gsd application OFFLINE OFFLINE cpda01
ora.cpda01.ons application ONLINE ONLINE cpda01
ora.cpda01.vip application ONLINE ONLINE cpda01
ora....02.lsnr application OFFLINE OFFLINE cpda02
ora.cpda02.gsd application OFFLINE OFFLINE cpda02
ora.cpda02.ons application OFFLINE OFFLINE cpda02
ora.cpda02.vip application ONLINE ONLINE cpda02
ora....a1.inst application OFFLINE OFFLINE cpda01
ora....a2.inst application OFFLINE OFFLINE cpda02
ora.da.db application OFFLINE OFFLINE cpda01
可以看出RAC正在啟動
過一分鐘再看:
oracle@cpda02 /oracle $ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....01.lsnr application ONLINE ONLINE cpda01
ora.cpda01.gsd application ONLINE ONLINE cpda01
ora.cpda01.ons application ONLINE ONLINE cpda01
ora.cpda01.vip application ONLINE ONLINE cpda01
ora....02.lsnr application ONLINE ONLINE cpda02
ora.cpda02.gsd application ONLINE ONLINE cpda02
ora.cpda02.ons application ONLINE ONLINE cpda02
ora.cpda02.vip application ONLINE ONLINE cpda02
ora....a1.inst application ONLINE ONLINE cpda01
ora....a2.inst application ONLINE ONLINE cpda02
ora.da.db application ONLINE ONLINE cpda01
說明RAC資源已經全部啟動,到此,啟動完畢
實時
停止
一、 停止叢集包
cp-mdb01_root[/]# cmhaltpkg -v mccdb01
Disabling automatic failover for failover packages to be halted.
Halting package mccdb01
Successfully halted package mccdb01
One or more packages or package instances have been halted.
The failover packages have AUTO_RUN disabled and no new instance can start automatically. To allow automatic start, enable AUTO_RUN via cmmodpkg -e
cmhaltpkg: Completed successfully on all packages specified
二、 停止叢集雙機
cp-mdb01_root[/]# cmhaltcl -v
Disabling all packages from starting on nodes to be halted.
Disabling all packages from running on cp-mdb01.
Disabling all packages from running on cp-mdb02.
Warning: Do not modify or enable packages until the halt operation is completed.
This operation may take some time.
Waiting for nodes to halt ... done
Successfully halted all nodes specified.
Halt operation complete.
cp-mdb01_root[/]# cmviewcl -v
CLUSTER STATUS
mccdb down
NODE STATUS STATE
cp-mdb01 down unknown
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c6t1d5 unknown
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY unknown 1/0/1/1/0/6/0 lan0
PRIMARY unknown 1/0/2/1/0 lan2
STANDBY unknown 1/0/10/1/0 lan3
NODE STATUS STATE
cp-mdb02 down unknown
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c6t1d5 unknown
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY unknown 1/0/1/1/0/6/0 lan0
PRIMARY unknown 1/0/2/1/0 lan2
STANDBY unknown 1/0/10/1/0 lan3
UNOWNED_PACKAGES
PACKAGE STATUS STATE AUTO_RUN NODE
mccdb01 down halted enabled unowned
Policy_Parameters:
POLICY_NAME CONFIGURED_VALUE
Failover configured_node
Failback manual
Script_Parameters:
ITEM STATUS NODE_NAME NAME
Subnet unknown cp-mdb01 10.248.2.0
Subnet unknown cp-mdb02 10.248.2.0
Node_Switching_Parameters:
NODE_TYPE STATUS SWITCHING NAME
Primary down cp-mdb01
Alternate down cp-mdb02
可以看到叢集雙機都已經停止
啟動
實時庫的指令碼是叢集雙機啟動帶動包的啟動,而包啟動帶動資料庫的啟動,所以只啟動叢集雙機就行了
cp-mdb01_oracle[/]# cmruncl -v
cmruncl: Validating network configuration...
cmruncl: Network validation complete
cmruncl: Validating cluster lock disk .... Done
Waiting for cluster to form ...... done
Cluster successfully formed.
Check the syslog files on all nodes in the cluster to verify that no warnings occurred during startup.
cp-mdb01_oracle[/]# cmviewcl -v
CLUSTER STATUS
mccdb up
NODE STATUS STATE
cp-mdb01 up running
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c6t1d5 up
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 1/0/1/1/0/6/0 lan0
PRIMARY up 1/0/2/1/0 lan2
STANDBY up 1/0/10/1/0 lan3
PACKAGE STATUS STATE AUTO_RUN NODE
mccdb01 starting starting enabled cp-mdb01
Policy_Parameters:
POLICY_NAME CONFIGURED_VALUE
Failover configured_node
Failback manual
Script_Parameters:
ITEM STATUS MAX_RESTARTS RESTARTS NAME
Service unknown 0 0 mccdb
Subnet up 10.248.2.0
Node_Switching_Parameters:
NODE_TYPE STATUS SWITCHING NAME
Primary up enabled cp-mdb01 (current)
Alternate up enabled cp-mdb02
NODE STATUS STATE
cp-mdb02 up running
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c6t1d5 up
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 1/0/1/1/0/6/0 lan0
PRIMARY up 1/0/2/1/0 lan2
STANDBY up 1/0/10/1/0 lan3
說明還沒有啟動完
cp-mdb01_oracle[/]# cmviewcl -v
CLUSTER STATUS
mccdb up
NODE STATUS STATE
cp-mdb01 up running
Cluster_Lock_LVM:
VOLUME_GROUP PHYSICAL_VOLUME STATUS
/dev/vglock /dev/dsk/c6t1d5 up
Network_Parameters:
INTERFACE STATUS PATH NAME
PRIMARY up 1/0/1/1/0/6/0 lan0
PRIMARY up 1/0/2/1/0 lan2
STANDBY up 1/0/10/1/0 lan3
PACKAGE STATUS STATE AUTO_RUN NODE
mccdb01 up running enabled cp-mdb01
Policy_Parameters:
POLICY_NAME CONFIGURED_VALUE
Failover configured_node
Failback manual
Script_Parameters:
ITEM STATUS MAX_RESTARTS RESTARTS NAME
Service up 0 0 mccdb
Subnet up 10.248.2.0
Node_Switching_Parameters:
NODE_TYPE STATUS SWITCHING NAME
Primary up enabled cp-mdb01 (current)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7490392/viewspace-1040045/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- PostgreSQL:啟動與停止SQL
- nginx啟動,停止命令Nginx
- 啟動和停止任務
- 四、Docker的啟動與停止Docker
- nginx啟動命令和停止命令。Nginx
- [springboot]一啟動就自動停止了Spring Boot
- Linux常用軟體啟動、停止、重啟命令Linux
- Window下啟動/停止Zookeeper服務
- storm叢集啟動停止指令碼ORM指令碼
- systemctl 命令在 Linux 中啟動、停止和重新啟動服務Linux
- 4.1.4 關於啟動和停止Oracle RestartOracleREST
- 在Linux中,如何啟動、停止或重啟服務?Linux
- Nginx的常用命令(啟動重啟停止等)Nginx
- 聊聊Dubbo(八):核心原始碼-容器啟動/停止原始碼
- 深入淺出Tomcat/2 - Tomcat啟動和停止Tomcat
- 檢視CentOS上Apache位置,版本,停止,啟動CentOSApache
- hyperf 啟動、重啟、停止、檔案變化監聽命令包
- 4.3 Oracle Restart元件實現oracle啟動和停止OracleREST元件
- linux停止和檢視啟動服務的命令Linux
- ORACLE EXPDP IMPDP 的停止和啟動及監控Oracle
- shell指令碼監控啟動停止weblogic服務指令碼Web
- Ubuntu下啟動、停止、重啟MySQL,檢視錯誤日誌命令大全UbuntuMySql
- 4.4 停止和重新啟動Oracle Restart進行維護操作OracleREST
- 設定Oralce啟動和停止的批處理檔案
- Appium 文件翻譯計劃 2020 啟動APP
- Nginx學習系列三Nginx的啟動、停止、修改配置檔案後重啟Nginx
- 何時停止設計並啟動實施程式設計? - Alter程式設計
- Systemd 服務:比啟動停止服務更進一步
- jQuery 效果 – 停止動畫jQuery動畫
- 利用WinSW將Nginx 作為可正常啟動/停止的windows服務NginxWindows
- 如何檢測Windows服務停止後自動啟動?自動執行.bat批處理檔案?WindowsBAT
- 百度搜尋:藍易雲【Ubuntu系統如何啟動、停止或重啟服務。】Ubuntu
- 使用 kind 和 Docker 啟動本地的 Kubernetes解說文件Docker
- win10停止自動更新操作 win10停止自動更新方法Win10
- jQuery: 動畫佇列與停止動畫 stopjQuery動畫佇列
- Harbor install.sh後如何停止呢?(開啟)
- VNPY重新啟動後,沒有停止單掛單原因和簡潔解決方法
- 重啟 Mac 後停止更改桌布的 4 種方法Mac
- 【轉載】【錯誤解決】本地計算機上的mysql服務啟動停止後,某些服務在未由其他服務或程式使用時將自動停止計算機MySql