ORACLERAC+HPMC停止啟動文件

guyuanli發表於2010-10-20

最近專案組做了一次停止啟動資料庫和雙機的操作,記錄一下:

背景描述:專案組共有兩個資料庫,非實時庫是兩臺機器,做成了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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章