yangtingkun
===========================================================
Solaris10下完全卸载Oracle1106RAC环境
===========================================================

写了几篇关于Oracle RAC环境的安装,还从来没有写过卸载Oracle RAC环境的文章,前两天在测试的时候发现,如果Rac环境无法卸载干净,很可能再次安装RAC环境时会碰到错误,因此这里简单描述一下Oracle RAC环境的卸载。


首先卸载Oracle数据库,为了更好的卸载数据库,最好是保证数据库处于打开状态,这样DBCA就可以根据读取Oracle数据文件的信息并进行删除。

启动DBCA图形界面,选择Oracle Real Application Cluster database选择。

选择Delete a Databasese

然后选择FINISH,删除整个数据库文件。

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

下面运行建立数据库的图形界面runInstaller,开始数据库软件的卸载:

进入WELCOME界面后,直接点击Installed Products,这时会弹出一个对话框,在Oracle Homes中有两个对象:OraCrs11g_homeOraDb11g_home

在删除的时候一定要先选择卸载OraDb11g_home,因为还需要运行Cluster目录下的shell脚本来清除CLUSTER对操作系统进行的修改,所以OraCrs11g_home的卸载放到后面的步骤中进行。

选中OraDb11g_home点击REMOVE即可进行卸载。

下面利用CLUSTER目录下提供的shell来清除CLUSTER系统的所有修改:

在节点2执行:

root@newtrade2 # cd /data/oracle/product/11.1/crs/
root@newtrade2 # . ./install/rootdelete.sh remote nosharedhome -force
Getting local node name
NODE = newtrade2
CRS resources for listeners are still configured.
Getting local node name
NODE = newtrade2
Stopping VIPs that are still up
Getting cluster node names
Cluster Nodes = newtrade1
newtrade2
Stopping vip
Stopping vip
Stopping resources.
This could take several minutes.
Successfully stopped Oracle Clusterware resources
Stopping Cluster Synchronization Services.
Shutting down the Cluster Synchronization Services daemon.
Shutdown request successfully issued.
Waiting for Cluster Synchronization Services daemon to stop
Cluster Synchronization Services daemon has stopped
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 '/var/opt/oracle/scls_scr'
Cleaning up Network socket directories

在节点1执行:

root@newtrade1 # cd /data/oracle/product/11.1/crs/
root@newtrade1 # . ./install/rootdelete.sh remote nosharedhome -force
Getting local node name
NODE = newtrade1
CRS resources for listeners are still configured.
Getting local node name
NODE = newtrade1
Stopping VIPs that are still up
Getting cluster node names
Cluster Nodes = newtrade1
newtrade2
Stopping vip
Stopping vip
Stopping resources.
This could take several minutes.
Successfully stopped Oracle Clusterware resources
Stopping Cluster Synchronization Services.
Shutting down the Cluster Synchronization Services daemon.
Shutdown request successfully issued.
Waiting for Cluster Synchronization Services daemon to stop
Cluster Synchronization Services daemon has stopped
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 '/var/opt/oracle/scls_scr'
Cleaning up Network socket directories

在节点1执行:

root@newtrade1 # ./install/rootdeinstall.sh
Verifying existence of ocr.loc file

Removing contents from OCR device
2560+0 records in
2560+0 records out

下面可以利用CLUSTER的安装程序runInstaller来卸载CLUSTER软件:

进入WELCOME界面后,点击Installed Products,在弹出的对话框中选择OraCrs11g_home,然后点击REMOVE

最后删除/var/opt目录下的Oracle信息和ORACLE_BASE目录,在两个节点分别执行下面的SQL

root@newtrade1 # rm -rf /data/oracle
root@newtrade1 # rm -rf /var/opt/oracle

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

root@newtrade2 # rm /usr/local/bin/dbhome
root@newtrade2 # rm /usr/local/bin/oraenv
root@newtrade2 # rm /usr/local/bin/coraenv

最后利用操作系统命令检查一下,系统中是否还残留一些Oracle的设置:

root@newtrade1 # find / -name oracle
/opt/VRTSvcs/wizards/bin/oracle
/opt/openv/netbackup/ext/db_ext/oracle
/usr/appserver/samples/blueprints/petstore1.4/src/sql/oracle
/usr/appserver/samples/jdbc/apps/simple/setup/sql/oracle
/usr/appserver/samples/security/realms/apps/rdbms/setup/sql/oracle
/export/CFS/MP1/cluster_server_agents/oracle_agent/patches/123670-01/VRTScsocw/reloc/opt/VRTSvcs/wizards/bin/oracle
/export/CFS/veritas/cluster_server_agents/oracle_agent/pkgs/VRTScsocw/reloc/opt/VRTSvcs/wizards/bin/oracle
/export/home/oracle
/data/oracle

这里的oracle相关目录和文件都是其他软件中所包含的文件,比如netbackup等。

如果是利用VCM,则可以利用下面的方法清除共享磁盘:

root@newtrade1 # vxassist -g datavg remove volume ocr
root@newtrade1 # vxassist -g datavg remove volume vot

整个Oracle数据库和RAC环境清除工作至此结束,当然如果愿意可以通过userdelgroupdel删除oracle用户和oinstalldba组。

yangtingkun 发表于:2008.07.19 23:35 ::分类: ( ORACLE ) ::阅读:(212次) :: 评论 (0)

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)

 authimage


切换风格
新闻聚合
博客日历
文章归档...
最新发表...
最新评论...
最多阅读文章...
最多评论文章...
博客统计...
Blog信息
网站链接...