重灌Oracle 10g RAC如何幹淨的清理系統

尛樣兒發表於2010-12-30

重灌Oracle 10g RAC如何幹淨的清理系統

重新安裝10g RAC,很多東西都要手動清理,如果清理不乾淨,在重新安裝過程中可能出現一些異常情況。所以當要重新安裝Oracle 10g RAC,建議將現有系統清理乾淨,這點應該引起大家重視。

下面對乾淨的清理系統做出如下說明:

在不重灌作業系統的情況下,做以下的工作來乾淨清理系統:
1.透過參考Metalink文章《How to Clean Up 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 and support 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 Failed 11gR2 Grid Infrastructure (CRS) Installation

Scope and Application

DBA's and Support Analysts

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

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

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 starting when the node boots. To do this issue the 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 already down, 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 example icssvr_daemon process ! 5. If there is no other Oracle software running (like listeners, DB's, etc...), you can remove the files in /var/tmp/.oracle or /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 in the Oracle Universal Installer 8. Remove the CRS install location.

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

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

See the Clusterware Installation Guide for sizing requirements...

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

If you are removing the RDBMS installation, 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 RAC Installation 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 rhgb quiet
        initrd /boot/initrd-2.6.18-164.el5.img

我們在測試的過程中發現,如果不清理乾淨本地磁碟就安裝新的作業系統,可能就會出現root=LABEL=/1的情況。而且在安裝完成重啟後出現預設的root (hd16,0)的情況,導致系統無法啟動,只有手動修改為root (hd0,0)才能正常啟動。為了確保系統能夠正常的執行,在重新安裝作業系統之前最後將本地磁碟也做一個乾淨的清理。
清理方法:
PC伺服器本地磁碟都是透過廠商提供的工具做了RAID的,透過工具將原有做的RAID刪除掉,然後重新建立,即可乾淨的刪除了。例如我們使用的伺服器是HP DL380 G7,透過在啟動的時候根據提示按下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
......

透過以上的操作可以發現對本地磁碟和共享儲存的磁碟的頭資訊的清理是很重要的。按照以上的操作清理乾淨之後就可以重新安裝Oracle 10g RAC了。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-682913/,如需轉載,請註明出處,否則將追究法律責任。

相關文章