Oracle11gRAC数据库节点损坏恢复.docx
- 文档编号:11966831
- 上传时间:2023-04-16
- 格式:DOCX
- 页数:13
- 大小:19.38KB
Oracle11gRAC数据库节点损坏恢复.docx
《Oracle11gRAC数据库节点损坏恢复.docx》由会员分享,可在线阅读,更多相关《Oracle11gRAC数据库节点损坏恢复.docx(13页珍藏版)》请在冰豆网上搜索。
Oracle11gRAC数据库节点损坏恢复
Oracle11gR2Rac节点损坏恢复
方正国际公共安全事业部
技术文档
1.文档属性
文档属性
内容
文档名称
Oracle11gR2Rac节点损坏恢复
报告文档版本号
A1
文档状态
正式稿
文档编写完成日期
2016年9月14日
作者
2.文档变更历史清单
文件版本号
修正日期
修正人
备注
3.本次修改变更说明
序号
变更内容简述
1.
2.
3.
4.
5.
第1章概述
##省厅警务综合平台项目中,锦州数据库现场的用户因为在未停止数据库的情况下,扩展磁盘阵列,更换磁盘,导致1节点本地磁盘阵列挂不上,导致只能一个节点使用数据库,需要重新配置oracle集群信息.
第2章系统环境
项目名称服务器名
RAC节点1
RAC节点2
操作系统
RedHat6
RedHat6
集群软件
OracleGRID
OracleGRID
服务器主机名
his1
his2
IP地址〔示例〕
172.
172.
系统用户
用户名
Root
Grid
oracle
系统组
dba
asmdba
asmadmin
oinstall
asmoper
dba
asmdba
asmadmin
oinstall
asmoper
第3章数据库环境
项目名称服务器名称
RAC节点1
RAC节点2
公共IP地址
172.
172.
虚拟IP地址
172.
172.
心跳IP地址
1
ScanIP地址
172.
OracleRACSID
orcl1
orcl2
数据库名称
orcl
数据文件路径
+DATA
归档文件
+ARCH
数据库版本
OracleDatabase11gEnterpriseEditionRelease11.2.0.4.0<64位>
GRID_BASE目录
/u01/app/grid
GRID_HOME目录
ORACLE_BASE目录
/u01/app/oracle
ORACLE_HOME目录
/u01/app/oracle
数据库监听端口
1521
数据库字符集
ZHS16GBK
数据库用户〔sys,system〕密码
oracle
数据库硬盘管理方式
ASM
第4章实施步骤
4.1操作系统准备工作
包括如下操作,主要和rac安装文档相同,如果需要重新安装操作系统,请参考rac安装文档的操作,进行操作系统配置.
下面只列出:
4.1.1配置grid用户与oracle用户等效性
Grid用户
在his1上:
su-grid
$mkdir~/.ssh
$chmod700~/.ssh
$ssh-keygen-trsa
$ssh-keygen-tdsa
$cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
$cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
在his2上:
$mkdir~/.ssh
$chmod700~/.ssh
$ssh-keygen-trsa
$ssh-keygen-tdsa
在his1上:
$sshjkkdb2cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
$sshjkkdb2cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
$scp~/.ssh/authorized_keysjkkdb2:
~/.ssh/authorized_keys
验证
$sshhis1date
$sshhis1-privdate
$sshhis2date
$sshhis2-privdate
Oracle用户<>
在his1上:
su-grid
$mkdir~/.ssh
$chmod700~/.ssh
$ssh-keygen-trsa
$ssh-keygen-tdsa
$cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
$cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
在his2上:
$mkdir~/.ssh
$chmod700~/.ssh
$ssh-keygen-trsa
$ssh-keygen-tdsa
在his1上:
$sshjkkdb2cat~/.ssh/id_rsa.pub>>~/.ssh/authorized_keys
$sshjkkdb2cat~/.ssh/id_dsa.pub>>~/.ssh/authorized_keys
$scp~/.ssh/authorized_keysjkkdb2:
~/.ssh/authorized_keys
验证
$sshhis1date
$sshhis1-privdate
$sshhis2date
$sshhis2-privdate
4.1.2设置raw,磁盘阵列
联系硬件厂家,扩展磁盘操作等等,两个机器的磁盘信息相同,主要是挂的磁盘号要一致.
4.1.3重启his1服务器
4.2停止原来1节点vip
$srvctldisablelistener-llistener_name-nhis1
$srvctlstoplistener-llistener_name-nhis1
4.3删除原1节点数据库实例信息
oracle用户执行:
$dbca-silent-deleteInstance-nodeListhis1-gdbNameorcl-instanceNameorcl1-sysDBAUserNamesys-sysDBAPasswordoracle
此时查看数据库信息:
$srvctlconfigdatabase-dorcl
Databaseuniquename:
orcl
Databasename:
Oracleuser:
oracle
Spfile:
Domain:
Startoptions:
open
Stopoptions:
immediate
Databaserole:
PRIMARY
Managementpolicy:
AUTOMATIC
Serverpools:
orcl
Databaseinstances:
his2-----原来是his1,his2
DiskGroups:
DATA
Mountpointpaths:
Services:
Type:
RAC
Databaseisadministratormanaged
4.4清除rac信息
清除grid
/grid/gridhome/oui/bin/runInstaller-updateNodeListORACLE_HOME=/grid/gridhome"CLUSTER_NODES={his2}"CRS=TRUE-silent
StartingOracleUniversalInstaller...
Checkingswapspace:
mustbegreaterthan500MB.Actual20480MBPassed
Theinventorypointerislocatedat/etc/oraInst.loc
Theinventoryislocatedat/grid/gridbase/oraInventory
'UpdateNodeList'wassuccessful.
清除oracle
/oracle/product/11.2.0/db_1/oui/bin>runInstaller-updateNodeListORACLE_HOME=/oracle/product/11.2.0/db_1"CLUSTER_NODES={his2}"
StartingOracleUniversalInstaller...
Checkingswapspace:
mustbegreaterthan500MB.Actual20480MBPassed
Theinventorypointerislocatedat/etc/oraInst.loc
Theinventoryislocatedat/oracle/oraInventory
'UpdateNodeList'wassuccessful.
查看/grid/gridhome/opmen/conf/ons.config文件
usesharedinstall=true
allowgroup=true
localport=6100#lineaddedbyAgent
remoteport=6200#lineaddedbyAgent
nodes=his2:
6200#lineaddedbyAgent
如果还有his1信息,手工删除
4.5清除1节点vip
$srvctlremovevip-ihis1-vip
PleaseconfirmthatyouintendtoremovetheVIPshis1-vip
4.6检查当前集群信息
$olsnodes-s–t
$crs_stat–t
$cluvfystage-postnodedel-nhis1-verbose
Performingpost-checksfornoderemoval
CheckingCRSintegrity...
Clusterwareversionconsistencypassed
TheOracleClusterwareishealthyonnode"his2"
CRSintegritycheckpassed
Result:
Noderemovalcheckpassed
Post-checkfornoderemovalwassuccessful.
4.7重新添加1节点到集群
4.7.1添加grid软件
环境检查
$cluvfycomppeer-refnodehis2-nhis1-verbose
$cluvfystage-prenodeadd-nhis1–verbose
在/grid/gridhome/oui/bin下:
$exportIGNORE_PREADDNODE_CHECKS=Y
$./addNode.sh-silent"CLUSTER_NEW_NODES={his1}""CLUSTER_NEW_VIRTUAL_HOSTNAMES={his1-vip}"
Performingpre-checksfornodeaddition
Checkingnodereachability...
Nodereachabilitycheckpassedfromnode"his1"
Checkinguserequivalence...
Userequivalencecheckpassedforuser"grid"
Checkingnodeconnectivity...
Checkinghostsconfigfile...
Verificationofthehostsconfigfilesuccessful
.
..
略
..
.
〔WARNING:
Anewinventoryhasbeencreatedononeormorenodesinthissession.However,ithasnotyetbeenregisteredasthecentralinventoryofthissystem.
Toregisterthenewinventorypleaserunthescriptat'/grid/gridbase/oraInventory/orainstRoot.sh'withrootprivilegesonnodes'his1'.
Ifyoudonotregistertheinventory,youmaynotbeabletoupdateorpatchtheproductsyouinstalled.
Thefollowingconfigurationscriptsneedtobeexecutedasthe"root"userineachnewclusternode.Eachscriptinthelistbelowisfollowedbyalistofnodes.
/grid/gridbase/oraInventory/orainstRoot.sh#Onnodeshxbak1
/grid/gridhome/root.sh#Onnodeshis1
Toexecutetheconfigurationscripts:
1.Openaterminalwindow
2.Loginas"root"
3.Runthescriptsineachclusternode
TheClusterNodeAdditionof/grid/gridhomewassuccessful.
Pleasecheck'/tmp/silentInstall.log'formoredetails.
在his1以root用户执行orainstRoot.sh和root.sh两个脚本:
脚本执行过程略.
到这,his1上面grid已经添加完成.Asm和监听vip等都启动了.
查看集群状态
[gridhis2~]$crs_stat-t
NameTypeTargetStateHost
------------------------------------------------------------
ora.ARCHDG.dgora....up.typeONLINEONLINEhis1
ora.CRSDG.dgora....up.typeONLINEONLINEhis1
ora.DATADG.dgora....up.typeONLINEONLINEhis1
ora....ER.lsnrora....er.typeONLINEONLINEhis1
ora....N1.lsnrora....er.typeONLINEONLINEhis2
ora.asmora.asm.typeONLINEONLINEhis1
ora.cvuora.cvu.typeONLINEONLINEhis2
ora.gsdora.gsd.typeOFFLINEOFFLINE
ora....SM1.asmapplicationONLINEONLINEhis1
ora....S1.lsnrapplicationONLINEONLINEhis1
ora.his1.gsdapplicationOFFLINEOFFLINE
ora.his1.onsapplicationONLINEONLINEhis1
ora.his1.vipora....t1.typeONLINEONLINEhis1
ora....SM2.asmapplicationONLINEONLINEhis2
ora....S2.lsnrapplicationONLINEONLINEhis2
ora.his2.gsdapplicationOFFLINEOFFLINE
ora.his2.onsapplicationONLINEONLINEhis2
ora.his2.vipora....t1.typeONLINEONLINEhis2
workora....rk.typeONLINEONLINEhis1
ora.oc4jora.oc4j.typeONLINEONLINEhis2
ora.onsora.ons.typeONLINEONLINEhis1
ora.orcl.dbora....se.typeONLINEONLINEhis2
ora.scan1.vipora....ip.typeONLINEONLINEhis2
4.7.2添加oracle软件
在his2服务器/oui/bin/下执行:
$exportIGNORE_PREADDNODE_CHECKS=Y
$./addNode.sh"CLUSTER_NEW_NODES={his1}"
Savinginventoryonnodes
.100%Done.
Saveinventorycomplete
WARNING:
Thefollowingconfigurationscriptsneedtobeexecutedasthe"root"userineachnewclusternode.Eachscriptinthelistbelowisfollowedbyalistofnodes.
/oracle/product/11.2.0/db1/root.sh#Onnodeshis1
Toexecutetheconfigurationscripts:
1.Openaterminalwindow
2.Loginas"root"
3.Runthescriptsineachclusternode
Pleasecheck'/tmp/silentInstall.log'formoredetails.
在his1节点上以root用户执行脚本
PerformingrootuseroperationforOracle11g
Thefollowingenvironmentvariablesaresetas:
ORACLE_OWNER=oracle
Enterthefullpathnameofthelocalbindirectory:
[/usr/local/bin]:
Thecontentsof"dbhome"havenotchanged.Noneedtooverwrite.
Thecontentsof"oraenv"havenotchanged.Noneedtooverwrite.
Thecontentsof"coraenv"havenotchanged.Noneedtooverwrite.
Entrieswillbeaddedtothe/etc/oratabfileasneededby
DatabaseConfigurationAssistantwhenadatabaseiscreated
Finishedrunninggenericpartofrootscript.
Nowproduct-specificrootactionswillbeperformed.
Finishedproduct-specificrootactions.
查看his1服务器/grid/gridhome/opmn/conf/ons.conf文件
moreons.config
usesharedinstall=true
allowgroup=true
localport=6100#lineaddedbyAgent
remoteport=6200#lineaddedbyAgent
nodes=his1:
6200,his2:
6200#lineaddedbyAgent
如果his2服务的/grid/gridhome/opmn/conf/ons.conf没有添加his1:
6200信息,手工给加上
4.7.3添加数据库实例
在任意节点oracle用户执行dbca
注:
实际当前环境只有1个实例orcl2:
his2active
添加orcl1实例
到此,节点恢复完成.
第5章遇到的问题
在添加oracle软件的时候,因为之前没有执行清除oracle的操作,仅仅是清除了grid信息,导致集群认为his1的oracle软件已经存在,所以无法传文件.解决方案是再执行:
/oracle/product/11.2.0/db_1/oui/bin>runInstaller-updateNodeListORACLE_HOME=/oracle/product/11.2.0/db_1"CLUSTER_NODES={his2}"
然后再添加的时候报错:
Errorocurredwhileretrievingnodenumbersoftheexistingnodes.Pleasecheckifclusterwarehomeisproperlyconfigured.
SEVERE:
Errorocurredwhileretrievingnodenumbersoftheexistingnodes.Pleasecheckifclusterwarehomeisproperlyconfigured.
解决办法是:
copy2files
#cp/grid/_1/bin/
#chownoracle:
oinstall1/bin/olsn*
然后执行
./addNode.sh-silent"CLUSTER_NEW_NODES={his1}""CLUSTER_NEW_VIRTUAL_HOSTNAMES={his1-vip}"
传过去之后需要重新执行orainstRoot.sh和root.sh两个脚本.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Oracle11gRAC 数据库 节点 损坏 恢复
![提示](https://static.bdocx.com/images/bang_tan.gif)