您现在的位置: 万盛学电脑网 >> 程序编程 >> 数据库 >> oracle教程 >> 正文

oracleRAC无备份情况恢复ocr和olr

作者:佚名    责任编辑:admin    更新时间:2022-06-22

   今天是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