RAC完全卸载

卸载步骤:

       (1) 删除数据库

       (2) 利用Netca工具删除监听设置

       (3) 删除Oracle 软件

       (4) 用CLUSTER目录下提供的shell来清除CLUSTER系统的所有修改

       (5) 清除OCR中的信息

       (6) 卸载ClusterWare

1 删除数据库

为了更好的卸载数据库,最好是保证数据库处于打开状态,这样DBCA就可以根据读取Oracle数据文件的信息并进行删除。 启动DBCA图形界面,选择Oracle Real Application Cluster database选择。 选择Delete a Databasese。 然后选择FINISH,删除整个数据库文件。

2 利用NETCA工具删除监听设置。

3 删除Oracle 软件

进入$ORACLE_HOME/oui/bin/ 目录,运行runInstaller命令。 进入WELCOME界面后,直接点击Installed Products,这时会弹出一个对话框,在Oracle Homes中有两个对象:OraCrs10g_home和OraDb10g_home。 在删除的时候一定要先选择卸载OraDb10g_home,因为还需要运行Cluster目录下的shell脚本来清除CLUSTER对操作系统进行的修改,所以

OraCrs10g_home的卸载放到后面的步骤中进行。选中OraDb11g_home点击REMOVE即可进行卸载。

4 用CLUSTER目录下提供的shell来清除CLUSTER系统的所有修改
用root用户执行如下脚本:
on local node:
$ORA_CRS_HOME/install/rootdelete.sh local nosharedvar nosharedhome

on remote nodes:
$ORA_CRS_HOME/install/rootdelete.sh remote nosharedvar nosharedhome

执行时,可以加上 -force 参数。

注意:这里的操作必须一个节点一个节点的执行,不能并行操作,就如同安装的时候执行root.sh一样!

在rac1节点执行:

[root@node1 ~]# cd /u01/app/oracle/product/crs/install
[root@rac1 install]# ./rootdelete.sh local nosharedvar nosharedhome
CRS-0210: Could not find resource 'ora.rac1.LISTENER_RAC1.lsnr'.
Shutting down Oracle Cluster Ready Services (CRS):
Sep 17 13:27:28.917 | INF | daemon shutting down
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'

在rac2节点执行:

[root@node2 ~]#  cd /u01/app/oracle/product/crs/install
[root@rac2 install]# ./rootdelete.sh remote nosharedvar nosharedhome
CRS-0210: Could not find resource 'ora.rac2.LISTENER_RAC2.lsnr'.
Shutting down Oracle Cluster Ready Services (CRS):
Sep 17 13:29:48.144 | INF | daemon shutting down
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
Shutdown has begun. The daemons should exit soon.
Checking to see if Oracle CRS stack is down...
Oracle CRS stack is not running.
Oracle CRS stack is down now.
Removing script for Oracle Cluster Ready services
Updating ocr file for downgrade
Cleaning up SCR settings in '/etc/oracle/scls_scr'

5 清除OCR
只需要用root用户在本地节点执行如下命令:
$ORA_CRS_HOME/install/rootdeinstall.sh

在一个节点执行即可:

[root@node1 install]# ./rootdeinstall.sh
Removing contents from OCR mirror device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 0.774432 seconds, 13.5 MB/s
Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 1.36228 seconds, 7.7 MB/s

6 卸载clusterware
进入$ORA_CRS_HOME/oui/bin/ 目录,运行runInstaller命令. 进入WELCOME界面后,点击Installed Products,在弹出的对话框中选择OraCrs10g_home,然后点击REMOVE。

删除/var/opt目录下的Oracle信息和ORACLE_BASE目录:

# rm -rf /data/oracle
# rm -rf /var/opt/oracle

删除/usr/local/bin目录下的设置:

# rm /usr/local/bin/dbhome
# rm /usr/local/bin/oraenv
# rm /usr/local/bin/coraenv

# 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
# rm -f /var/tmp/.oracle/*
# rm -f  /tmp/CVU*
# cp /etc/inittab.orig /etc/inittab


利用操作系统命令检查一下,系统中是否还残留一些Oracle的设置:
# find / -name oracle
整个Oracle数据库和RAC环境清除工作至此结束,可以重新进行Clusterware和RAC的安装了。这里没有对几个raw设备进行,因为在安装Clusterware的时候,会自动对他们进行格式化。

 

备注:这篇稿子主要是根据DAVID的博客整理出来的,详细请参见http://blog.csdn.net/tianlesoftware/archive/2010/09/18/5892225.aspx

你可能感兴趣的:(ORACLE,RAC)