A-A+

OCR和Votedisk在没有备份的情况下损坏后的恢复

2013年01月12日 DG&RAC&OGG 评论 2 条 阅读 2,165 次

OCR和Votedisk损坏后的恢复(无备份)

--停止所有节点的CRS
[root@rac1 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac1 ~]# /opt/ora10g/product/crs/bin/crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM
[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
[root@rac2 ~]# /opt/ora10g/product/crs/bin/crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM

--执行删除脚本
[root@rac1 ~]# /opt/ora10g/product/crs/install/rootdelete.sh
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Error while stopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable to communicate with the CSS daemon.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'
[root@rac2 ~]# /opt/ora10g/product/crs/install/rootdelete.sh
Shutting down Oracle Cluster Ready Services (CRS):
Stopping resources.
Error while stopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable to communicate with the CSS daemon.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'

--任意节点执行以下脚本
[root@rac1 ~]# /opt/ora10g/product/crs/install/rootdeinstall.sh

Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 7.24653 seconds, 1.4 MB/s

--在上步的同意节点执行root脚本
[root@rac1 ~]# /opt/ora10g/product/crs/root.sh
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /dev/raw/raw2
Format of 1 voting devices complete.
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
CSS is inactive on these nodes.
rac2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.

--在其他节点执行root脚本
[root@rac2 ~]# /opt/ora10g/product/crs/root.sh
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
Oracle Cluster Registry configuration upgraded successfully
WARNING: directory '/opt/ora10g/product' is not owned by root
WARNING: directory '/opt/ora10g' is not owned by root
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
assigning default hostname rac1 for node 1.
assigning default hostname rac2 for node 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
node 2: rac2 rac2-priv rac2
clscfg: Arguments check out successfully.

NO KEYS WERE WRITTEN. Supply -force parameter to override.
-force is destructive and will destroy any previous cluster
configuration.
Oracle Cluster Registry for cluster has already been initialized
Startup will be queued to init within 90 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
rac1
rac2
CSS is active on all nodes.
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Waiting for the Oracle CRSD and EVMD to start
Oracle CRS stack installed and running under init(1M)
Running vipca(silent) for configuring nodeapps
Error 0(Native: listNetInterfaces:[3])
[Error 0(Native: listNetInterfaces:[3])]

--若在其他节点出错,则进行以下操作
[root@rac2 ~]# /opt/ora10g/product/crs/bin/oifcfg iflist
eth0 192.168.137.0
eth1 192.168.136.0
[root@rac2 ~]# /opt/ora10g/product/crs/bin/oifcfg setif -global eth0/192.168.137.0:public
[root@rac2 ~]# /opt/ora10g/product/crs/bin/oifcfg setif -global eth0/192.168.136.0:cluster_interconnect
[root@rac2 ~]# /opt/ora10g/product/crs/bin/oifcfg getif
eth0 192.168.137.0 global public
eth0 192.168.136.0 global cluster_interconnect

--检查CRS
[oracle@rac1 ~]$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
[oracle@rac1 ~]$ crs_stat -t -v
CRS-0202: No resources are registered.

--配置VIP
[oracle@rac1 ~]$ su -
Password:
[root@rac1 ~]# /opt/ora10g/product/crs/bin/vipca
[root@rac1 ~]# su - oracle
[oracle@rac1 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2

--注册相关服务
[oracle@rac1 ~]$ srvctl add asm -n rac1 -i +ASM1 -o /opt/ora10g/product/database
[oracle@rac1 ~]$ srvctl add asm -n rac2 -i +ASM2 -o /opt/ora10g/product/database
[oracle@rac1 ~]$ srvctl start asm -n rac1
[oracle@rac1 ~]$ srvctl start asm -n rac2
[oracle@rac1 ~]$ srvctl add database -d racdb -o /opt/ora10g/product/database
[oracle@rac1 ~]$ srvctl add instance -d racdb -i racdb1 -n rac1
[oracle@rac1 ~]$ srvctl add instance -d racdb -i racdb2 -n rac2
[oracle@rac1 ~]$ srvctl modify instance -d racdb -i racdb1 -s +ASM1
[oracle@rac1 ~]$ srvctl modify instance -d racdb -i racdb2 -s +ASM2
[oracle@rac1 ~]$ srvctl start database -d racdb

--配置listener(先删除,再重建)
注:需要注意用户对等性
[oracle@rac1 ~]$netca

--查看资源状态
[oracle@rac1 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1
ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.gsd application 0/5 0/0 ONLINE ONLINE rac1
ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1
ora.rac1.vip application 0/0 0/0 ONLINE ONLINE rac1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2
ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.gsd application 0/5 0/0 ONLINE ONLINE rac2
ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2
ora.rac2.vip application 0/0 0/0 ONLINE ONLINE rac2
ora.racdb.db application 0/0 0/1 ONLINE ONLINE rac1
ora....b1.inst application 0/5 0/0 ONLINE ONLINE rac1
ora....b2.inst application 0/5 0/0 ONLINE ONLINE rac2

标签:

2 条留言  访客:0 条  博主:0 条

  1. Croco

    这样恢复的与有备份的情况下,有什么差别吗?

    • Yallon King

      这样就是把当前集群信息再次收集一边,把没有收集到的资源手动注册进集群而已。在有备份的情况下,当然就比这个容易多了。

给我留言

Copyright © YallonKing 保留所有权利.   Theme  Ality

用户登录

分享到: