[原创]RAC管理_OCR和Voting Disk全部损坏后集群的重建[原创]_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 2576 | 回复: 0   主题: [原创]RAC管理_OCR和Voting Disk全部损坏后集群的重建[原创]        下一篇 
    本主题由 Administrator 于 2014-11-19 9:34:50 移动
tengfei.dong
注册用户
等级:中尉
经验:461
发帖:15
精华:0
注册:1970-1-1
状态:离线
发送短消息息给tengfei.dong 加好友    发送短消息息给tengfei.dong 发消息
发表于: IP:您无权察看 2014-11-19 9:32:09 | [全部帖] [楼主帖] 楼主

集群和数据库版本:11.2.0.3
假设OCR和Voting disk全部损坏,并且没有备份,该如何恢复?处理方法就是重新初始化OCR和Voting disk。具体操作如下:

1.CRS的配置文档:

[grid@edison1 ~]$ cat /g01/grid/app/11.2.0/grid/crs/install/crsconfig_params
# $Header: has/install/crsconfig/crsconfig_params.sbs /st_has_11.2.0/3 2011/03/21 22:55:23 ksviswan Exp $
#
# crsconfig.lib
#
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
#
# NAME
# crsconfig_params.sbs - Installer variables required for root config
#
# DESCRIPTION
# crsconfig_param -
#
# MODIFIED (MM/DD/YY)
# ksviswan 03/08/11 - Backport ksviswan_febbugs2 from main
# ksviswan 02/03/11 - Backport ksviswan_janbugs4 from main
# dpham 05/20/10 - XbranchMerge dpham_bug-8609692 from st_has_11.2.0.1.0
# dpham 03/17/10 - Add TZ variable (9462081
# sujkumar 01/31/10 - CRF_HOME as ORACLE_HOME
# sujkumar 01/05/10 - Double quote args
# dpham 11/25/09 - Remove NETCFGJAR_NAME, EWTJAR_NAME, JEWTJAR_NAME,
# SHAREJAR_NAME, HELPJAR_NAME, and EMBASEJAR_NAME
# sukumar 11/04/09 - Fix CRFHOME. Add CRFHOME2 for Windows.
# anutripa 10/18/09 - Add CRFHOME for IPD/OS
# dpham 03/10/09 - Add ORACLE_BASE
# dpham 11/19/08 - Add ORA_ASM_GROUP
# khsingh 11/13/08 - revert ORA_ASM_GROUP for automated sh
# dpham 11/03/08 - Add ORA_ASM_GROUP
# ppallapo 09/22/08 - Add OCRID and CLUSTER_GUID
# dpham 09/10/08 - set OCFS_CONFIG to sl_diskDriveMappingList
# srisanka 05/13/08 - remove ORA_CRS_HOME, ORA_HA_HOME
# ysharoni 05/07/08 - NETWORKS fmt change s_networkList->s_finalIntrList
# srisanka 04/14/08 - ASM_UPGRADE param
# hkanchar 04/02/08 - Add OCR and OLRLOC for windows
# ysharoni 02/15/08 - bug 6817375
# ahabbas 02/28/08 - temporarily remove the need to instantiate the
# OCFS_CONFIG value
# srisanka 02/12/08 - add OCFS_CONFIG param
# srisanka 01/15/08 - separate generic and OSD params
# jachang 01/15/08 - Prepare ASM diskgroup parameter (commented out)
# ysharoni 12/27/07 - Static pars CSS_LEASEDURATION and ASM_SPFILE
# yizhang 12/10/07 - Add SCAN_NAME and SCAN_PORT
# ysharoni 12/14/07 - gpnp work, cont-d
# jachang 11/30/07 - Adding votedisk discovery string
# ysharoni 11/27/07 - Add GPnP params
# srisanka 10/18/07 - add params and combine crsconfig_defs.sh with this
# file
# khsingh 12/08/06 - add HA parameters
# khsingh 12/08/06 - add HA_HOME
# khsingh 11/25/06 - Creation
# ==========================================================
# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
#
# crsconfig_params.sbs -
#
# ==========================================================
SILENT=false
ORACLE_OWNER=grid
ORA_DBA_GROUP=oinstall
ORA_ASM_GROUP=asmadmin
LANGUAGE_ID=AMERICAN_AMERICA.AL32UTF8
TZ=America/New_York
ISROLLING=true
REUSEDG=false
ASM_AU_SIZE=1
USER_IGNORED_PREREQ=true
ORACLE_HOME=/g01/grid/app/11.2.0/grid
ORACLE_BASE=/g01/grid/app/grid
OLD_CRS_HOME=
JREDIR=/g01/grid/app/11.2.0/grid/jdk/jre/
JLIBDIR=/g01/grid/app/11.2.0/grid/jlib
VNDR_CLUSTER=false
OCR_LOCATIONS=NO_VAL
CLUSTER_NAME=edison-cluster
HOST_NAME_LIST=edison1,edison2
NODE_NAME_LIST=edison1,edison2
PRIVATE_NAME_LIST=
VOTING_DISKS=NO_VAL
#VF_DISCOVERY_STRING=%s_vfdiscoverystring%
ASM_UPGRADE=false
ASM_SPFILE=
ASM_DISK_GROUP=SYSTEMDG
ASM_DISCOVERY_STRING=/dev/asm*
ASM_DISKS=/dev/asm-diskb,/dev/asm-diskc,/dev/asm-diskd,/dev/asm-diske,/dev/asm-diskf
ASM_REDUNDANCY=HIGH
CRS_STORAGE_OPTION=1
CSS_LEASEDURATION=400
CRS_NODEVIPS='edison1-vip/255.255.255.0/eth0,edison2-vip/255.255.255.0/eth0'
NODELIST=edison1,edison2
NETWORKS="eth0"/192.168.1.0:public,"eth1"/172.168.1.0:cluster_interconnect
SCAN_NAME=edison-cluster-scan
SCAN_PORT=1521
GPNP_PA=
OCFS_CONFIG=
# GNS consts
GNS_CONF=false
GNS_ADDR_LIST=
GNS_DOMAIN_LIST=
GNS_ALLOW_NET_LIST=
GNS_DENY_NET_LIST=
GNS_DENY_ITF_LIST=
#### Required by OUI add node
NEW_HOST_NAME_LIST=
NEW_NODE_NAME_LIST=
NEW_PRIVATE_NAME_LIST=
NEW_NODEVIPS='edison1-vip/255.255.255.0/eth0,edison2-vip/255.255.255.0/eth0'
############### OCR constants
# GPNPCONFIGDIR is handled differently in dev (T_HAS_WORK for all)
# GPNPGCONFIGDIR in dev expands to T_HAS_WORK_GLOBAL
GPNPCONFIGDIR=$ORACLE_HOME
GPNPGCONFIGDIR=$ORACLE_HOME
OCRLOC=
OLRLOC=
OCRID=
CLUSTER_GUID=
CLSCFG_MISSCOUNT=
#### IPD/OS
CRFHOME="/g01/grid/app/11.2.0/grid"
[grid@edison1 ~]$


2.停止所有节点的crs:

crsctl stop crs


3.分别在每个节点用root用户执行rootcrs.pl脚本:

脚本全路径:

$ORACLE_HOME/crs/install/rootcrs.pl
/g01/grid/app/11.2.0/grid/crs/install/rootcrs.pl


节点1:

[root@edison1 ~]# /g01/grid/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -verbose -force
Using configuration parameter file: /g01/grid/app/11.2.0/grid/crs/install/crsconfig_params
PRCR-1119 : Failed to look up CRS resources of ora.cluster_vip_net1.type type
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.gsd is registered
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.ons is registered
Cannot communicate with crsd
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Successfully deconfigured Oracle clusterware stack on this node
[root@edison1 ~]#


节点2:

[root@edison2 ~]# /g01/grid/app/11.2.0/grid/crs/install/rootcrs.pl -deconfig -verbose -force
Using configuration parameter file: /g01/grid/app/11.2.0/grid/crs/install/crsconfig_params
PRCR-1119 : Failed to look up CRS resources of ora.cluster_vip_net1.type type
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.gsd is registered
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.ons is registered
Cannot communicate with crsd
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Successfully deconfigured Oracle clusterware stack on this node
[root@edison2 ~]#


3.在所有节点上用root用户执行/g01/grid/app/oraInventory/orainstRoot.sh脚本修改权限。

节点1:

[root@edison1 oraInventory]# pwd
/g01/grid/app/oraInventory
[root@edison1 oraInventory]# ls
backup ContentsXML logs oraInst.loc orainstRoot.sh oui
[root@edison1 oraInventory]# ./orainstRoot.sh
Changing permissions of /g01/grid/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /g01/grid/app/oraInventory to oinstall.
The execution of the script is complete.
[root@edison1 oraInventory]#


节点2:

[root@edison2 oraInventory]# pwd
/g01/grid/app/oraInventory
[root@edison2 oraInventory]# ls
ContentsXML logs oraInst.loc orainstRoot.sh
[root@edison2 oraInventory]# ./orainstRoot.sh
Changing permissions of /g01/grid/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /g01/grid/app/oraInventory to oinstall.
The execution of the script is complete.
[root@edison2 oraInventory]#


4.在主节点上root执行$CRS_HOME/root.sh脚本:

/g01/grid/app/11.2.0/grid/root.sh


节点1执行(先主节点,再其他节点):

[root@edison1 ~]# cd /g01/grid/app/11.2.0/grid
[root@edison1 grid]# ls root.sh
root.sh
[root@edison1 grid]# ./root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /g01/grid/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /g01/grid/app/11.2.0/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
OLR initialization - successful
Adding Clusterware entries to inittab
CRS-2672: Attempting to start 'ora.mdnsd' on 'edison1'
CRS-2676: Start of 'ora.mdnsd' on 'edison1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'edison1'
CRS-2676: Start of 'ora.gpnpd' on 'edison1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'edison1'
CRS-2672: Attempting to start 'ora.gipcd' on 'edison1'
CRS-2676: Start of 'ora.gipcd' on 'edison1' succeeded
CRS-2676: Start of 'ora.cssdmonitor' on 'edison1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'edison1'
CRS-2672: Attempting to start 'ora.diskmon' on 'edison1'
CRS-2676: Start of 'ora.diskmon' on 'edison1' succeeded
CRS-2676: Start of 'ora.cssd' on 'edison1' succeeded
PRKO-2190 : VIP exists for node edison1, VIP name edison1-vip
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@edison1 grid]#


执行成功后验证:

[root@edison1 grid]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....UPDG.dg ora....up.type ONLINE ONLINE edison1
ora.DATA.dg ora....up.type ONLINE ONLINE edison1
ora....ER.lsnr ora....er.type ONLINE ONLINE edison1
ora....N1.lsnr ora....er.type ONLINE ONLINE edison1
ora....EMDG.dg ora....up.type ONLINE ONLINE edison1
ora.asm ora.asm.type ONLINE ONLINE edison1
ora.cvu ora.cvu.type OFFLINE OFFLINE
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE edison1
ora....N1.lsnr application ONLINE ONLINE edison1
ora....an1.gsd application OFFLINE OFFLINE
ora....an1.ons application ONLINE ONLINE edison1
ora....an1.vip ora....t1.type ONLINE ONLINE edison1
ora....an2.vip ora....t1.type ONLINE ONLINE edison1
ora....network ora....rk.type ONLINE ONLINE edison1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE edison1
ora.prod.db ora....se.type ONLINE ONLINE edison1
ora....taf.svc ora....ce.type ONLINE ONLINE edison1
ora.scan1.vip ora....ip.type ONLINE ONLINE edison1
[root@edison1 grid]#


5.在其他节点root执行root.sh:

节点2执行:

[root@edison2 ~]# cd /g01/grid/app/11.2.0/grid
[root@edison2 grid]# ls root.sh
root.sh
[root@edison2 grid]# ./root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /g01/grid/app/11.2.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /g01/grid/app/11.2.0/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
OLR initialization - successful
Adding Clusterware entries to inittab
CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node edison1, number 1, and is terminating
An active cluster was found during exclusive startup, restarting to join the cluster
PRKO-2190 : VIP exists for node edison2, VIP name edison2-vip
Preparing packages for installation...
cvuqdisk-1.0.9-1
Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[root@edison2 grid]#


执行完验证集群是否启动:

[root@edison2 grid]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....UPDG.dg ora....up.type ONLINE ONLINE edison1
ora.DATA.dg ora....up.type ONLINE ONLINE edison1
ora....ER.lsnr ora....er.type ONLINE ONLINE edison1
ora....N1.lsnr ora....er.type ONLINE ONLINE edison1
ora....EMDG.dg ora....up.type ONLINE ONLINE edison1
ora.asm ora.asm.type ONLINE ONLINE edison1
ora.cvu ora.cvu.type OFFLINE OFFLINE
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE edison1
ora....N1.lsnr application ONLINE ONLINE edison1
ora....an1.gsd application OFFLINE OFFLINE
ora....an1.ons application ONLINE ONLINE edison1
ora....an1.vip ora....t1.type ONLINE ONLINE edison1
ora....SM2.asm application ONLINE ONLINE edison2
ora....N2.lsnr application ONLINE ONLINE edison2
ora....an2.gsd application OFFLINE OFFLINE
ora....an2.ons application ONLINE ONLINE edison2
ora....an2.vip ora....t1.type ONLINE ONLINE edison2
ora....network ora....rk.type ONLINE ONLINE edison1
ora.oc4j ora.oc4j.type OFFLINE OFFLINE
ora.ons ora.ons.type ONLINE ONLINE edison1
ora.prod.db ora....se.type ONLINE ONLINE edison1
ora....taf.svc ora....ce.type ONLINE ONLINE edison1
ora.scan1.vip ora....ip.type ONLINE ONLINE edison1


在11g,执行完脚本后集群各资源会自动启动。在10g,有些集群资源不会自动启动,需要手动启动。则执行以下脚本:
(1)、netca命令重新配置监听,确认注册到集群软件中。
(2)、想OCR中添加ASM

#srvctl add asm -n edison1 -i +ASM1 -o /g01/grid/app/11.2.0/grid
#srvctl add asm -n edison2 -i +ASM2 -o /g01/grid/app/11.2.0/grid


(3)、启动ASM

#srvctl start asm -n edison1
#srvctl start asm -n edison2


若启动时报ORA-27550,是因为RAC无法确定使用哪个网卡作为Private Interconnect,解决方法是在两个ASM的pfile文件中添加参数:

+ASM1.cluster_interconnects='172.168.10.191';
+ASM1.cluster_interconnects='172.168.10.192';


(4)、手工像OCR中添加database对象:

#srvctl add database -d prod -o /s01/oracle/app/oracle/product/11.2.0/dbhome_1


(5)、添加两个实例对象

#srvctl add instance -d prod -i PROD1 -n edison1
#srvctl add instance -d prod -i PROD2 -n edison2


(6)、修改实例和ASM的对应关系

#srvctl modify instance -d prod -i prod1 -s +ASM1
#srvctl modify instance -d prod -i prod2 -s +ASM2


(7)、启动数据库

#srvctl start database -d prod


若也出现ORA-27550错误,也是因为RAC无法确定使用哪个网卡作为Private Interconnect,修改pfile参数再重启即可解决。

SQL> alter system set cluster_interconnects='172.168.10.191' scope=spfile sid='PROD1';
SQL> alter system set cluster_interconnects='172.168.10.192' scope=spfile sid='PROD2';


(8)、验证:

#srvctl config database -d prod
[root@edison1 ~]# srvctl config database -d prod
Database unique name: PROD
Database name: PROD
Oracle home: /s01/oracle/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/PROD/spfilePROD.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: PROD
Database instances: PROD1,PROD2
Disk Groups: DATA,BACKUPDG
Mount point paths:
Services: edison_taf
Type: RAC
Database is administrator managed
[root@edison1 ~]#


该贴由system转至本版2014-11-19 9:34:50



赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论