voting disk 損壞解決方法---重建crs

lovehewenyu發表於2012-06-29

 

 

首先是刪除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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章