恢复oracle crs的ocr及vote
如果votingdisk磁盘故障或丢失,Oracle 11.1.0.7.0 RAC无法启动,报votingdisk磁盘无法识别,为了让系统能启动,手工将votingdisk磁盘重新添加一遍,系统可以重新启动。系统起来之后,因为votedisk损坏,而且有没有备份,所以只能重建votedisk votedisk损坏只能重建,重建votedisk有两种方法 1.如果有votedisk备份的话,就用备份恢复
备份votedisk:dd if=/dev/raw/raw2 of=/tmp/votedisk.bak
恢复votedisk:dd if=/tmp/votedisk.bak of=/dev/raw/raw2
2.没有votedisk备份的话,那就只能重新安装clusterware了(votedisk中信息是在安装clusterware或添加删除节点时把节点的信息添加进去的,并有ocssd进程维护)根据我描述的故障现象,现在只能重新安装clusterware来重新初始化votedisk,已达到恢复的目的,这也是最快的方法。
步骤:
1、停止所有节点的clusterware stack
[root@rac6 ~]# su - oracle
[oracle@rac6 ~]$ su
Password:
[root@rac6 oracle]# crsctl stop crs
2、备份每个节点的clusterware的目录
[root@rac1 oracle]# mv /u01/crs /u01/crsbak
3、为了避免新配置和旧的配置信息冲突,最好清除旧的clusterware配置信息
清理旧配置信息(在各节点运行)
3.1 删除crs自启动信息
修改 /etc/inittab, 删除以下三行.
h1:2:respawn:/etc/init.evmd run >/dev/null 2>&1
h2:2:respawn:/etc/init.cssd fatal >/dev/null 2>&1
h3:2:respawn:/etc/init.crsd run >/dev/null 2>&1
linux:
rm /etc/oracle/*
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -f /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
ps -ef|grep init.d
/etc/init.d/init.crsd
/etc/init.d/init.evmd
/etc/init.d/init.cssd
3.2 清理旧配置信息
rm -rf /etc/oracle/* (删除ocr.loc)
rm -rf /var/tmp/.oracle或/tmp/.oracle
3.3使用dd清除vote disk和ocr(裸设备)
dd if=/dev/zero f=/dev/votedisk_device bs=8192 count=2560
dd if=/dev/zero f=/dev/ocr_device bs=8192 count=12800
4、分别在每个节点上执行$CRS_HOME/install/rootdelete.sh
5、在任何一个节点上执行脚本$CRS_HOME/install/rootdeinstall.sh,只需要在一个节点上执行即可。
以上就是删除crs的配置,下面就是重新安装crs ,执行如下的命令检查,如果没有返回值,那就可以继续安装了
ps -e | grep -i ‘ocs[s]d’
ps -e | grep -i ‘cr[s]d.bin’
ps -e | grep -i ‘ev[m]d.bin’
6、和在步骤5同一个节点上执行脚本$CRS_HOME/root.sh
7、在其他节点执行$CRS_HOME/root.sh,然后注意下最后一个节点的输出.
8、用netca重新配置监听器,注册服务到ocr中 rac5
./crs_profile -create ora.rac5.LISTENER_RAC5.lsnr -t application cd /u01/app/oracle/product/11.2.0/crs/crs/profile vi ora.rac5.LISTENER_RAC5.lsnr.cap
ACTION_SCRIPT=/u01/app/oracle/product/11.2.0/crs/bin/racgwrap
Action Script `/u01/app/oracle/product/11.2.0/crs/crs/script/ora.rac6.vip.scr` does not exist! CRS-0213: Could not register resource 'ora.rac6.vip'.
./crs_register ora.rac5.LISTENER_RAC5.lsnr -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/ ./crs_profile -create ora.rac5.vip -t application
./crs_register ora.rac5.vip -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/ ./crs_profile -create ora.rac5.ons -t application
./crs_register ora.rac5.ons -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/ ./crs_profile -create ora.rac5.gsd -t application
./crs_register ora.rac5.gsd -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/ rac6
./crs_profile -create ora.rac6.LISTENER_RAC6.lsnr -t application
./crs_register ora.rac6.LISTENER_RAC6.lsnr -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/
rac6-> ./crs_profile -create ora.rac6.vip -t application -a $ORA_CRS_HOME/bin/uservip -o oi=eth0,ov=192.168.2.183,on=255.255.255.0 rac6-> ./crs_unregister ora.rac6.vip 取消注册
./crs_register ora.rac6.vip -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/ ./crs_profile -create ora.rac6.ons -t application
./crs_register ora.rac6.ons -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/ ./crs_profile -create ora.rac6.gsd -t application
./crs_register ora.rac6.gsd -dir /u01/app/oracle/product/11.2.0/crs/crs/profile/ rac6-> srvctl remove asm -n rac6 -i +ASM2 srvctl remove asm -n rac5 -i +ASM2
srvctl add asm -n rac6 -i +ASM2 -o $ORACLE_HOME rac6-> srvctl remove instance -d prod -i prod2
Remove instance prod2 from the database prod? (y/[n]) y
这个时候用crs_stat -t -v 可以看到listener,ONS,GSD,VIP注册到ocr中,还需要把asm,数据库也注册到ocr中
9、向ocr中注册ASM
srvctl add asm -n rac1 -i +ASM1 -o $ORACLE_HOME
srvctl add asm -n rac2 -i +ASM2 -o $ORACLE_HOME
10、启动ASM
srvctl start asm -n rac1
srvctl start asm -n rac2
一般在启动最后一个asm实例的时候会报错,一般是因为rac无法确认用哪个网络作为 private interconnect
所以可以通过向两个ASM实例的pfile中添加下面两个参数
在文件里添加两个参数/u01/app/oracle/product/10.2.0/db_1/dbs/init+ASM2.ora
+ASM1.cluster_interconnects='192.168.0.31'
+ASM2.cluster_interconnects='192.168.0.22'
ip一定要写对,否则会出现问题,然后重新重启asm实例,问题即可解决
11、手工注册database对象(数据库的名字要和db_name大小写一样)
相关推荐: