10gR2-11gR1,11gR2如何干净的清除并重建OCR和表决磁盘
下面分别讨论10gR2-11gR1和11gR2干净的清除并重建OCR和表决磁盘的方法。
一.10gR2-11gR1干净的清除并重建OCR和表决磁盘的方法
参考METALINK文章:ID 399482.1
| How to Recreate OCR/Voting Disk Accidentally Deleted [ID 399482.1] | |||||
|
|
|||||
| 修改时间 13-JUN-2011 类型 HOWTO 状态 PUBLISHED | |||||
In this Document
Goal
Solution
References
Applies to:
Oracle Server - Standard Edition - Version: 10.2.0.1 to 11.1.0.7 - Release: 10.2 to 11.1
Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 11.1.0.7 [Release: 10.2 to 11.1]
Generic UNIX
Generic Linux
Oracle Clusterware
Goal
The goal of this document is to help customers who have accidentally deleted the OCR, voting disk or the files that are required for the operation of Oracle clusterware.
Depending on the issue, it may or may not be good idea to execute the steps provided.
- OCR
- If the OCR has been deleted, then check if the OCR mirror is OK and vice versa. It may be prudent to use the OCR mirror to create the OCR. For steps on this check the documentation: Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
- If the OCR mirror and OCR have been deleted, then it may be faster to restore the OCR using the OCR backups. For steps on this check the documentation: Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
- Voting Disk
- If there are multiple voting disks and one was accidentally deleted, then check if there are any backups of this voting disk. If there are no backups then we can add one using the crsctl add votedisk command. The complete steps are in the: Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment Guide
- SCLS directories
- These are internal only directories which are created by root.sh, if this directory is accidentally removed then they can only be created by the steps documented below
- Socket files in /tmp/.oracle or /var/tmp/.oracle
- If these files are accidentally deleted, then stop the Oracle Clusterware on that node and restart it again. This will recreate these socket files. If the socket files for cssd is deleted then the Oracle Clusterware stack may not come down in which case the node has to be bounced.
Solution
If none of the steps documented above can be used to restore the file that was accidentally deleted or is corrupted, then the following steps can be used to re-create/reinstantiate these files. The following steps require complete downtime on all the nodes.
- Shutdown the Oracle Clusterware stack on all the nodes using command crsctl stop crs as root user.
- Backup the entire Oracle Clusterware home.
- Execute <CRS_HOME>/install/rootdelete.sh on all nodes
- Execute <CRS_HOME>/install/rootdeinstall.sh on the node which is supposed to be the first node
- The following commands should return nothing
- ps -e | grep -i 'ocs[s]d'
- ps -e | grep -i 'cr[s]d.bin'
- ps -e | grep -i 'ev[m]d.bin'
- Execute <CRS_HOME>/root.sh on first node
- After successful root.sh execution on first node Execute root.sh on the rest of the nodes of the cluster
- For 10gR2, use racgons. For 11g use onsconfig command. Examples for each are provided below.
For 10g
Execute as owner (generally oracle) of CRS_HOME command
<CRS_HOME>/bin/racgons add_config hostname1:port hostname2:port$/u01/crs/bin/racgons add_config halinux1:6251 halinux2:6251For 11g
Execute as owner (generally oracle) of CRS_HOME command
<CRS_HOME>/install/onsconfig add_config hostname1:port hostname2:port$/u01/crs/install/onsconfig add_config halinux1:6251 halinux2:6251 - Execute as owner of CRS_HOME (generally oracle) <CRS_HOME>/bin/oifcfg setif -global. Please review Note 283684.1 for details.
$/u01/crs/bin/oifcfg setif -global eth0/192.168.0.0:cluster_interconnect eth1/10.35.140.0:public
- Add listener using netca. This may give errors if the listener.ora contains the entries already. If this is the case, move the listener.ora to /tmp from the $ORACLE_HOME/network/admin or from the $TNS_ADMIN directory if the TNS_ADMIN environmental is defined and then run netca. Add all the listeners that were added earlier.
- Add ASM & database resource to the OCR using the appropriate srvctl add database command as the user who owns the ASM & database resource. Please ensure that this is not run as root user
- Add Instance, services using appropriate srvctl add commands. Please refer to the documentation for the exact commands.
- execute cluvfy stage -post crsinst -n node1,node2 ### Please ensure to replace node1,node2 with the node names of the cluster
References
NOTE:557178.1 - RAC on Windows: How To Reinitialize the OCR and Vote Disk (without a full reinstall of Oracle Clusterware)
二.11gR2干净的清除并重建OCR和表决磁盘的方法
11gR2是新版本的数据库,清除并重建OCR和表决磁盘的方法变得更加简单:
执行:$GRID_HOME/crs/install/rootcrs.pl -deconfig -force
如果是RAC的最后一个节点,那么执行:$GRID_HOME/crs/install/rootcrs.pl -deconfig -force -lastnode
注意:
1).如果在RAC中有任何节点是正常工作的,那么在问题节点执行以上命令来清除本节点的OCR和表决磁盘信息,然后重建,不必直接删除OCR和表决磁盘文件进行重建。
2).如果RAC所有节点都出现问题,需要所有节点重建OCR和表决磁盘,那么也不能直接将OCR和表决磁盘删除,重新执行root.sh进行重建,必须同样的执行以上命令,如果将OCR和表决磁盘文件之间删除,执行root.sh脚本会收到如下信息:
上面代码显示是成功的,实际上什么也没做。
结论:
因为在现有的系统中的很多地方都保存有OCR和表决磁盘的相关配置信息,在重建OCR和表决磁盘之前要将其清除干净,不清除干净这些配置信息将无法很好的重建OCR和表决磁盘。10gR2-11gR1和11gR2在清除方法上是不同的,11gR2进行的简化,之前的版本要复杂一些。
另外,清除OCR和表决磁盘并未删除安装好的Oracle软件,而是在现有的基础上重建OCR和表决磁盘。如果要连Oracle相关软件都需要重新安装,10gR2-11gR1请参考文章:http://space.itpub.net/23135684/viewspace-682913 ,11gR2也简化了这个过程,使用GI和Oracle软件Home目录下的deinstall/deinstall命令即可轻松、干净的清除相关配置信息,及Oracle安装的软件。
http://blog.itpub.net/23135684/viewspace-721081/
10gR2-11gR1,11gR2如何干净的清除并重建OCR和表决磁盘的更多相关文章
- 【总文档】rac增加新节点的方法步骤 How to Add Node/Instance or Remove Node/Instance in 10gR2, 11gR1, 11gR2 and 12c Oracle Clusterware and RAC
[总文档]How to Add Node/Instance or Remove Node/Instance in 10gR2, 11gR1, 11gR2 and 12c Oracle Clusterw ...
- 【转】windows server 2012清除并重建SID
windows server 2012清除并重建SID 2012-09-17 17:51:51 标签:SID windows server 2012 原创作品,允许转载,转载时请务必以超链接形式标明文 ...
- 如何干净的清除Slave同步信息
MySQL> show master status; +------------------+-----------+--------------+------------------+---- ...
- OGG 进程清除、重建
背景描述:有时候OGG进程同步出现问题,症状某些进程起不来,而且问题一时半会儿解决不了.最简单的办法是:用数据泵初始化数据,OGG进程重建. 1.查看源端.目的端的进程状态. (作者OGG进程是正常的 ...
- Windows server 2012清除并重建SID
首先介绍下什么是SID SID也就是安全标识符(Security Identifiers),是标识用户.组和计算机帐户的唯一的号码.在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SID. ...
- Windows server 2012R清除并重建SID 用于制作封装模板
首先介绍下什么是SID SID也就是安全标识符(Security Identifiers),是标识用户.组和计算机帐户的唯一的号码.在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SID. ...
- ORACLE 11gR2 RAC添加删除(正常及强制)节点操作步骤(删除篇)
ORACLE 11gR2 RAC添加删除(正常及强制)节点操作步骤(删除篇) 本文主要转载 [ http://www.cnxdug.org/?p=2511 ] 有部分细节自己实验添加,再此谢谢前辈. ...
- 转 oracheck
转 https://dbaplus.cn/news-10-220-1.html ORAchk 之前被称为RACcheck,后来它的检查范围进行了扩展,改名为了ORAchk,它是在数据库系统进行健康检查 ...
- Oracle 补丁那些事儿(PS、PSU、CPU、SPU、BP、DBBP…)
当前ORACLE数据库提供两种方式的补丁一种是主动的Proactive Patches和另一种被动的Reactive Patches,其中Reactive Patches是指过去的ONE-OFF Pa ...
随机推荐
- Oracle对索引列同时使用多个聚合函数的性能问题
Oracle某一数据表tkk715(数据量在一千万左右),对一个索引字段做获取最大值与最小值的聚合函数操作,响应时间较长(超过3秒): 将SQL改写为分别取最大.最小的聚合值,IO和响应时间显著下降到 ...
- HBase(三): Azure HDInsigt HBase表数据导入本地HBase
目录: hdfs 命令操作本地 hbase Azure HDInsight HBase表数据导入本地 hbase hdfs命令操作本地hbase: 参见 HDP2.4安装(五):集群及组件安装 , ...
- iText导出pdf、word、图片
一.前言 在企业的信息系统中,报表处理一直占比较重要的作用,本文将介绍一种生成PDF报表的Java组件--iText.通过在服务器端使用Jsp或JavaBean生成PDF报表,客户端采用超级连接显示或 ...
- ios9 URL Schemes列为白名单,才可正常检查其他应用是否安装
http://my.oschina.net/u/1244672/blog/512210 如果你在模拟器上运行可以能还会有以下报错: -canOpenURL: failed for URL: “weix ...
- PHP 动态执行
PHP 动态执行 在页面上直接输入代码,点击执行,返回执行结果 方法很简单,主要使用了 $newfunc = create_function('', $code); 函数来实现. 代码如下: < ...
- LintCode "Number of Islands II"
A typical Union-Find one. I'm using a kinda Union-Find solution here. Some boiler-plate code - yeah ...
- CXF发布restful WebService的入门例子(客户端)
上篇说了怎么用cxf发布restful webservice,由于浏览器只能对该service发送http的GET请求,所以如果想对服务器上的数据,还需要实现客户端. 客户端的实现方式有无数种...可 ...
- C# Base64字符串转换成图片及图片转换为Base64
最近有朋友经常会问我一些问题,例如,如何把一个字符串转换成base64字符串,如何把一个二进制文件转换成Base64文件,以及如何转换回原有的文件,在此我把方法写一下 字符串与Base64相互转换 ...
- 随笔http
一个HTTP由一条请求命令和一个响应结果组成.这种通信是通过名为HTTP报文(message)的格式化数据块进行的.
- php 消息队列
本消息队列用于linux下,进程通信 #根据路径和后缀创建一个id $key = ftok(__DIR__, 'R'); #获取队列中的消息 $q = msg_get_queue($key); #删除 ...