重新配置与卸载 11gR2 Grid Infrastructure

来源:互联网 发布:energycut软件 编辑:程序博客网 时间:2024/05/18 23:11

Oracle 11g R2 Grid Infrastructure 的安装与配置较之前的版本提供了更多的灵活性。在Grid Infrastructure安装完毕前执行root.sh经常容易出现错误,并且需要修复该错误才能得以继续。在这个版本中我们可以直接通过执行脚本rootcrs.pl来重新配置Grid Infrastructure而无需先卸载Grid Infrastructure,然后修复故障后进行再次安装。下面描述了rootcrs.pl的用法以及使用deinstall彻底卸载Grid Infrastructure。

 

1、rootcrs.pl命令介绍

[python] view plaincopyprint?
  1. #命令位置:$GRID_HOME/crs/install  
  2. #命令说明:  
  3. #  该命令主要是用于对crs进行维护与管理,包括patch,upgrade,downgrade,deconfig等等  
  4. #  perldoc rootcrs.pl执行这个命令获得完整的介绍  
  5. [root@linux1 install]# ./rootcrs.pl -h  
  6. Unknown option: h  
  7. Usage:  
  8.       rootcrs.pl [-verbose] [-upgrade | -patch] [-hahome <directory>]  
  9.                  [-paramfile <parameter-file>]   
  10.                  [-deconfig | -downgrade] [-force] [-lastnode]  
  11.                  [-downgrade] [-oldcrshome <old crshome path>] [-version <old crs version>]    
  12.                  [-unlock [-crshome <path to crs home>]]  
  13.   
  14.       Options:  
  15.        -verbose    Run this script in verbose mode  
  16.        -upgrade    Oracle HA is being upgraded from previous version  
  17.        -patch      Oracle HA is being upgraded to a patch version  
  18.        -hahome     Complete path of Oracle Clusterware home  
  19.        -paramfile  Complete path of file specifying HA parameter values  
  20.        -lastnode   Force the node this is executing on to be considered the  
  21.                    last node of the install and perform actions associated  
  22.                    with configurig the last node  
  23.        -downgrade  Downgrade the clusterware  
  24.        -version    For use with downgrade; special handling is required if  
  25.                    downgrading to 9i. This is the old crs version in the format  
  26.                    A.B.C.D.E (e.g 11.1.0.6.0).  
  27.        -deconfig   Remove Oracle Clusterware to allow it to be uninstalled or reinstalled.  
  28.        -force      Force the executon of steps in delete that cannot be verified   
  29.                    to be safe  
  30.        -unlock     Unlock CRS home   
  31.        -crshome    Complete path of crs home. Use with unlock option.  
  32.        -oldcrshome For use with downgrade. Complete path of the old crs home.  
  33.   
  34.       If neither -upgrade nor -patch is supplied, a new install is performed  
  35.   
  36.       To see the full manpage for this program, execute:  
  37.         perldoc rootcrs.pl       

#对于执行root.sh失败时,我们可以通过该命令以-deconfig 参数来清除crs的配置信息,然后根据log修复故障或使用patch之后再重新执行root.sh
#对于该命令的patch,upgrade,downgrade用法再此不作详细介绍

 

2、重新配置Grid Infrastructure及ASM

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

3、彻底删除Grid Infrastructure

[python] view plaincopyprint?
  1. #11g R2 Grid Infrastructure也提供了彻底卸载的功能,deinstall该命令取代了使用OUI方式来清除clusterware以及ASM,回复到安装grid之前的环境。  
  2. #该命令将停止集群,移除二进制文件及其相关的所有配置信息。  
  3. #命令位置:$GRID_HOME/deinstall  
  4. #下面是该命令操作的具体事例,操作期间,需要提供一些交互信息,以及在新的session以root身份清除一些/tmp下的文件  
  5. [root@linux1 bin]# ./crsctl check crs  
  6. CRS-4638: Oracle High Availability Services is online  
  7. CRS-4537: Cluster Ready Services is online  
  8. CRS-4529: Cluster Synchronization Services is online  
  9. CRS-4533: Event Manager is online  
  10. [root@linux1 bin]# cd ../deinstall/  
  11. [root@linux1 deinstall]# pwd  
  12. /u01/app/11.2.0/grid/deinstall  
  13. [root@linux1 deinstall]# ./deinstall  
  14. You must not be logged in as root to run ./deinstall.  
  15. Log in as Oracle user and rerun ./deinstall.  
  16. [root@linux1 deinstall]# su grid  
  17. [grid@linux1 deinstall]$ ./deinstall  
  18. Checking for required files and bootstrapping ...  
  19. Please wait ...  
  20. Location of logs /tmp/deinstall2013-07-16_05-54-03-PM/logs/  
  21.   
  22. ############ ORACLE DEINSTALL & DECONFIG TOOL START ############  
  23.   
  24. ######################## CHECK OPERATION START ########################  
  25. Install check configuration START  
  26.   
  27. Checking for existence of the Oracle home location /u01/app/11.2.0/grid  
  28. Oracle Home type selected for de-install is: CRS  
  29. Oracle Base selected for de-install is: /u01/app/grid  
  30. Checking for existence of central inventory location /u01/app/oraInventory  
  31. Checking for existence of the Oracle Grid Infrastructure home /u01/app/11.2.0/grid  
  32. The following nodes are part of this cluster: linux1,linux2  
  33.   
  34. Install check configuration END  
  35.   
  36. Traces log file: /tmp/deinstall2013-07-16_05-54-03-PM/logs//crsdc.log  
  37.   
  38. Network Configuration check config START  
  39.   
  40. Network de-configuration trace file location: /tmp/deinstall2013-07-16_05-54-03-PM/logs/netdc_check207506844451155733.log  
  41.   
  42. Network Configuration check config END  
  43.   
  44. Asm Check Configuration START  
  45.   
  46. ASM de-configuration trace file location: /tmp/deinstall2013-07-16_05-54-03-PM/logs/asmcadc_check2698133635629979531.log  
  47.   
  48. ASM configuration was not detected in this Oracle home. Was ASM configured in this Oracle home (y|n) [n]: y  
  49. Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/11.2.0/grid.  
  50. ASM Diagnostic Destination : /u01/app/grid  
  51. ASM Diskgroups : +DATA  
  52. Diskgroups will be dropped  
  53. De-configuring ASM will drop all the diskgroups and it's contents at cleanup time. This will affect all of the databases and ACFS   
  54.   that use this ASM instance(s).  
  55.  If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify by entering 'y'.   
  56.  Do you  want to modify above information (y|n) [n]:   
  57.   
  58. ######################### CHECK OPERATION END #########################  
  59.   
  60. ####################### CHECK OPERATION SUMMARY #######################  
  61. Oracle Grid Infrastructure Home is: /u01/app/11.2.0/grid  
  62. The cluster node(s) on which the Oracle home exists are: (Please input nodes seperated by ",", eg: node1,node2,...)linux1,linux2  
  63. Oracle Home selected for de-install is: /u01/app/11.2.0/grid  
  64. Inventory Location where the Oracle home registered is: /u01/app/oraInventory  
  65. ASM instance will be de-configured from this Oracle home  
  66. Do you want to continue (y - yes, n - no)? [n]: y  
  67. A log of this session will be written to: '/tmp/deinstall2013-07-16_05-54-03-PM/logs/deinstall_deconfig2013-07-16_05-54-37-PM.out'  
  68. Any error messages from this session will be written to: '/tmp/deinstall2013-07-16_05-54-03-PM/logs/deinstall_deconfig2013-07-16_05-54-37-PM.err'  
  69.   
  70. ######################## CLEAN OPERATION START ########################  
  71. ASM de-configuration trace file location: /tmp/deinstall2013-07-16_05-54-03-PM/logs/asmcadc_clean3319637107726750003.log  
  72. ASM Clean Configuration START  
  73. ASM Clean Configuration END  
  74.   
  75. Network Configuration clean config START  
  76.   
  77. Network de-configuration trace file location: /tmp/deinstall2013-07-16_05-54-03-PM/logs/netdc_clean9055263637610505743.log  
  78.   
  79. De-configuring Naming Methods configuration file on all nodes...  
  80. Naming Methods configuration file de-configured successfully.  
  81.   
  82. De-configuring Local Net Service Names configuration file on all nodes...  
  83. Local Net Service Names configuration file de-configured successfully.  
  84.   
  85. De-configuring Directory Usage configuration file on all nodes...  
  86. Directory Usage configuration file de-configured successfully.  
  87.   
  88. De-configuring backup files on all nodes...  
  89. Backup files de-configured successfully.  
  90.   
  91. The network configuration has been cleaned up successfully.  
  92.   
  93. Network Configuration clean config END  
  94.   
  95. ---------------------------------------->  
  96.   
  97. Run the following command as the root user or the administrator on node "linux2".  
  98.   
  99. /tmp/deinstall2013-07-16_05-54-03-PM/perl/bin/perl -I/tmp/deinstall2013-07-16_05-54-03-PM/perl/lib   
  100. -I/tmp/deinstall2013-07-16_05-54-03-PM/crs/install /tmp/deinstall2013-07-16_05-54-03-PM/crs/install/rootcrs.pl -force    
  101. -delete -paramfile /tmp/deinstall2013-07-16_05-54-03-PM/response/deinstall_Ora11g_gridinfrahome1.rsp  
  102.   
  103. Run the following command as the root user or the administrator on node "linux1".  
  104.   
  105. /tmp/deinstall2013-07-16_05-54-03-PM/perl/bin/perl -I/tmp/deinstall2013-07-16_05-54-03-PM/perl/lib  
  106. -I/tmp/deinstall2013-07-16_05-54-03-PM/crs/install /tmp/deinstall2013-07-16_05-54-03-PM/crs/install/rootcrs.pl -force   
  107. -delete -paramfile /tmp/deinstall2013-07-16_05-54-03-PM/response/deinstall_Ora11g_gridinfrahome1.rsp -lastnode  
  108.   
  109. Press Enter after you finish running the above commands  
  110.   
  111. <----------------------------------------  
  112.   
  113. Oracle Universal Installer clean START  
  114.   
  115. Detach Oracle home '/u01/app/11.2.0/grid' from the central inventory on the local node : Done  
  116.   
  117. Delete directory '/u01/app/11.2.0/grid' on the local node : Done  
  118.   
  119. Delete directory '/u01/app/oraInventory' on the local node : Done  
  120.   
  121. Delete directory '/u01/app/grid' on the local node : Done  
  122.   
  123. Detach Oracle home '/u01/app/11.2.0/grid' from the central inventory on the remote nodes 'linux2' : Done  
  124.   
  125. Delete directory '/u01/app/11.2.0/grid' on the remote nodes 'linux2' : Done  
  126.   
  127. Delete directory '/u01/app/oraInventory' on the remote nodes 'linux2' : Done  
  128.   
  129. Delete directory '/u01/app/grid' on the remote nodes 'linux2' : Done  
  130.   
  131. Oracle Universal Installer cleanup was successful.  
  132.   
  133. Oracle Universal Installer clean END  
  134.   
  135.   
  136. Oracle install clean START  
  137.   
  138. Clean install operation removing temporary directory '/tmp/install' on node 'linux1'  
  139. Clean install operation removing temporary directory '/tmp/install' on node 'linux2'  
  140.   
  141. Oracle install clean END  
  142.   
  143. ######################### CLEAN OPERATION END #########################  
  144.   
  145. ####################### CLEAN OPERATION SUMMARY #######################  
  146. ASM instance was de-configured successfully from the Oracle home  
  147. Oracle Clusterware is stopped and successfully de-configured on node "linux2"  
  148. Oracle Clusterware is stopped and successfully de-configured on node "linux1"  
  149. Oracle Clusterware is stopped and de-configured successfully.  
  150. Successfully detached Oracle home '/u01/app/11.2.0/grid' from the central inventory on the local node.  
  151. Successfully deleted directory '/u01/app/11.2.0/grid' on the local node.  
  152. Successfully deleted directory '/u01/app/oraInventory' on the local node.  
  153. Successfully deleted directory '/u01/app/grid' on the local node.  
  154. Successfully detached Oracle home '/u01/app/11.2.0/grid' from the central inventory on the remote nodes 'linux2'.  
  155. Successfully deleted directory '/u01/app/11.2.0/grid' on the remote nodes 'linux2'.  
  156. Successfully deleted directory '/u01/app/oraInventory' on the remote nodes 'linux2'.  
  157. Successfully deleted directory '/u01/app/grid' on the remote nodes 'linux2'.  
  158. Oracle Universal Installer cleanup was successful.  
  159.   
  160. Run 'rm -rf /etc/oraInst.loc' as root on node(s) 'linux1,linux2' at the end of the session.  
  161.   
  162. Oracle install successfully cleaned up the temporary directories.  
  163. #######################################################################  
  164.   
  165. ############# ORACLE DEINSTALL & DECONFIG TOOL END #############
0 0
原创粉丝点击