首先是删除CRS,下面是盖老师手动删除的步骤:
http://6month.itpub.net/post/37672/470422
第一,先用脚本试试删除crs,会出现什么情况。
[root@rac1-21 tmp]# /u01/oracle/product/10.2.0/crs_1/install/rootdelete.sh
Shutting downOracle Cluster Ready Services (CRS):
Stoppingresources.
Error whilestopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable tocommunicate with the CSS daemon.
Shutdown hasbegun. The daemons should exit soon.
Checking to see ifOracle CRS stack is down...
Oracle CRS stackis not running.
Oracle CRS stackis down now.
Removing scriptfor Oracle Cluster Ready services
Updating ocr filefor downgrade
Cleaning up SCRsettings in '/etc/oracle/scls_scr'
[root@rac1-21 tmp]#/u01/oracle/product/10.2.0/crs_1/install/rootdeinstall.sh
Removing contentsfrom OCR mirror device
2560+0 records in
2560+0 records out
10485760 bytes (10MB) copied, 0.603055 seconds, 17.4 MB/s
Removing contentsfrom OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10MB) copied, 0.585491 seconds, 17.9 MB/s
[root@rac2-22 ~]#/u01/oracle/product/10.2.0/crs_1/install/rootdelete.sh
Shutting downOracle Cluster Ready Services (CRS):
Stoppingresources.
Error whilestopping resources. Possible cause: CRSD is down.
Stopping CSSD.
Unable tocommunicate with the CSS daemon.
Shutdown hasbegun. The daemons should exit soon.
Checking to see ifOracle CRS stack is down...
Oracle CRS stackis not running.
Oracle CRS stackis down now.
Removing scriptfor Oracle Cluster Ready services
Updating ocr filefor downgrade
Cleaning up SCRsettings in '/etc/oracle/scls_scr'
[root@rac2-22 ~]#/u01/oracle/product/10.2.0/crs_1/install/rootdeinstall.sh
Removing contentsfrom OCR mirror device
2560+0 records in
2560+0 records out
10485760 bytes (10MB) copied, 0.56446 seconds, 18.6 MB/s
Removing contentsfrom OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10MB) copied, 0.658813 seconds, 15.9 MB/s
[root@rac1-21crs]# /u01/oracle/product/10.2.0/crs_1/root.sh
WARNING: directory'/u01/oracle/product/10.2.0' is not owned by root
WARNING: directory'/u01/oracle/product' is not owned by root
WARNING: directory'/u01/oracle' is not owned by root
WARNING: directory'/u01' is not owned by root
Checking to see ifOracle CRS stack is already configured
Setting thepermissions on OCR backup directory
Setting up NSdirectories
Oracle ClusterRegistry configuration upgraded successfully
WARNING: directory'/u01/oracle/product/10.2.0' is not owned by root
WARNING: directory'/u01/oracle/product' is not owned by root
WARNING: directory'/u01/oracle' is not owned by root
WARNING: directory'/u01' is not owned by root
assigning defaulthostname rac1-21 for node 1.
assigning defaulthostname rac2-22 for node 2.
Successfullyaccumulated necessary OCR keys.
Using ports:CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node<nodenumber>: <nodename> <private interconnect name><hostname>
node 1: rac1-21rac1-priv rac1-21
node 2: rac2-22rac2-priv rac2-22
Creating OCR keysfor user 'root', privgrp 'root'..
Operationsuccessful.
Now formattingvoting device: /dev/raw/raw3
Now formattingvoting device: /dev/raw/raw4
Now formattingvoting device: /dev/raw/raw5
Format of 3 votingdevices complete.
Startup will bequeued to init within 90 seconds.
Adding daemons toinittab
Expecting the CRSdaemons to be up within 600 seconds.
CSS is active onthese nodes.
rac1-21
CSS is inactive onthese nodes.
rac2-22
Local node checkingcomplete.
Run root.sh onremaining nodes to start CRS daemons.
[root@rac2-22 ~]#/u01/oracle/product/10.2.0/crs_1/bin/oifcfg setif -globaleth0ublic/192.168.0.0:public
[root@rac2-22 ~]#/u01/oracle/product/10.2.0/crs_1/bin/oifcfg setif -global eth1/192.168.1.0:cluster_interconnect
[root@rac2-22 ~]#/u01/oracle/product/10.2.0/crs_1/bin/oifcfg getif
eth0 192.168.0.0 global public
eth1 192.168.1.0 global cluster_interconnect
[root@rac2-22 ~]#LANG=C
[root@rac2-22 ~]#export DISPLAY=192.168.0.1:0.0
[root@rac2-22 ~]#/u01/oracle/product/10.2.0/crs_1/bin/vipca
[root@rac2-22 ~]#/u01/oracle/product/10.2.0/crs_1/bin/crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....-21.gsdapplication ONLINE ONLINE rac1-21
ora....-21.onsapplication ONLINE ONLINE rac1-21
ora....-21.vipapplication ONLINE ONLINE rac1-21
ora....-22.gsdapplication ONLINE ONLINE rac2-22
ora....-22.onsapplication ONLINE ONLINE rac2-22
ora....-22.vipapplication ONLINE ONLINE rac2-22
[root@rac1-21bin]# mv /u01/oracle/product/10.2.0/db_1/network/admin/listener.ora/tmp/lister.ora.original
[root@rac2-22~]# mv /u01/oracle/product/10.2.0/db_1/network/admin/listener.ora/tmp/lister.ora.original
[root@rac2-22 ~]#su - ora
[ora@rac2-22 ~]$export DISPLAY=192.168.0.1:0.0
[ora@rac2-22 ~]$LANG=C
[ora@rac2-22 ~]$netca
Oracle NetServices Configuration:
Configuring Listener:LISTENER
ServiceAliasException:Could not save Service Alias: TNS-04406: Object already exists
Default localnaming configuration complete.
rac1-21...
rac2-22...
Listenerconfiguration complete.
Oracle NetServices configuration successful. The exit code is 0
[ora@rac2-22 ~]$crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....21.lsnrapplication ONLINE ONLINE rac1-21
ora....-21.gsdapplication ONLINE ONLINE rac1-21
ora....-21.onsapplication ONLINE ONLINE rac1-21
ora....-21.vipapplication ONLINE ONLINE rac1-21
ora....22.lsnrapplication ONLINE ONLINE rac2-22
ora....-22.gsdapplication ONLINE ONLINE rac2-22
ora....-22.onsapplication ONLINE ONLINE rac2-22
ora....-22.vipapplication ONLINE ONLINE rac2-22
ASM注册CRS
语法:srvctl add asm -n <node_name> -i<asm_instance_name> -o <oracle_home>
[ora@rac1-21 ~]$ srvctladd asm -n rac1-21 -i +ASM1 -o$ORACLE_HOME
[ora@rac1-21 ~]$srvctl add asm -n rac1-21 -i +ASM1 -o$ORACLE_HOME
删除ASM注册CRS
语法:srvctl remove asm –n <node_name>-i<asm_instance_name>
[ora@rac1-21 ~]$srvctl remove asm -n rac1-21 -i +ASM1
[ora@rac2-22 ~]$ srvctlremove asm -n rac2-22 -i +ASM2
当前状态,都没有跑
[ora@rac2-22 ~]$srvctl status asm -n rac1-21
ASM instance +ASM1is not running on node rac1-21.
[ora@rac2-22 ~]$srvctl status asm -n rac2-22
ASM instance +ASM1is not running on node rac2-22.
ASM instance +ASM2is not running on node rac2-22.
Database注册CRS
语法:srvctl add database -d <db_unique_name> -o<oracle_home>
[ora@rac1-21 ~]$srvctl add database -d racdb -o /u01/oracle/product/10.2.0/db_1/
Instance
语法:srvctl add instance -d <db_unique_name> -i <instance_name>-n <node_name>
[ora@rac1-21 ~]$srvctl add instance -d racdb -i racdb1 -n rac1-21
[ora@rac1-21 ~]$srvctl add instance -d racdb -i racdb2 -n rac2-22
SERVICE
语法:srvctl add service -d <db_unique_name> -s <service_name>-r <preferred_list> -P <TAF_policy>
-rpreferred_list 是首先使用的实例的列表,还可是用-a 表示备用实例
TAF_policy可设置为NONE,BASIC,PRECONNECT
[ora@rac1-21 ~]$ srvctl add service -dracdb -s oltp -r racdb1,racdb2 -P BASIC
[ora@rac1-21 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....21.lsnr application ONLINE ONLINE rac1-21
ora....-21.gsd application ONLINE ONLINE rac1-21
ora....-21.ons application ONLINE ONLINE rac1-21
ora....-21.vip application ONLINE ONLINE rac1-21
ora....SM1.asm application OFFLINE OFFLINE
ora....SM2.asm application OFFLINE OFFLINE
ora....22.lsnr application ONLINE ONLINE rac2-22
ora....-22.gsd application ONLINE ONLINE rac2-22
ora....-22.ons application ONLINE ONLINE rac2-22
ora....-22.vip application ONLINE ONLINE rac2-22
ora.racdb.db application OFFLINE OFFLINE
ora....oltp.cs application OFFLINE OFFLINE
ora....db1.srv application OFFLINE OFFLINE
ora....db2.srv application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
ASM 配置有点乱了。删除重新配置
[ora@rac1-21 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....21.lsnr application ONLINE ONLINE rac1-21
ora....-21.gsd application ONLINE ONLINE rac1-21
ora....-21.ons application ONLINE ONLINE rac1-21
ora....-21.vip application ONLINE ONLINE rac1-21
ora....SM1.asm application ONLINE OFFLINE
ora....SM2.asm application ONLINE ONLINE rac2-22
ora....22.lsnr application ONLINE ONLINE rac2-22
ora....-22.gsd application ONLINE ONLINE rac2-22
ora....-22.ons application ONLINE ONLINE rac2-22
ora....-22.vip application ONLINE ONLINE rac2-22
ora.racdb.db application OFFLINE OFFLINE
ora....oltp.cs application OFFLINE OFFLINE
ora....db1.srv application OFFLINE OFFLINE
ora....db2.srv application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
[ora@rac1-21 ~]$ srvctl remove asm -nrac1-21
[ora@rac1-21 ~]$ srvctl remove asm -nrac2-22
[ora@rac1-21 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....21.lsnr application ONLINE ONLINE rac1-21
ora....-21.gsd application ONLINE ONLINE rac1-21
ora....-21.ons application ONLINE ONLINE rac1-21
ora....-21.vip application ONLINE ONLINE rac1-21
ora....22.lsnr application ONLINE ONLINE rac2-22
ora....-22.gsd application ONLINE ONLINE rac2-22
ora....-22.ons application ONLINE ONLINE rac2-22
ora....-22.vip application ONLINE ONLINE rac2-22
ora.racdb.db application OFFLINE OFFLINE
ora....oltp.cs application OFFLINE OFFLINE
ora....db1.srv application OFFLINE OFFLINE
ora....db2.srv application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
注册ASM 到CRS,查看成功了
[ora@rac1-21 ~]$ srvctl add asm -n rac1-21-i +ASM1 -o $ORACLE_HOME
[ora@rac2-22 ~]$ srvctl add asm -n rac2-22-i +ASM2 -o $ORACLE_HOME
[ora@rac2-22 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application OFFLINE OFFLINE
ora....21.lsnr application ONLINE ONLINE rac1-21
ora....-21.gsd application ONLINE ONLINE rac1-21
ora....-21.ons application ONLINE ONLINE rac1-21
ora....-21.vip application ONLINE ONLINE rac1-21
ora....SM2.asm application OFFLINE OFFLINE
ora....22.lsnr application ONLINE ONLINE rac2-22
ora....-22.gsd application ONLINE ONLINE rac2-22
ora....-22.ons application ONLINE ONLINE rac2-22
ora....-22.vip application ONLINE ONLINE rac2-22
ora.racdb.db application OFFLINE OFFLINE
ora....oltp.cs application OFFLINE OFFLINE
ora....db1.srv application OFFLINE OFFLINE
ora....db2.srv application OFFLINE OFFLINE
ora....b1.inst application OFFLINE OFFLINE
ora....b2.inst application OFFLINE OFFLINE
开启服务:
[ora@rac1-21 ~]$ srvctl start asm -nrac2-22
[ora@rac1-21 ~]$ srvctl start asm -n rac1-21
下面需要时间长点,因为要启动所有节点的数据库么。
[ora@rac1-21 ~]$ srvctl start database -dracdb
[ora@rac1-21 ~]$ srvctl start service -dracdb
这里完全OK 了, 重建了CRS。而且我们的数据库也可以使用了
[ora@rac1-21 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM1.asm application ONLINE ONLINE rac1-21
ora....21.lsnr application ONLINE ONLINE rac1-21
ora....-21.gsd application ONLINE ONLINE rac1-21
ora....-21.ons application ONLINE ONLINE rac1-21
ora....-21.vip application ONLINE ONLINE rac1-21
ora....SM2.asm application ONLINE ONLINE rac2-22
ora....22.lsnr application ONLINE ONLINE rac2-22
ora....-22.gsd application ONLINE ONLINE rac2-22
ora....-22.ons application ONLINE ONLINE rac2-22
ora....-22.vip application ONLINE ONLINE rac2-22
ora.racdb.db application ONLINE ONLINE rac2-22
ora....oltp.cs application ONLINE ONLINE rac1-21
ora....db1.srv application ONLINE ONLINE rac1-21
ora....db2.srv application ONLINE ONLINE rac2-22
ora....b1.inst application ONLINE ONLINE rac1-21
ora....b2.inst application ONLINE ONLINE rac2-22
SQL> show parameter name
NAME TYPE VALUE
----------------------------------------------- ------------------------------
db_file_name_convert string
db_name string racdb
db_unique_name string racdb
global_names boolean FALSE
instance_name string racdb1
lock_name_space string
log_file_name_convert string
service_names string racdb, oltp
这里出了点问题。我们的SERVICE_NAMES 名字修改了。求解决
[ora@rac2-22 admin]$ cluvfy stage -post crsinst -nrac1-21,rac2-22
Performing post-checks for cluster services setup
Checking node reachability...
Node reachability check passed from node"rac2-22".
Checking user equivalence...
User equivalence check passed for user"ora".
Checking Cluster manager integrity...
Checking CSS daemon...
Daemon status check passed for "CSS daemon".
Cluster manager integrity check passed.
Checking cluster integrity...
Cluster integrity check passed
Checking OCR integrity...
Checking the absence of a non-clusteredconfiguration...
All nodes free of non-clustered, local-onlyconfigurations.
Uniqueness check for OCR device passed.
Checking the version of OCR...
OCR of correct Version "2" exists.
Checking data integrity of OCR...
Data integrity check for OCR passed.
OCR integrity check passed.
Checking CRS integrity...
Checking daemon liveness...
Liveness check passed for "CRS daemon".
Checking daemon liveness...
Liveness check passed for "CSS daemon".
Checking daemon liveness...
Liveness check passed for "EVM daemon".
Checking CRS health...
CRS health check passed.
CRS integrity check passed.
Checking node application existence...
Checking existence of VIP node application (required)
Check passed.
Checking existence of ONS node application (optional)
Check passed.
Checking existence of GSD node application (optional)
Check passed.
Post-check for cluster services setup was successful.
如果脚本删除crs不彻底导致重装CRS不成功,那我们可以手动彻底删除,然后重新装CRS
手动彻底删除crs
如果在安装clusterware的过程报错,需要重新安装时,必须先清除已经安装的cluserware,否则可能会影响到下次安装。一般情况下,只需要在各节点上依次运行目录$ORA_CRS_HOME/install/下的脚本rootdelete.sh和rootdeinstall.sh 即可。
也可以采用如下步骤手工删除:
1、在所有节点停止nodeapps
srvctl stop nodeapps -n nodename
2、删除crs自动启动程序
Sun:
rm /etc/init.d/init.cssd
rm /etc/init.d/init.crs
rm /etc/init.d/init.crsd
rm /etc/init.d/init.evmd
rm /etc/rc3.d/K96init.crs
rm /etc/rc3.d/S96init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
Linux:
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
cp /etc/inittab.orig /etc/inittab
HP-UX:
rm /sbin/init.d/init.cssd
rm /sbin/init.d/init.crs
rm /sbin/init.d/init.crsd
rm /sbin/init.d/init.evmd
rm /sbin/rc2.d/K960init.crs
rm /sbin/rc2.d/K001init.crs
rm /sbin/rc3.d/K960init.crs
rm /sbin/rc3.d/S960init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
HP Tru64:
rm /sbin/init.d/init.cssd
rm /sbin/init.d/init.crs
rm /sbin/init.d/init.crsd
rm /sbin/init.d/init.evmd
rm /sbin/rc3.d/K96init.crs
rm /sbin/rc3.d/S96init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
IBM AIX:
rm /etc/init.cssd
rm /etc/init.crs
rm /etc/init.crsd
rm /etc/init.evmd
rm /etc/rc.d/rc2.d/K96init.crs
rm /etc/rc.d/rc2.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -Rf /etc/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
3、kill css/crs/evm进程,并reboot节点
ps -ef | grep css/crs/evm
kill -9 processid
4、删除/tmp/.oracle或/var/tmp/.oracle
rm -f /tmp/.oracle 或rm -f /var/tmp/.oracle
5、删除ocr.loc
rm -f /etc/oracle/orc.loc
6、用oracle universal installer卸载crs
7、删除crs安装目录
rm -Rf crs_install_dir
8、使用dd清除vote disk和ocr(裸设备)
dd if=/dev/zero f=/dev/votedisk_device bs=8192count=2560
dd if=/dev/zero f=/dev/ocr_device bs=8192 count=12800