萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> oracle教程 >> oracleRAC無備份情況恢復ocr和olr

oracleRAC無備份情況恢復ocr和olr

   今天是2014-04-01,忙碌了一天終於有時間寫點東西了。前段時間寫了RAc中ocr存在備份的情況下如何恢復,今天寫一下在沒有備份情況下如何去重建ocr和olr呢?

  最大的悲劇莫過於數據庫壞了備份沒了。讓我想起了前幾年流行的一句話:“最大的悲劇是人活著,錢沒了”。總之備份重於一切。

  情景介紹:

  在11G中ocr的asm磁盤組被用戶不小心刪了且所有備份都誤刪,olr呢也損壞了。至此悲劇重演。

  恢復過程:(其實就是使用root.sh重建ocr的過程,重建之後可能需要重新注冊相關資源如listener or database 實例等!)

  1、清空所有節點cluster配置信息:(11G中存在rootcrs.sh腳本,該腳本默認存在於$GRID_HOME/crs/install)。

  注,該腳本需要在root下執行,否則會有錯誤提示

?

1 2 3 4 5 6 [grid@rac-one install]$ ./rootcrs.pl You must be logged in as root to run this script. Log in as root and rerun this script. 2014-04-01 17:08:12: Not running as authorized user Insufficient privileges to execute this script. root or administrative privileges needed to run the script.

  了解該腳本的功能可以查看-help。如升級、回退、重新配置等待》

?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 [root@rac-two install]# ./rootcrs.pl  -help Usage:       rootcrs.pl [-verbose] [-upgrade [-force] | -patch]                  [-paramfile <parameter-file>]                  [-deconfig [-deinstall] [-keepdg] [-force] [-lastnode]]                  [-downgrade -oldcrshome <old crshome path> -version <old crs version> [-force] [-lastnode]]                   [-unlock [-crshome <path to crs home>] [-nocrsstop]]                  [-init]         Options:        -verbose    Run this script in verbose mode        -upgrade    Oracle HA is being upgraded from previous version        -patch      Oracle HA is being upgraded to a patch version        -paramfile  Complete path of file specifying HA parameter values        -lastnode   Force the node this script is executing on to be considered                    as the last node of deconfiguration or downgrade, and perform                    actions associated with deconfiguring or downgrading the                    last node        -downgrade  Downgrade the clusterware        -version    For use with downgrade; special handling is required if                    downgrading to 9i. This is the old crs version in the format                    A.B.C.D.E (e.g 11.1.0.6.0).        -deconfig   Remove Oracle Clusterware to allow it to be uninstalled or reinstalled        -force      Force the execution of steps in delete or dwongrade that cannot                    be verified to be safe        -deinstall  Reset the permissions on CRS home during de-configuration        -keepdg     Keep existing diskgroups during de-configuration        -unlock     Unlock CRS home        -crshome    Complete path of crs home. Use with unlock option        -oldcrshome For use with downgrade. Complete path of the old crs home        -nocrsstop  used with unlock option to reset permissions on an inactive grid home        -init       Reset the permissions of all files and directories under CRS home           If neither -upgrade nor -patch is supplied, a new install is performed         To see the full manpage for this program, execute:         perldoc rootcrs.pl   [root@rac-two install]#

  在root下清除所有節點cluster 信息:

  節點2:

?

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 [grid@rac-one install]$ su Password: [root@rac-one install]# ./rootcrs.pl -deconfig -force Using configuration parameter file: ./crsconfig_params Network exists: 1/192.168.4.0/255.255.255.0/eth
copyright © 萬盛學電腦網 all rights reserved