重新配置与卸载11gR2 Grid Infrastructure(一)

2014-11-24 11:46:44 · 作者: · 浏览: 2
重新配置与卸载11gR2 Grid Infrastructure
Oracle 11g R2 Grid Infrastructure 的安装与配置较之前的版本提供了更多的灵活性。在Grid Infrastructure安装完毕前执行root.sh经常容易出现错误,并且需要修复该错误才能得以继续。
在这个版本中我们可以直接通过执行脚本rootcrs.pl来重新配置Grid Infrastructure而无需先卸载Grid Infrastructure,然后修复故障后进行再次安装。下面描述了rootcrs.pl的用法以及使用deinstall彻底卸载Grid Infrastructure。
1、rootcrs.pl命令介绍
[python] 
#命令位置:$GRID_HOME/crs/install  
#命令说明:  
#  该命令主要是用于对crs进行维护与管理,包括patch,upgrade,downgrade,deconfig等等  
#  perldoc rootcrs.pl执行这个命令获得完整的介绍  
[root@linux1 install]# ./rootcrs.pl -h  
Unknown option: h  
Usage:  
      rootcrs.pl [-verbose] [-upgrade | -patch] [-hahome ]  
                 [-paramfile ]   
                 [-deconfig | -downgrade] [-force] [-lastnode]  
                 [-downgrade] [-oldcrshome ] [-version ]    
                 [-unlock [-crshome ]]  
  
      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  
       -hahome     Complete path of Oracle Clusterware home  
       -paramfile  Complete path of file specifying HA parameter values  
       -lastnode   Force the node this is executing on to be considered the  
                   last node of the install and perform actions associated  
                   with configurig 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 executon of steps in delete that cannot be verified   
                   to be safe  
       -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.  
  
      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.sh失败时,我们可以通过该命令以-deconfig 参数来清除crs的配置信息,然后根据log修复故障或使用patch之后再重新执行root.sh
#对于该命令的patch,upgrade,downgrade用法再此不作详细介绍

2、重新配置Grid Infrastructure及ASM
[python] 
#重新配置Grid Infrastructure并不会移除已经复制的二进制文件,仅仅是回复到配置crs之前的状态,下面是其步骤  
  
a、使用root用户登录,并执行下面的命令(所有节点,但最后一个节点除外)  
  # perl $GRID_HOME/crs/install/rootcrs.pl -verbose -deconfig -force  
    
b、同样使用root用户在最后一个节点执行下面的命令。该命令将清空ocr 配置和voting disk    
  # perl $GRID_HOME/crs/install/rootcrs.pl -verbose -deconfig -force -lastnode  
  
c、如果使用了ASM磁盘,继续下面的操作以使得ASM重新作为候选磁盘(清空所有的ASM磁盘组)  
  # dd if=/dev/zero of=/dev/sdb1 bs=1024 count=100  
  # /etc/init.d/oracleasm deletedisk DATA /dev/sdb1  
  # /etc/init.d/oracleasm createdisk DATA /dev/sdb1  

3、彻底删除Grid Infrastructure
[python] 
#11g R2 Grid Infrastructure也提供了彻底卸载的功能,deinstall该命令取代了使用OUI方式来清除clusterware以及ASM,回复到安装grid之前的环境。  
#该命令将停止集群,移除二进制文件及其相关的所有配置信息。  
#命令位置:$GRID_HOME/deinstall  
#下面是该命令操作的具体事例,操作期间,需要提供一些交互信息,以及在新的session以root身份清除一些/tmp下的文件  
[root@linux1 bin]# ./crsctl check crs  
CRS-4638: Oracle High Availability Services is online  
CRS-4537: Cluster Ready Services is online  
CRS-4529: Cluster Synchronization Services is online  
CRS-4533: Event Manager is online  
[root@linux1 bin]# cd ../deinstall/  
[root@linux1 deinstall]# pwd  
/u01/app/11.2.0/grid/deinstall  
[root@linux1 deinstall]# ./deinstall  
You must not be logged in as root to run ./deinstall.  
Log in as Oracle user and rerun ./deinstall.  
[root@linux1