oracle 10g rac 卸载,oracle 10g rac 卸载

适用于10G --11Gr1

1 使用DBCA删除数据库

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

3 卸载ASM

3.1 查询所有的磁盘组

select * from v$asm_diskgroup

3.2 删除磁盘组

第二个节点

$ export ORACLE_SID=+ASM2

SQL> alter diskgroup DATA dismount;

Diskgroup altered.

第一个节点

SQL> drop diskgroup DATA including contents;

Diskgroup dropped.

这里要注意的,要先在一个节点上将diskgroup dismount后, 在另一个节点进行drop。不然会报:

ORA-15073: diskgroup DATA is mounted by another ASM instance

3.3 关闭ASM实例

$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Dec 11 14:52:48 2012

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

SQL> shutdown immediate

ORA-15100: invalid or missing diskgroup name

ASM instance shutdown

3.4 检查ASM状态 确保是OFFLINE 状态

$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora....SM3.asm application    OFFLINE   OFFLINE

ora....db3.gsd application    ONLINE    ONLINE    zzwsjdb3

ora....db3.ons application    ONLINE    ONLINE    zzwsjdb3

ora....db3.vip application    ONLINE    ONLINE    zzwsjdb3

ora....SM2.asm application    OFFLINE   OFFLINE

ora....db4.gsd application    ONLINE    ONLINE    zzwsjdb4

ora....db4.ons application    ONLINE    ONLINE    zzwsjdb4

ora....db4.vip application    ONLINE    ONLINE    zzwsjdb4

3.5 删除ASM资源

srvctl remove asm -n node1

srvctl remove asm -n node2

如:srvctl remove asm –n rac1, 如果删除不掉,就加上 –f 参数。

如果使用了ASMLIB 按照以下步骤执行

a oracleasm listdisks

b. oracleasm deletedisks (do this for every disk listed above)

c. oracleasm listdisks (to verify they have been deleted)

d. on other RAC nodes: oracleasm listdisks (to verify they have been deleted too)

e. On all nodes(RAC) :

As root run:

# /etc/init.d/oracleasm stop

# /etc/init.d/oracleasm disable

3.6 删除 ASM pfile or spfile

3.7 从/etc/oratab 移除ASM

4 删除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即可进行卸载。

5  用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@rac1 ~]# 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@rac2 ~]#  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'

6 清除OCR

只需要用root用户在本地节点执行如下命令:

$ORA_CRS_HOME/install/rootdeinstall.sh

在一个节点执行即可:

[root@rac1 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

7 卸载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

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

# find / -name oracle

整个Oracle数据库和RAC环境清除工作至此结束,可以重新进行Clusterware和RAC的安装了。这里没有对几个raw设备进行,因为在安装Clusterware的时候,会自动对他们进行格式化。

本文档完全参考 http://blog.csdn.net/tianlesoftware/article/details/5892225

只是在四.      RAC卸载步骤中缺少了卸载ASM 加以补充

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值