ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 丢失OCR,Voting Disk后如何重建

丢失OCR,Voting Disk后如何重建

原创 Linux操作系统 作者:尛样儿 时间:2010-03-06 21:31:17 0 删除 编辑


        在10gR2的RAC中,Votedisk只能通过dd进程备份,假设没有Votedisk备份或OCR也损坏且没有备份,那么可以重新执行节点的root.sh脚本来初始化Votedisk和OCR,之后使用VIPCA、RACGONS、SRVCTL等工具来重新注册相应的组件即可。重新执行root.sh之前重要的步骤是先将现有的RAC环境的磁盘文件和配置文件清楚干净。参考以下的步骤初始化Votedisk和OCR:
[root@rhel1 install]# ./rootdelete.sh
Shutting down Oracle Cluster Ready Services (CRS):
OCR initialization failed accessing OCR device: PROC-26: Error while accessing the physical storage Operating System error [No such file or directory] [2]
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@rhel1 install]# ./rootdeinstall.sh

Removing contents from OCR device
2560+0 records in
2560+0 records out
10485760 bytes (10 MB) copied, 0.0840325 seconds, 125 MB/s

在其他节点执行:
#./rootdelete.sh
#./rootdeinstall.sh

[root@rhel1 install]# cd ..
[root@rhel1 crs_1]# touch /u01/ocfs2fs/vdisk
[root@rhel1 crs_1]# ./root.sh         
WARNING: directory '/u01/app/oracle' is not owned by root
WARNING: directory '/u01/app' 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/app/oracle' is not owned by root
WARNING: directory '/u01/app' is not owned by root
WARNING: directory '/u01' is not owned by root
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rhel1 rhel1-priv rhel1
node 2: rhel2 rhel2-priv rhel2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Now formatting voting device: /u01/ocfs2fs/vdisk
Format of 1 voting devices complete.
Startup will be queued to init within 30 seconds.
Adding daemons to inittab
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
        rhel1
CSS is inactive on these nodes.
        rhel2
Local node checking complete.
Run root.sh on remaining nodes to start CRS daemons.

在其他节点执行:
#./root.sh

[root@rhel1 bin]# cd /u01/app/oracle/crs_1/bin/
[root@rhel1 bin]# ./crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.rhel1.gsd  application    ONLINE    ONLINE    rhel1      
ora.rhel1.ons  application    ONLINE    ONLINE    rhel1      
ora.rhel1.vip  application    ONLINE    ONLINE    rhel1      
ora.rhel2.gsd  application    ONLINE    ONLINE    rhel2      
ora.rhel2.ons  application    ONLINE    ONLINE    rhel2      
ora.rhel2.vip  application    ONLINE    ONLINE    rhel2

使用netca工具重建Listener。(重建Listener会将监听器信息写入OCR)。
      
[root@rhel1 bin]# ./srvctl add database -d ractest -o /u01/app/oracle/db_1
[root@rhel1 bin]# ./srvctl add instance -d ractest -i ractest1 -n rhel1
[root@rhel1 bin]# ./srvctl add instance -d ractest -i ractest2 -n rhel2  
[root@rhel1 bin]# ./srvctl config database -d ractest
rhel1 ractest1 /u01/app/oracle/db_1
rhel2 ractest2 /u01/app/oracle/db_1

[root@rhel1 bin]# ./srvctl add asm -n rhel1 -i +ASM1 -o /u01/app/oracle/db_1
[root@rhel1 bin]# ./srvctl add asm -n rhel2 -i +ASM2 -o /u01/app/oracle/db_1 
[root@rhel1 bin]# ./crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------
ora.ractest.db application    OFFLINE   OFFLINE              
ora....t1.inst application    OFFLINE   OFFLINE              
ora....t2.inst application    OFFLINE   OFFLINE              
ora.rhel1.gsd  application    ONLINE    ONLINE    rhel1      
ora.rhel1.ons  application    ONLINE    ONLINE    rhel1      
ora....st1.asm application    OFFLINE   OFFLINE              
ora.rhel1.vip  application    ONLINE    ONLINE    rhel1      
ora.rhel2.gsd  application    ONLINE    ONLINE    rhel2      
ora.rhel2.ons  application    ONLINE    ONLINE    rhel2      
ora....st2.asm application    OFFLINE   OFFLINE              
ora.rhel2.vip  application    ONLINE    ONLINE    rhel2
      
[root@rhel1 bin]# ./srvctl start asm -n rhel1
PRKS-1009 : Failed to start ASM instance "+ASM1" on node "rhel1", [PRKS-1009 : Failed to start ASM instance "+ASM1" on node "rhel1", [rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:SQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 8 11:12:21 2010
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:Enter user-name: ERROR:
rhel1:ora.rhel1.ASM1.asm:ORA-09925: Unable to create audit trail file
rhel1:ora.rhel1.ASM1.asm:Linux Error: 13: Permission denied
rhel1:ora.rhel1.ASM1.asm:Additional information: 9925
rhel1:ora.rhel1.ASM1.asm:ORA-01031: insufficient privileges
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:Enter user-name: SP2-0306: Invalid option.
rhel1:ora.rhel1.ASM1.asm:Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
rhel1:ora.rhel1.ASM1.asm:where   ::= [/][@] | /
rhel1:ora.rhel1.ASM1.asm:Enter user-name: Enter password:
rhel1:ora.rhel1.ASM1.asm:ERROR:
rhel1:ora.rhel1.ASM1.asm:ORA-01005: null password given; logon denied
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
rhel1:ora.rhel1.ASM1.asm:
CRS-0215: Could not start resource 'ora.rhel1.ASM1.asm'.]]
  [PRKS-1009 : Failed to start ASM instance "+ASM1" on node "rhel1", [rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:SQL*Plus: Release 10.2.0.4.0 - Production on Mon Mar 8 11:12:21 2010
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:Enter user-name: ERROR:
rhel1:ora.rhel1.ASM1.asm:ORA-09925: Unable to create audit trail file
rhel1:ora.rhel1.ASM1.asm:Linux Error: 13: Permission denied
rhel1:ora.rhel1.ASM1.asm:Additional information: 9925
rhel1:ora.rhel1.ASM1.asm:ORA-01031: insufficient privileges
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:Enter user-name: SP2-0306: Invalid option.
rhel1:ora.rhel1.ASM1.asm:Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
rhel1:ora.rhel1.ASM1.asm:where   ::= [/][@] | /
rhel1:ora.rhel1.ASM1.asm:Enter user-name: Enter password:
rhel1:ora.rhel1.ASM1.asm:ERROR:
rhel1:ora.rhel1.ASM1.asm:ORA-01005: null password given; logon denied
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:
rhel1:ora.rhel1.ASM1.asm:SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
rhel1:ora.rhel1.ASM1.asm:
CRS-0215: Could not start resource 'ora.rhel1.ASM1.asm'.]]

ASM手动启动正常。
INSTANCE,DB启动正常。

        以上的步骤可能并不完整,详尽的步骤参考文章:http://space.itpub.net/23135684/viewspace-721081。
          注意: 在升级后的环境中,我们发现,执行root.sh脚本之后即为最新版本。例如,Oracle Clusterware的基础版本是10.2.0.1,后来升级到10.2.0.5,10.2.0.1对应$ORA_CRS_HOME/root.sh脚本,10.2.0.5对应$ORA_CRS_HOME/install/root102.sh升级脚本,实际只需要执行root.sh脚本,Clusterware即为10.2.0.5,不需要执行root102.sh脚本。可以通过 crsctl query crs activeversion和crsctl query crs softwareversion命令查看Clusterware的版本。

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

请登录后发表评论 登录
全部评论
Oracle数据库管理员,Oracle数据库系统构架员;2012年7月出版《构建最高可用Oracle数据库系统:Oracle 11gR2 RAC管理、维护与性能优化》一书;Oracle 10g OCM。

注册时间:2010-01-05

  • 博文量
    483
  • 访问量
    5651666