ITPub博客

首页 > 数据库 > Oracle > voting disk 损坏解决方法---重建crs

voting disk 损坏解决方法---重建crs

原创 Oracle 作者:lovehewenyu 时间:2012-06-29 17:55:30 0 删除 编辑

 

 

首先是删除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 down Oracle Cluster Ready Services (CRS):

Stopping resources.

Error while stopping resources. Possible cause: CRSD is down.

Stopping CSSD.

Unable to communicate with the CSS daemon.

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'

[root@rac1-21 tmp]# /u01/oracle/product/10.2.0/crs_1/install/rootdeinstall.sh

Removing contents from OCR mirror device

2560+0 records in

2560+0 records out

10485760 bytes (10 MB) copied, 0.603055 seconds, 17.4 MB/s

Removing contents from OCR device

2560+0 records in

2560+0 records out

10485760 bytes (10 MB) copied, 0.585491 seconds, 17.9 MB/s

 

[root@rac2-22 ~]# /u01/oracle/product/10.2.0/crs_1/install/rootdelete.sh

Shutting down Oracle Cluster Ready Services (CRS):

Stopping resources.

Error while stopping resources. Possible cause: CRSD is down.

Stopping CSSD.

Unable to communicate with the CSS daemon.

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'

[root@rac2-22 ~]# /u01/oracle/product/10.2.0/crs_1/install/rootdeinstall.sh

Removing contents from OCR mirror device

2560+0 records in

2560+0 records out

10485760 bytes (10 MB) copied, 0.56446 seconds, 18.6 MB/s

Removing contents from OCR device

2560+0 records in

2560+0 records out

10485760 bytes (10 MB) copied, 0.658813 seconds, 15.9 MB/s

 

[root@rac1-21 crs]# /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 if Oracle CRS stack is already configured

 

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry 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 default hostname rac1-21 for node 1.

assigning default hostname rac2-22 for node 2.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node :

node 1: rac1-21 rac1-priv rac1-21

node 2: rac2-22 rac2-priv rac2-22

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

Now formatting voting device: /dev/raw/raw3

Now formatting voting device: /dev/raw/raw4

Now formatting voting device: /dev/raw/raw5

Format of 3 voting devices complete.

Startup will be queued to init within 90 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

        rac1-21

CSS is inactive on these nodes.

        rac2-22

Local node checking complete.

Run root.sh on remaining nodes to start CRS daemons.

 

[root@rac2-22 ~]# /u01/oracle/product/10.2.0/crs_1/bin/oifcfg setif -global eth0ublic/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.gsd application    ONLINE    ONLINE    rac1-21    

ora....-21.ons application    ONLINE    ONLINE    rac1-21    

ora....-21.vip application    ONLINE    ONLINE    rac1-21    

ora....-22.gsd application    ONLINE    ONLINE    rac2-22    

ora....-22.ons application    ONLINE    ONLINE    rac2-22    

ora....-22.vip application    ONLINE    ONLINE    rac2-22    

 

 

 

[root@rac1-21 bin]# 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 Net Services Configuration:

Configuring Listener:LISTENER

ServiceAliasException: Could not save Service Alias: TNS-04406: Object already exists

Default local naming configuration complete.

rac1-21...

rac2-22...

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

 

[ora@rac2-22 ~]$ 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

 

ASM注册CRS

语法:srvctl add asm -n -i -o

[ora@rac1-21 ~]$ srvctl add 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 -i

[ora@rac1-21 ~]$ srvctl remove asm -n rac1-21 -i +ASM1

[ora@rac2-22 ~]$ srvctl remove asm -n rac2-22 -i +ASM2

当前状态,都没有跑

[ora@rac2-22 ~]$ srvctl status asm -n rac1-21

ASM instance +ASM1 is not running on node rac1-21.

[ora@rac2-22 ~]$ srvctl status asm -n rac2-22

ASM instance +ASM1 is not running on node rac2-22.

ASM instance +ASM2 is not running on node rac2-22.

 

Database注册CRS

语法:srvctl add database -d -o

[ora@rac1-21 ~]$ srvctl add database -d racdb -o /u01/oracle/product/10.2.0/db_1/

 

Instance

语法:srvctl add instance -d -i -n

[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 -s -r -P

       -r preferred_list 是首先使用的实例的列表,还可是用-a 表示备用实例

       TAF_policy可设置为NONE,BASIC,PRECONNECT

 

[ora@rac1-21 ~]$ srvctl add service -d racdb -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 -n rac1-21

[ora@rac1-21 ~]$ srvctl remove asm -n rac2-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 -n rac2-22

[ora@rac1-21 ~]$ srvctl start asm -n rac1-21

下面需要时间长点,因为要启动所有节点的数据库么。

[ora@rac1-21 ~]$ srvctl start database -d racdb

[ora@rac1-21 ~]$ srvctl start service -d racdb

 

这里完全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 -n rac1-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-clustered configuration...

All nodes free of non-clustered, local-only configurations.

 

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.shrootdeinstall.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

3kill 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 diskocr(裸设备)

dd if=/dev/zero f=/dev/votedisk_device bs=8192 count=2560

dd if=/dev/zero f=/dev/ocr_device bs=8192 count=12800

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

请登录后发表评论 登录
全部评论

注册时间:2012-02-03

  • 博文量
    267
  • 访问量
    1268259