6 停止10gR2 RAC软件
A 停止数据库
[root@node1 ~]# su – oracle
node1-> crs_stat -t
Name Type Target State Host
————————————————————
ora.devdb.db application ONLINE ONLINE node1
ora….b1.inst application ONLINE ONLINE node1
ora….b2.inst application ONLINE ONLINE node2
ora….c10g.cs application ONLINE ONLINE node1
ora….db1.srv application ONLINE ONLINE node1
ora….SM1.asm application ONLINE ONLINE node1
ora….E1.lsnr application ONLINE ONLINE node1
ora.node1.gsd application ONLINE ONLINE node1
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora….SM2.asm application ONLINE ONLINE node2
ora….E2.lsnr application ONLINE ONLINE node2
ora.node2.gsd application ONLINE ONLINE node2
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
node1-> srvctl stop service -d devdb
node1-> crs_stat -t
Name Type Target State Host
————————————————————
ora.devdb.db application ONLINE ONLINE node1
ora….b1.inst application ONLINE ONLINE node1
ora….b2.inst application ONLINE ONLINE node2
ora….c10g.cs application OFFLINE OFFLINE
ora….db1.srv application OFFLINE OFFLINE
ora….SM1.asm application ONLINE ONLINE node1
ora….E1.lsnr application ONLINE ONLINE node1
ora.node1.gsd application ONLINE ONLINE node1
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora….SM2.asm application ONLINE ONLINE node2
ora….E2.lsnr application ONLINE ONLINE node2
ora.node2.gsd application ONLINE ONLINE node2
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
node1-> srvctl stop database -d devdb
node1-> crs_stat -t
Name Type Target State Host
————————————————————
ora.devdb.db application OFFLINE OFFLINE
ora….b1.inst application OFFLINE OFFLINE
ora….b2.inst application OFFLINE OFFLINE
ora….c10g.cs application OFFLINE OFFLINE
ora….db1.srv application OFFLINE OFFLINE
ora….SM1.asm application ONLINE ONLINE node1
ora….E1.lsnr application ONLINE ONLINE node1
ora.node1.gsd application ONLINE ONLINE node1
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora….SM2.asm application ONLINE ONLINE node2
ora….E2.lsnr application ONLINE ONLINE node2
ora.node2.gsd application ONLINE ONLINE node2
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
node1-> srvctl stop asm -n node1
node1-> srvctl stop asm -n node2
node1-> crs_stat -t
Name Type Target State Host
————————————————————
ora.devdb.db application OFFLINE OFFLINE
ora….b1.inst application OFFLINE OFFLINE
ora….b2.inst application OFFLINE OFFLINE
ora….c10g.cs application OFFLINE OFFLINE
ora….db1.srv application OFFLINE OFFLINE
ora….SM1.asm application OFFLINE OFFLINE
ora….E1.lsnr application ONLINE ONLINE node1
ora.node1.gsd application ONLINE ONLINE node1
ora.node1.ons application ONLINE ONLINE node1
ora.node1.vip application ONLINE ONLINE node1
ora….SM2.asm application OFFLINE OFFLINE
ora….E2.lsnr application ONLINE ONLINE node2
ora.node2.gsd application ONLINE ONLINE node2
ora.node2.ons application ONLINE ONLINE node2
ora.node2.vip application ONLINE ONLINE node2
node1-> srvctl stop nodeapps -n node1
node1-> srvctl stop nodeapps -n node2
node1-> crs_stat -t
Name Type Target State Host
————————————————————
ora.devdb.db application OFFLINE OFFLINE
ora….b1.inst application OFFLINE OFFLINE
ora….b2.inst application OFFLINE OFFLINE
ora….c10g.cs application OFFLINE OFFLINE
ora….db1.srv application OFFLINE OFFLINE
ora….SM1.asm application OFFLINE OFFLINE
ora….E1.lsnr application OFFLINE OFFLINE
ora.node1.gsd application OFFLINE OFFLINE
ora.node1.ons application OFFLINE OFFLINE
ora.node1.vip application OFFLINE OFFLINE
ora….SM2.asm application OFFLINE OFFLINE
ora….E2.lsnr application OFFLINE OFFLINE
ora.node2.gsd application OFFLINE OFFLINE
ora.node2.ons application OFFLINE OFFLINE
ora.node2.vip application OFFLINE OFFLINE
node1->
B 停止CRS
节点1:
[root@node1 ~]# /u01/app/oracle/product/10.2.0/crs_1/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.
[root@node1 ~]#
节点2:
[root@node2 ~]# /u01/app/oracle/product/10.2.0/crs_1/bin/crs_stat -t
Name Type Target State Host
————————————————————
ora.devdb.db application OFFLINE OFFLINE
ora….b1.inst application OFFLINE OFFLINE
ora….b2.inst application OFFLINE OFFLINE
ora….c10g.cs application OFFLINE OFFLINE
ora….db1.srv application OFFLINE OFFLINE
ora….SM1.asm application OFFLINE OFFLINE
ora….E1.lsnr application OFFLINE OFFLINE
ora.node1.gsd application OFFLINE OFFLINE
ora.node1.ons application OFFLINE OFFLINE
ora.node1.vip application OFFLINE OFFLINE
ora….SM2.asm application OFFLINE OFFLINE
ora….E2.lsnr application OFFLINE OFFLINE
ora.node2.gsd application OFFLINE OFFLINE
ora.node2.ons application OFFLINE OFFLINE
ora.node2.vip application OFFLINE OFFLINE
[root@node2 ~]# /u01/app/oracle/product/10.2.0/crs_1/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.
[root@node2 ~]#
7 备份10gR2 RAC软件
A 备份OCR、voting disk
Note:
只需要在其中一个节点备份就可以,因为OCR和Voting Disk是存放在共享存储上的。
这里只在节点1上执行备份。
Node1:
[root@node1 ~]# pwd
/root
[root@node1 ~]# mkdir 10gbackup
[root@node1 ~]# ll /dev/raw/ra*
crw-r—– 1 oracle oinstall 162, 1 Dec 24 16:56 /dev/raw/raw1
crw-r—– 1 oracle oinstall 162, 2 Dec 24 16:59 /dev/raw/raw2
[root@node1 ~]# dd if=/dev/raw/raw1 of=/root/10gbackup/10gocr.bak
262112+0 records in
262112+0 records out
134201344 bytes (134 MB) copied, 104.927 seconds, 1.3 MB/s
[root@node1 ~]# dd if=/dev/raw/raw2 of=/root/10gbackup/10gvotingdisk.bak
262112+0 records in
262112+0 records out
134201344 bytes (134 MB) copied, 96.4558 seconds, 1.4 MB/s
[root@node1 ~]# ll /root/10gbackup/
total 262376
-rw-r–r– 1 root root 134201344 Dec 24 17:01 10gocr.bak
-rw-r–r– 1 root root 134201344 Dec 24 17:04 10gvotingdisk.bak
[root@node1 ~]#
B 备份RAC初始化脚本
Note:
这里需要在双节点上备份/etc/inittab配置文件以及
/etc/init.d/init.crs
/etc/init.d/init.crsd
/etc/init.d/init.cssd
/etc/init.d/init.evmd 初始化脚本。
Node1:
[root@node1 10gbackup]# ll
total 262376
-rw-r–r– 1 root root 134201344 Dec 24 17:01 10gocr.bak
-rw-r–r– 1 root root 134201344 Dec 24 17:04 10gvotingdisk.bak
[root@node1 10gbackup]# cp /etc/inittab /root/10gbackup/inittab.bak
[root@node1 10gbackup]# cp /etc/init.d/init.crs /root/10gbackup/init.crs.bak
[root@node1 10gbackup]# cp /etc/init.d/init.crsd /root/10gbackup/init.crsd.bak
[root@node1 10gbackup]# cp /etc/init.d/init.cssd /root/10gbackup/init.cssd.bak
[root@node1 10gbackup]# cp /etc/init.d/init.evmd /root/10gbackup/init.evmd.bak
[root@node1 10gbackup]# ll
total 262456
-rw-r–r– 1 root root 134201344 Dec 24 17:01 10gocr.bak
-rw-r–r– 1 root root 134201344 Dec 24 17:04 10gvotingdisk.bak
-r-xr-xr-x 1 root root 2436 Dec 24 17:17 init.crs.bak
-r-xr-xr-x 1 root root 5532 Dec 24 17:17 init.crsd.bak
-r-xr-xr-x 1 root root 55174 Dec 24 17:17 init.cssd.bak
-r-xr-xr-x 1 root root 3499 Dec 24 17:17 init.evmd.bak
-rw-r–r– 1 root root 1869 Dec 24 17:16 inittab.bak
[root@node1 10gbackup]#
Node2:
[root@node2 ~]# cd
[root@node2 ~]# mkdir 10gbackup
[root@node2 ~]# cd 10gbackup/
[root@node2 10gbackup]# ll
total 0
[root@node2 10gbackup]# cp /etc/inittab /root/10gbackup/inittab.bak
[root@node2 10gbackup]# cp /etc/init.d/init.crs /root/10gbackup/init.crs.bak
[root@node2 10gbackup]# cp /etc/init.d/init.crsd /root/10gbackup/init.crsd.bak
[root@node2 10gbackup]# cp /etc/init.d/init.cssd /root/10gbackup/init.cssd.bak
[root@node2 10gbackup]# cp /etc/init.d/init.evmd /root/10gbackup/init.evmd.bak
[root@node2 10gbackup]# ll
total 100
-r-xr-xr-x 1 root root 2436 Dec 24 17:18 init.crs.bak
-r-xr-xr-x 1 root root 5532 Dec 24 17:18 init.crsd.bak
-r-xr-xr-x 1 root root 55174 Dec 24 17:18 init.cssd.bak
-r-xr-xr-x 1 root root 3499 Dec 24 17:18 init.evmd.bak
-rw-r–r– 1 root root 1869 Dec 24 17:18 inittab.bak
[root@node2 10gbackup]#
C 备份oracle软件、集群软件
可以用OS tar命令来备份
tar -czf /home/oracle/oracle.tar.z $ORACLE_HOME/
这里不再赘述。
D 备份数据库
用RMAN备份数据库。亦不再赘述。
E 移除/etc/oracle
Node1:
[root@node1 ~]# ll /etc/oracle/
total 12
-rw-r–r– 1 root oinstall 45 Dec 21 22:19 ocr.loc
drwxrwxr-x 5 root root 4096 Dec 24 16:54 oprocd
drwxr-xr-x 3 root root 4096 Dec 21 22:19 scls_scr
[root@node1 ~]# mv /etc/oracle/ /root/10gbackup/etc_oracle
[root@node1 ~]# ll /etc/oracle
ls: /etc/oracle: No such file or directory
[root@node1 ~]#
Node2:
[root@node2 ~]# ll /etc/oracle/
total 24
-rw-r–r– 1 root oinstall 45 Dec 21 22:21 ocr.loc
drwxrwxr-x 5 root root 4096 Dec 24 16:55 oprocd
drwxr-xr-x 3 root root 4096 Dec 21 22:21 scls_scr
[root@node2 ~]# mv /etc/oracle/ /root/10gbackup/etc_oracle
[root@node2 ~]# ll /etc/oracle/
total 8
drwxrwxr-x 5 root root 4096 Dec 24 17:29 oprocd
[root@node2 ~]# ll /root/10gbackup/etc_oracle/
total 24
-rw-r–r– 1 root oinstall 45 Dec 21 22:21 ocr.loc
drwxrwxr-x 5 root root 4096 Dec 24 16:55 oprocd
drwxr-xr-x 3 root root 4096 Dec 21 22:21 scls_scr
[root@node2 ~]#
F 移除/etc/init.d/init*
Node1:
[root@node1 10gbackup]# cd
[root@node1 ~]# cd /root/10gbackup/
[root@node1 10gbackup]# ll
total 262460
-rw-r–r– 1 root root 134201344 Dec 24 17:01 10gocr.bak
-rw-r–r– 1 root root 134201344 Dec 24 17:04 10gvotingdisk.bak
drwxr-xr-x 4 root oinstall 4096 Dec 21 23:07 etc_oracle
-r-xr-xr-x 1 root root 2436 Dec 24 17:17 init.crs.bak
-r-xr-xr-x 1 root root 5532 Dec 24 17:17 init.crsd.bak
-r-xr-xr-x 1 root root 55174 Dec 24 17:17 init.cssd.bak
-r-xr-xr-x 1 root root 3499 Dec 24 17:17 init.evmd.bak
-rw-r–r– 1 root root 1869 Dec 24 17:16 inittab.bak
[root@node1 10gbackup]# mkdir init_mv
[root@node1 10gbackup]# ll /etc/init.d/init.*
-r-xr-xr-x 1 root root 2436 Dec 21 23:08 /etc/init.d/init.crs
-r-xr-xr-x 1 root root 5532 Dec 21 23:08 /etc/init.d/init.crsd
-r-xr-xr-x 1 root root 55174 Dec 21 23:08 /etc/init.d/init.cssd
-r-xr-xr-x 1 root root 3499 Dec 21 23:08 /etc/init.d/init.evmd
[root@node1 10gbackup]# mv /etc/init.d/init.* /root/10gbackup/init_mv/
[root@node1 10gbackup]# ll /etc/init.d/init.*
ls: /etc/init.d/init.*: No such file or directory
[root@node1 10gbackup]# ll /root/10gbackup/init_mv/
total 76
-r-xr-xr-x 1 root root 2436 Dec 21 23:08 init.crs
-r-xr-xr-x 1 root root 5532 Dec 21 23:08 init.crsd
-r-xr-xr-x 1 root root 55174 Dec 21 23:08 init.cssd
-r-xr-xr-x 1 root root 3499 Dec 21 23:08 init.evmd
[root@node1 10gbackup]#
Node2:
[root@node2 ~]# cd /root/10gbackup/
[root@node2 10gbackup]# mkdir init_mv
[root@node2 10gbackup]# ll /etc/init.d/init.*
-r-xr-xr-x 1 root root 2436 Dec 21 23:11 /etc/init.d/init.crs
-r-xr-xr-x 1 root root 5532 Dec 21 23:11 /etc/init.d/init.crsd
-r-xr-xr-x 1 root root 55174 Dec 21 23:11 /etc/init.d/init.cssd
-r-xr-xr-x 1 root root 3499 Dec 21 23:11 /etc/init.d/init.evmd
[root@node2 10gbackup]# mv /etc/init.d/init.* /root/10gbackup/init_mv/
[root@node2 10gbackup]# ll /etc/init.d/init.*
ls: /etc/init.d/init.*: No such file or directory
[root@node2 10gbackup]# ll /root/10gbackup/init_mv/
total 92
-r-xr-xr-x 1 root root 2436 Dec 21 23:11 init.crs
-r-xr-xr-x 1 root root 5532 Dec 21 23:11 init.crsd
-r-xr-xr-x 1 root root 55174 Dec 21 23:11 init.cssd
-r-xr-xr-x 1 root root 3499 Dec 21 23:11 init.evmd
[root@node2 10gbackup]#
G 修改/etc/inittab文件
Node1:
[root@node1 10gbackup]# tail -10 /etc/inittab
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
#h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
#h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null
#h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null
[root@node1 10gbackup]#
Node2:
[root@node2 10gbackup]# tail -10 /etc/inittab
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
# Run xdm in runlevel 5
x:5:respawn:/etc/X11/prefdm -nodaemon
#h1:35:respawn:/etc/init.d/init.evmd run >/dev/null 2>&1 </dev/null
#h2:35:respawn:/etc/init.d/init.cssd fatal >/dev/null 2>&1 </dev/null
#h3:35:respawn:/etc/init.d/init.crsd run >/dev/null 2>&1 </dev/null
[root@node2 10gbackup]#
H 删除/tmp/.oracle和/var/tmp/.oracle
Node1:
[root@node1 10gbackup]# ll /tmp/.oracle/
total 0
[root@node1 10gbackup]# ll /var/tmp/.oracle/
total 0
srwxrwxrwx 1 oracle oinstall 0 Dec 22 10:08 s#4353.1
srwxrwxrwx 1 oracle oinstall 0 Dec 22 10:08 s#4353.2
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sAnode1_crs_evm
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sCnode1_crs_evm
srwxrwxrwx 1 root root 0 Dec 24 16:55 sCRSD_UI_SOCKET
srwxrwxrwx 1 root root 0 Dec 24 16:55 snode1DBG_CRSD
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 snode1DBG_CSSD
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 snode1DBG_EVMD
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sOCSSD_LL_node1_
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sOCSSD_LL_node1_crs
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sOracle_CSS_LclLstnr_crs_1
srwxrwxrwx 1 root root 0 Dec 24 16:55 sora_crsqs
srwxrwxrwx 1 root root 0 Dec 24 16:55 sprocr_local_conn_0_PROC
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sSYSTEM.evm.acceptor.auth
[root@node1 10gbackup]# rm -rf /tmp/.oracle/
[root@node1 10gbackup]# rm -rf /var/tmp/.oracle/
[root@node1 10gbackup]#
[root@node1 10gbackup]#
[root@node1 10gbackup]# ll /tmp/.oracle/
ls: /tmp/.oracle/: No such file or directory
[root@node1 10gbackup]# ll /var/tmp/.oracle/
ls: /var/tmp/.oracle/: No such file or directory
[root@node1 10gbackup]#
Node2:
[root@node2 10gbackup]# ll /tmp/.oracle/
total 0
[root@node2 10gbackup]# ll /var/tmp/.oracle/
total 64
srwxrwxrwx 1 oracle oinstall 0 Dec 22 10:08 s#15791.1
srwxrwxrwx 1 oracle oinstall 0 Dec 22 10:08 s#15791.2
srwxrwxrwx 1 oracle oinstall 0 Dec 23 14:37 s#5706.1
srwxrwxrwx 1 oracle oinstall 0 Dec 23 14:37 s#5706.2
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sAnode2_crs_evm
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sCnode2_crs_evm
srwxrwxrwx 1 root root 0 Dec 24 16:55 sCRSD_UI_SOCKET
srwxrwxrwx 1 root root 0 Dec 24 16:55 snode2DBG_CRSD
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 snode2DBG_CSSD
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 snode2DBG_EVMD
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sOCSSD_LL_node2_
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sOCSSD_LL_node2_crs
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sOracle_CSS_LclLstnr_crs_2
srwxrwxrwx 1 root root 0 Dec 24 16:55 sora_crsqs
srwxrwxrwx 1 root root 0 Dec 24 16:55 sprocr_local_conn_0_PROC
srwxrwxrwx 1 oracle oinstall 0 Dec 24 16:55 sSYSTEM.evm.acceptor.auth
[root@node2 10gbackup]# rm -rf /tmp/.oracle/
[root@node2 10gbackup]# rm -rf /var/tmp/.oracle/
[root@node2 10gbackup]# ll /tmp/.oracle
ls: /tmp/.oracle: No such file or directory
[root@node2 10gbackup]# ll /var/tmp/.oracle
ls: /var/tmp/.oracle: No such file or directory
[root@node2 10gbackup]#
最后,重启RAC双节点,确认RAC相关服务、后台进程不再出现。