voting disk破坏后的恢复
一:将文件返原到原来的raw设备:
用dd来把原来voting备份的文件来返原。
二:在各节点以root用户到crs_home执行crs安装完成的执行的root.sh
rac1-> pwd
/app/oracle/product/10.2.0/crs_1
rac1-> ./root.sh
WARNING: directory '/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/app/oracle/product' is not owned by root
WARNING: directory '/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
Oracle CRS stack is already configured and will be running under init(1M)
rac1->
rac2-> cd /app/oracle/product/10.2.0/crs_1/
rac2-> ./root.sh
WARNING: directory '/app/oracle/product/10.2.0' is not owned by root
WARNING: directory '/app/oracle/product' is not owned by root
WARNING: directory '/app/oracle' is not owned by root
Checking to see if Oracle CRS stack is already configured
Oracle CRS stack is already configured and will be running under init(1M)
三:在各节点以root用户到ORACLE_HOME执行oracel software安装完成的执行的root.sh
rac2-> pwd
/app/oracle/product/10.2.0/crs_1
rac2-> cd ..
rac2-> cd db_1
rac2-> ./root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
rac2->
rac1-> ./root.sh
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
启crs:
rac1-> /etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.
rac2-> /etc/init.d/init.crs start
Startup will be queued to init within 30 seconds.
rac2->
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
四:重建rac的listener ,在任意一台机器的oracle用户下
netca
完成之后:
rac1-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
五:用srvctl增加asm,database,instance:
srvctl add asm -n rac1 -i ASM1 -o /app/oracle/product/10.2.0/db_1
srvctl add asm -n rac2 -i ASM2 -o /app/oracle/product/10.2.0/db_1
srvctl add database -d racdb -o /app/oracle/product/10.2.0/db_1
srvctl add instance -d racdb -i racdb1 -n rac1
srvctl add instance -d racdb -i racdb2 -n rac2
六:将服务启来:
srvctl start asm -n rac1
srvctl start asm -n rac2
srvctl start instance -d racdb -i racdb1
srvctl start instance -d racdb -i racdb2
查看服务:
rac2-> crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
ora.racdb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
哈哈。。。又回来了!
生产库备份CRS真的是有必要的,至少这样将数据库返原回来比起重建CRS(如果datafile在raw设备上的话,或在ASM上没有损坏的话),
会快很多。
参考metalink Note:279793.1
METHOD 2 - RE-INSTALL CRS
-------------------------
The only safe and sure way to re-create the voting disk in 10gR1 is to reinstall
CRS. The deinstallation procedure is the only way we have to undo the CSS fatal
mode, which in turn makes it safe to reinstall.
Only do this after consulting with Oracle Support Services and there is no reasonable
o fix the inconsistency.
Once you re-install CRS, you can restore OCR from one of its automatic backups.
Then, you can back up the voting disk, and also back it up again after any node
addition or deletion operations.
1. Use Note 239998.1 to completely remove the CRS installation.
2. Re-install CRS
3.Run the CRS root.sh as prompted at the end of the CRS install.
4. Run the root.sh in the database $ORACLE_HOME to re-run VIPCA. This will re-create the VIP, GSD, and ONS resources.
5. Use NETCA to re-add any listeners.
6. Add databases and instances with SRVCTL, syntax is in Note 259301.1
如果没有VOTING DISK的话:VOTING DISK和OCR就算全部丢失的话,那么也可以通过重装CLUSTERWARE来解决的,
把原来的都DD掉,重装CRS以后,再添加原来的那些数据库、实例、服务就行了。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/110321/viewspace-621918/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/110321/viewspace-621918/