天天看點

重裝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了。