ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle 10g rac 卸载

oracle 10g rac 卸载

原创 Linux操作系统 作者:renjixinchina 时间:2012-12-12 17:22:57 0 删除 编辑
适用于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 加以补充



来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15747463/viewspace-750986/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: oracle 补丁号查询
下一篇: AIX 查询 LUN 大小
请登录后发表评论 登录
全部评论

注册时间:2011-01-30

  • 博文量
    373
  • 访问量
    2161063