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.

  1. Shutdown the Oracle Clusterware stack on all the nodes using command crsctl stop crs as root user.
  2. Backup the entire Oracle Clusterware home.
  3. Execute <CRS_HOME>/install/rootdelete.sh on all nodes
  4. Execute <CRS_HOME>/install/rootdeinstall.sh on the node which is supposed to be the first node
  5. 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‘
  6. Execute <CRS_HOME>/root.sh on first node
  7. After successful root.sh execution on first node Execute root.sh on the rest of the nodes of the cluster
  8. 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:6251

    For 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

  9. 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
  10. 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.
  11. 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
  12. Add  Instance, services using appropriate srvctl add commands. Please refer to the documentation for the exact commands.
  13. 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脚本会收到如下信息:

[[email protected] grid]# ./root.sh

Performing root user operation for Oracle 11g

The following environment variables are set as:

ORACLE_OWNER= grid

ORACLE_HOME=  /u01/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: /u01/app/11.2.0/grid/crs/install/crsconfig_params

User ignored Prerequisites during installation

Configure Oracle Grid Infrastructure for a Cluster ... succeeded

上面代码显示是成功的,实际上什么也没做。

结论:
        因为在现有的系统中的很多地方都保存有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/

时间: 2024-08-26 03:33:33

10gR2-11gR1,11gR2如何干净的清除并重建OCR和表决磁盘的相关文章

擦干净屁股-清除入侵日志

应用程序日志.安全日志.系统日志. DNS日志默认位置:%systemroot%system32config,默认文件大小512KB,管理员都会改变这个默认大小.安全日志文件:%systemroot%system32configSecEvent.EVT系统日志文件:%systemroot%system32configSysEvent.EVT应用程序日志文件:%systemroot%system32configAppEvent.EVTFTP日志默认位置:%systemroot%system32lo

讨论数据库的升级(10gR2至11gR2)

今天对数据库升级做了大致了解,还是很多东西值得考虑的. 首先,升级前的准备就很多工作需要做: 1. 测试和准备, 主要是应用的做压力测试.因为版本升级,优化器可能使SQL性能回退(选择性能更差的执行计划),可以结合database replay做压力测试,SPA模拟环境变化的影响,以及SPM对执行计划做固定. 2. 升级的方法, 主要是图形界面DBUA(新目录的路径)来完成,相对简单:手工升级(手工执行脚本.DBUA只不过将这些手工动作代替而已.新目录路径):EXPDP(源库路径)/IMPDP(

Windows server 2012清除并重建SID

首先介绍下什么是SID SID也就是安全标识符(Security Identifiers),是标识用户.组和计算机帐户的唯一的号码.在第一次创建该帐户时,将给网络上的每一个帐户发布一个唯一的 SID. 如果存在两个同样SID的用户,这两个帐户将被鉴别为同一个帐户,原理上如果帐户无限制增加的时候,会产生同样的SID,在通常的情况下SID是唯一的,他由计算机名.当前时间.当前用户态线程的CPU耗费时间的总和三个参数决定以保证它的唯一性. 一个完整的SID包括:· 用户和组的安全描述· 48-bit的

转 oracheck

转 https://dbaplus.cn/news-10-220-1.html ORAchk 之前被称为RACcheck,后来它的检查范围进行了扩展,改名为了ORAchk,它是在数据库系统进行健康检查的一个专用工具,这个工具主要用来检查软件的配置是否符合要求以及一些最佳实践是否被应用了.通过这个工具,用户可以很方便地.自动化地对自己的系统进行健康检查和评估. 目录 ORAchk 基本情况介绍 如何下载和安装ORAchk 如何执行orachk ORAchk生成的报告 ORAchk 升级检查功能 什

【翻译自mos文章】已经安装的Oracle database组件和自带的用户信息

来源于: Information On Installed Database Components and Schemas (文档 ID 472937.1) 注意:本文内容很多,不做全部的翻译,只列示如下目录和Oracle数据库中自带的用户: 1. JServer JAVA Virtual Machine 2. OLAP Catalog, OLAP Analytic Workspace, Oracle OLAP API 3. Oracle Data Mining 4. Oracle InterM

Oracle 补丁那些事儿(PS、PSU、CPU、SPU、BP、DBBP…)

当前ORACLE数据库提供两种方式的补丁一种是主动的Proactive Patches和另一种被动的Reactive Patches,其中Reactive Patches是指过去的ONE-OFF Patch,而过去的PSU,SPU/CPU,BP都是Proactive Patches.从12c(12.1.0.2)起数据库又提供了一个名为DBBP的补丁类型,在数据库安装选择补丁时建议是PSU,CPU,DBBP中的一种,在12c以前至少是安装相应版本的PSU,而从12.1.0.2起想要安装更全的补丁集

执行root.sh报错:CLSRSC-196: ACFS driver install action

oracle 19c已经发布了快一年了,在AIX和Linux上面安装的次数也不少了,安装的方法也层出不穷,最常用的就是图形化了,可以避免静默安装发现不了的问题.今天帮助一位朋友安装oracle 19c rac,在执行root.sh的时候,报错了.下面就详细分析下:执行root.sh,屏幕打印日志,显示在安装acfs的时候,报错failed了,前台日志只是显示failed,并没有具体的报错信息,我们在相关路径下面查找root.sh的日志,路径在前台日志重有显示,为/u01/app/grid/crs

磁盘安装启动的方法与ASM

1.可用的raid级别 raid0 raid1 raid5 raid10   比raid 01好 raid100  这种raid级别优点主要是:改进随机读的性能和消除热点 2.更新的raid5 尽管raid5是一种廉价的冗余方案,但它对于写入密集型操作的性能较差. 当对raid 5 阵列发出一个写入请求时,必须改变磁盘上已修改的块,从磁盘上读取'奇偶校验块',并且使用已修改的块来计算新的奇偶校验块,然后把数据写入磁盘上,无论请求写入的数据量为多少,这个过程都会限制吞吐量,因为对于每一次写操作,都

Oracle 11gR2 RAC 新特性说明

最近接触了一下Oracle 11g R2 的RAC,发现变化很大. 所以在自己动手做实验之前还是先研究下它的新特性比较好. 一.    官网介绍 先看一下Oracle 的官网文档里对RAC 新特性的一点说明. Oracle Database 11g Release 2 (11.2.0.2) New Features in Oracle RAC http://download.oracle.com/docs/cd/E11882_01/rac.112/e16795/whatsnew.htm#CHDJ