前面使用DBCA删除了数据库,下面通过Oracle的安装程序卸载Oracle RAC数据库软件。
编辑一个my_deinstall.rsp文件,内容如下:
RESPONSEFILE_VERSION=2.2.1.0.0
UNIX_GROUP_NAME=oinstall
FROM_LOCATION="/data/database/stage/products.xml"
ORACLE_BASE="/data/oracle"
ORACLE_HOME="/data/oracle/product/11.1/database"
ORACLE_HOME_NAME="OraDb11g_home1"
TOPLEVEL_COMPONENT={"oracle.server","11.1.0.6.0"}
DEINSTALL_LIST={"oracle.server","11.1.0.6.0"}
REMOVE_HOMES="/data/oracle/product/11.1/database"
CLUSTER_NODES="newtrade1","newtrade2"
然后通过runInstaller命令进行清除。
$ ./runInstaller -removeallfiles -silent -deinstall -responseFile /data/database/response/my_deinstall.rsp
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 180 MB. Actual 55948 MB Passed
Checking swap space: must be greater than 150 MB. Actual 57216 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-09-22_02-40-00PM. Please wait ...$ Oracle Universal Installer, Version 11.1.0.6.0 Production
Copyright (C) 1999, 2007, Oracle. All rights reserved.
Starting deinstall
Deinstall in progress (Mon Sep 22 14:40:08 CST 2008)
Configuration assistant "Oracle Database Configuration Assistant - Deinstall" succeeded
Configuration assistant "Oracle Net Configuration Assistant - Deinstall Script" succeeded
............................................................... 50% Done.
............................................................... 100% Done.
Deinstall successful
End of install phases.(Mon Sep 22 14:43:32 CST 2008)
End of deinstallations
Please check '/data/oracle/oraInventory/logs/silentInstall2008-09-22_02-40-00PM.log' for more details.
卸载成功,检查一下对应的日志信息:
$ more /data/oracle/oraInventory/logs/silentInstall2008-09-22_02-40-00PM.log
silentInstall2008-09-22_02-40-00PM.log
Starting deinstall
sNativeVolName:/data/oracle/product/11.1/database/install/
m_asNodeArray:newtrade1,newtrade2m_sLocalNode:newtrade1
This deinstallation was successful
End of deinstallations
日志显示卸载成功。
下面检查ORACLE_HOME对应的目录信息是否已经清除:
$ cd $ORACLE_HOME
$ ls -l
total 70
drwxr-xr-x 3 oracle oinstall 512 Sep 22 14:41 assistants
drwxr-xr-x 5 oracle oinstall 512 Sep 22 14:40 cfgtoollogs
drwxr-xr-x 3 oracle oinstall 512 Sep 22 14:41 ctx
drwxr-xr-x 2 oracle oinstall 512 Sep 22 14:41 dbs
drwxr-xr-x 2 oracle oinstall 512 Sep 22 14:41 install
-rw-r--r-- 1 oracle oinstall 38 Jul 16 14:17 install.platform
drwxrwx--- 14 oracle oinstall 512 Sep 22 14:41 inventory
drwxr-xr-x 2 oracle oinstall 512 Sep 22 14:41 ldap
drwxr-xr-x 2 oracle oinstall 5632 Sep 22 14:41 lib
drwxr-xr-x 2 oracle oinstall 2560 Sep 22 14:41 lib32
drwxr-xr-x 4 oracle oinstall 512 Jul 16 14:39 log
drwxr-xr-x 3 oracle oinstall 512 Sep 22 14:41 network
drwxr----- 3 oracle oinstall 512 Jul 16 15:50 newtrade2_rac11g2
-rw-r--r-- 1 oracle oinstall 60 Jul 16 14:06 oraInst.loc
drwxr-xr-x 3 oracle oinstall 512 Sep 22 14:41 owb
drwxr-xr-x 3 oracle oinstall 512 Sep 22 14:41 racg
drwxr-xr-x 2 oracle oinstall 512 Sep 22 14:41 rdbms
-rwxr-xr-x 1 oracle oinstall 10850 Jul 16 14:22 root.sh
登陆ORACLE_HOME,发现虽然Oracle并没有将ORACLE_HOME目录下所有的文件删除,但是确实已经删除了大部分的内容,而且剩下的部分内容的删除很可能会影响到数据库本身,比如dbs目录下的spfile参数文件和密码文件,network目录下的tnsnames.ora文件等等。
如果愿意,只需要手工删除两个节点上$ORACLE_HOME目录即可:
$ rm -rf /data/oracle/product/11.1/database
至此,Oracle RAC的数据库软件卸载完成