重装Oracle 10g RAC如何干净的清理系统

重装Oracle 10g RAC如何干净的清理系统

重新安装10g RAC,很多东西都要手动清理,如果清理不干净,在重新安装过程中可能出现一些异常情况。所以当要重新安装Oracle 10g RAC,建议将现有系统清理干净,这点应该引起大家重视。

下面对干净的清理系统做出如下说明:

在不重装操作系统的情况下,做以下的工作来干净清理系统:
1.通过参考Metalink文章《How to CleanUp After a Failed 10g or 11.1 Oracle Clusterware Installation》来干净的清理Oracle RAC的安装文件。


How to Clean Up After a Failed 10g or 11.1 Oracle Clusterware Installation [ID 239998.1]


 

修改时间 28-OCT-2010     类型 BULLETIN     状态 PUBLISHED

 

Applies to:

Oracle Server - Enterprise Edition - Version:10.1.0.2 to 11.1.0.8 - Release: 10.1 to 11.1
Generic UNIX

Purpose

The purpose of this document is to help DBA's andsupport analysts understand how
to clean up a failed CRS (Cluster Ready Services) install for 10g and 11.1 RAC.

For 11.2, see Note: 942166.1 How to Proceed from Failed11gR2 Grid Infrastructure (CRS) Installation

Scope and Application

DBA's and Support Analysts

How to Clean Up After a Failed 10g or 11.1Oracle Clusterware Installation

10g and 11.1 RAC: How to Clean Up After a Failed CRSInstall
------------------------------------------------------------

Not cleaning up a failed CRS install can cause problems like node reboots.
Follow these steps to clean up a failed CRS install:



1. Run the rootdelete.sh script. then the rootdeinstall.sh script. from the
$ORA_CRS_HOME/install directory on any nodes you are removing CRS from.  Running
these scripts should be sufficent to clean up your CRS install.  Rootdelete.sh
accepts options like nosharedvar/sharedvar, and nosharedhome/sharedhome. Make
yourself familiar with these options by reading the Oracle Clusterware and
Oracle Real Application Clusters Administration and Deployment Guide.
If you have any problems with these scripts please open a service request. 

If for some reason you have to manually remove the install due to problems
with the scripts, continue to step 2:

   



2. Stop the Nodeapps on all nodes:

 

   


        srvctl stop nodeapps -n

 

 

3. Prevent CRS from startingwhen the node boots.  To do this issuethe following

as root:

 

Sun:

 

      rm /etc/init.d/init.cssd

      rm /etc/init.d/init.crs

      rm /etc/init.d/init.crsd

      rm /etc/init.d/init.evmd

      rm /etc/rc3.d/K96init.crs

      rm /etc/rc3.d/S96init.crs

        rm -Rf /var/opt/oracle/scls_scr

        rm -Rf /var/opt/oracle/oprocd

      rm /etc/inittab.crs

      cp /etc/inittab.orig /etc/inittab

 

Linux:

 

        rm /etc/oracle/*

      rm -f /etc/init.d/init.cssd

      rm -f /etc/init.d/init.crs

      rm -f /etc/init.d/init.crsd

      rm -f /etc/init.d/init.evmd

      rm -f /etc/rc2.d/K96init.crs

      rm -f /etc/rc2.d/S96init.crs

      rm -f /etc/rc3.d/K96init.crs

      rm -f /etc/rc3.d/S96init.crs

      rm -f /etc/rc5.d/K96init.crs

      rm -f /etc/rc5.d/S96init.crs

        rm -Rf /etc/oracle/scls_scr

      rm -f /etc/inittab.crs

      cp /etc/inittab.orig /etc/inittab

 

HP-UX:

 

      rm /sbin/init.d/init.cssd

      rm /sbin/init.d/init.crs

      rm /sbin/init.d/init.crsd

      rm /sbin/init.d/init.evmd

        rm /sbin/rc2.d/K960init.crs

        rm /sbin/rc2.d/K001init.crs

      rm /sbin/rc3.d/K960init.crs

      rm /sbin/rc3.d/S960init.crs

        rm -Rf /var/opt/oracle/scls_scr

        rm -Rf /var/opt/oracle/oprocd

      rm /etc/inittab.crs

      cp /etc/inittab.orig /etc/inittab

 

HP Tru64:

 

      rm /sbin/init.d/init.cssd

      rm /sbin/init.d/init.crs

      rm /sbin/init.d/init.crsd

      rm /sbin/init.d/init.evmd

      rm /sbin/rc3.d/K96init.crs

      rm /sbin/rc3.d/S96init.crs

        rm -Rf /var/opt/oracle/scls_scr

        rm -Rf /var/opt/oracle/oprocd

      rm /etc/inittab.crs

      cp /etc/inittab.orig /etc/inittab

 

IBM AIX:

 

      rm /etc/init.cssd

      rm /etc/init.crs

      rm /etc/init.crsd

      rm /etc/init.evmd

      rm /etc/rc.d/rc2.d/K96init.crs

      rm /etc/rc.d/rc2.d/S96init.crs

        rm -Rf /etc/oracle/scls_scr

        rm -Rf /etc/oracle/oprocd

      rm /etc/inittab.crs

      cp /etc/inittab.orig /etc/inittab

 

4. If they are not alreadydown, kill off EVM, CRS, and CSS processes or reboot

   the node:

 

      ps -ef | grep crs

      kill

      ps -ef | grep evm

      kill

      ps -ef | grep css

      kill

 

   Do not kill any OS processes, for exampleicssvr_daemon process !

 

5. If there is no otherOracle software running (like listeners, DB's, etc...),

   you can remove the files in /var/tmp/.oracleor /tmp/.oracle.  Example:

 

        rm -f /var/tmp/.oracle/*

 

        or

 

        rm -f /tmp/.oracle/*

 

6. Remove the ocr.loc

   Usually the ocr.loc can be found at/etc/oracle

 

7. De-install the CRS home inthe Oracle Universal Installer

 

8. Remove the CRS installlocation.

 



9. Clean out the OCR and Voting Files with dd commands.  Example:

        dd if=/dev/zerof=/dev/rdsk/V1064_vote_01_20m.dbf bs=1M count=256
        dd if=/dev/zerof=/dev/rdsk/ocrV1064_100m.ora bs=1M count=256

   See the Clusterware Installation Guidefor sizing requirements... 

   If you placed the OCR and voting diskon a shared filesystem, remove them.

   If you are removing the RDBMSinstallation, also clean out any ASM disks if
   they have already been used.



10. The /tmp/CVU* dir should be cleaned also to avoid the cluvfy misreporting.

11. It is good practice to reboot the node before starting the next install.

12.If you would like to re-install CRS, follow the steps in the RACInstallation manual.

2.清空共享存储磁盘头信息,这点很重要,一般共享磁盘是做了分区,我们需要通过dd命令来清空磁盘分区的头信息。
例如:dd if=/dev/zero f=/dev/sdb1 bs=1024 count=10000

可能我们使用HP的多路径软件聚合了路径,也可以直接操作多路径聚合后的分区设备,例如/dev/mapper/mpath3p1。总之,要将存储在共享设备上的OCR,VOTEDISK等分区使用dd命令来清理干净。

在连操作系统都重新安装的情况下,在完成上面的工作之前肯定是安装操作系统,在安装操作系统也需要考虑将本地磁盘清理干净,如果仅靠在安装的时候删除磁盘分区,然后重新制定磁盘分区并不能清理干净,这样重新安装的系统可能会出现以下的情况:
title Enterprise Linux (2.6.18-164.el5)
        root(hd16,0)
        kernel/boot/vmlinuz-2.6.18-164.el5 ro root=LABEL=/1 rhgbquiet
        initrd/boot/initrd-2.6.18-164.el5.img

我们在测试的过程中发现,如果不清理干净本地磁盘就安装新的操作系统,可能就会出现root=LABEL=/1的情况。而且在安装完成重启后出现默认的root (hd16,0)的情况,导致系统无法启动,只有手动修改为root(hd0,0)才能正常启动。为了确保系统能够正常的运行,在重新安装操作系统之前最后将本地磁盘也做一个干净的清理。
清理方法:
PC服务器本地磁盘都是通过厂商提供的工具做了RAID的,通过工具将原有做的RAID删除掉,然后重新创建,即可干净的删除了。例如我们使用的服务器是HP DL380G7,通过在启动的时候根据提示按下Ctrl + S。即可进入创建RAID的界面,将原有的Logic Volume删除掉,然后新建一个Logic Volume即可。

操作系统重新安装之后,挂载在服务器上的存储也需要按照上面所说的dd命令的方法清理干净磁盘头信息,然后再安装多路径软件,再在聚合后的多路径软件的基础上分区。

例如,清理共享存储磁盘的头信息:
dd if=/dev/zero f=/dev/sdb bs=1024 count=10000
dd if=/dev/zero f=/dev/sdc bs=1024 count=10000
dd if=/dev/zero f=/dev/sdd bs=1024 count=10000
dd if=/dev/zero f=/dev/sde bs=1024 count=10000
......

通过以上的操作可以发现对本地磁盘和共享存储的磁盘的头信息的清理是很重要的。按照以上的操作清理干净之后就可以重新安装Oracle10g RAC了。

 


阅读更多
文章标签: cleanup oracle 10g rac
个人分类: oracle
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭