Oracle OCR的备份与恢复

0    287    1

Tags:

👉 本文共约41787个字,系统预计阅读时间或需158分钟。

前言部分

导读和注意事项

各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识,~O(∩_∩)O~:

① rac中OCR的简介及其作用

② rac中OCR的备份和恢复

③ rac的健忘与脑裂

④ grid用户下的日志文件:$ORACLE_HOME/log文件夹内容被删除导致集群不能启动如何恢复?(重点)

⑤ 如何修复11.2 Grid权限误操作【(How to check and fix file permissions on Grid Infrastructure environment (文档 ID 1931142.1)】

⑥ 如何修复ASM实例名和节点名不一致的情况【How to Change 11.2 ASM Configuration to Match ASM Instance Name to the Node Where It Runs? (example, +ASM2 on Node2, etc) (文档 ID 1419424.1)】

⑦ permission.pl脚本的使用

本文简介

写这篇blog的情况是这样的,rac启动有问题,但是$GRID_HOME/log下的文件太多了,我就把下边的内容清空了,结果是集群更加不能启动就连基本的日志也没有了,重启OS无效,最后在仔细的想了想查看了一下运行正常的库的$GRID_HOME/log下的文件结构,发现有的文件夹最后有个T或t的权限,由此联想到可能是权限的缘故导致的,于是上MOS搜了搜文章果然搜到几篇文章,11.2.0.3.6以上比较好解决,但是小于这个版本的就不好弄了,自己总结的方法是重新跑root.sh脚本,而跑完后集群中注册的很多资源不存在了,于是这个又涉及到OCR的备份与恢复。另外执行root.sh若是顺序不对,或者其他的原因可能导致asm实例号和主机号不一致,就是rac1上的实例名是+ASM2,这个虽然没有啥影响,但是看着着实不爽,因此更改它们直接的对应关系也比较重要,所以总体而言就引出了文章开头提出的6个问题。

相关知识点扫盲

Clusterware 在运行期间需要两个文件: OCR 和 Voting Disk. 这 2 个文件必须存放在共享存储上。 OCR 用于解决健忘问题, Voting Disk 用于解决脑裂问题。

OCR Disk

Oracle Clusterware把整个集群的配置信息放在共享存储上,这个存储就是OCR Disk. 在整个集群中,只有一个节点能对OCR Disk 进行读写操作,这个节点叫作Master Node,所有节点都会在内存中保留一份OCR的拷贝,同时有一个OCR Process 从这个内存中读取内容。 OCR 内容发生改变时,由Master Node的OCR Process负责同步到其他节点的OCR Process。

健忘问题是由于每个节点都有配置信息的拷贝,修改节点的配置信息不同步引起的。Oracle 采用的解决方法就是把这个配置文件放在共享的存储上, 这个文件就是 OCR Disk。OCR 中保存整个集群的配置信息,配置信息以"Key-Value" 的形式保存其中。 在 Oracle10g 以前, 这个文件叫作 Server Manageability Repository(SRVM). 在 Oracle 10g, 这部分内容被重新设计,并重名为 OCR.。在 Oracle Clusterware 安装的过程中, 安装程序会提示用户指定 OCR 位置。并且用户指定的这个位置会被记录在/etc/oracle/ocr.loc(Linux System、AIX) 或者/var/opt/oracle/ocr.loc(Solaris System)文件中。 而在 Oracle 9i RAC 中,对等的是 srvConfig.Loc文件。 Oracle Clusterware在启动时会根据这里面的内容从指定位置读入 OCR 内容。

zfzhlhrdb3:root:/>cd /etc/oracle

zfzhlhrdb3:root:/etc/oracle>ls -l

total 3160

drwxrwx--- 2 root dba 256 Dec 29 14:16 lastgasp

-rw-r--r-- 1 root dba 37 Dec 29 14:10 ocr.loc

-rw-r--r-- 1 root system 0 Dec 29 14:10 ocr.loc.orig

-rw-r--r-- 1 root dba 92 Dec 29 14:10 olr.loc

-rw-r--r-- 1 root system 0 Dec 29 14:10 olr.loc.orig

drwxrwxr-x 5 root dba 256 Dec 29 14:09 oprocd

drwxr-xr-x 3 root dba 256 Dec 29 14:09 scls_scr

-rws--x--- 1 root dba 1606037 Dec 29 14:09 setasmgid

zfzhlhrdb3:root:/etc/oracle>more /etc/oracle/ocr.loc

ocrconfig_loc=+DATA

local_only=FALSE

OCR key

整个 OCR 的信息是树形结构,有 3 个大分支。分别是 SYSTEM,DATABASE 和 CRS。每个分支下面又有许多小分支。这些记录的信息只能由 root 用户修改。

OCR包含的内容

OCR中通常包含下列内容:

  • 节点成员信息
  • 数据库实例,节点,以及其他的映射关系
  • ASM
  • 资源配置信息(vip,services等等)
  • 服务特性(Service characteristics)
  • Oracle集群中相关进程的信息
  • CRS控制的第三方应用程序信息

zfzhlhrdb1:root:/>ocrdump -local -stdout -xml|more|grep -i \\<name\>|sed -e 's/\\<NAME\>//g' -e 's/\\<\/NAME\>//g'|awk -F . '{print $1,$2,$3}'|uniq

SYSTEM

SYSTEM crs

SYSTEM crs usersecurity

SYSTEM crs deny

SYSTEM crs user_default_dir

SYSTEM ORA_CRS_HOME

SYSTEM WALLET

SYSTEM GNS

SYSTEM version

SYSTEM version localhost

SYSTEM version activeversion

SYSTEM GPnP

SYSTEM GPnP profiles

SYSTEM css

SYSTEM css nodenum_hint

SYSTEM network

SYSTEM network haip

SYSTEM OHASD

SYSTEM OHASD DM

SYSTEM OHASD SERVERPOOLS

SYSTEM OHASD SERVERS

SYSTEM OHASD TYPES

SYSTEM OHASD RESOURCES

SYSTEM CRS

SYSTEM CRS JOIN_SIGNATURE

SYSTEM OLR

SYSTEM OLR MANUALBACKUP

SYSTEM OCR

SYSTEM OCR BACKUP

DATABASE

DATABASE NODEAPPS

DATABASE VIP_RANGE

DATABASE LOG

DATABASE ASM

DATABASE DATABASES

CRS

zfzhlhrdb1:root:/>ocrdump -stdout -xml|more|grep -i \\<name\>|sed -e 's/\\<NAME\>//g' -e 's/\\<\/NAME\>//g'|awk -F . '{print $1,$2,$3}'|uniq

SYSTEM

SYSTEM version

SYSTEM version activeversion

SYSTEM version hostnames

SYSTEM versionstring

SYSTEM WALLET

SYSTEM WALLET APPQOSADMIN

SYSTEM GNS

SYSTEM css

SYSTEM css interfaces

SYSTEM crs

SYSTEM crs versions

SYSTEM crs usersecurity

SYSTEM crs deny

SYSTEM crs user_default_dir

SYSTEM crs e2eport

SYSTEM crs uiport

SYSTEM crs 11

SYSTEM ACFS

SYSTEM ORA_CRS_HOME

SYSTEM evm

SYSTEM evm debug

SYSTEM evm cevmkey

SYSTEM evm rmport

SYSTEM evm cevmport

SYSTEM DIAG

SYSTEM DIAG status

SYSTEM local_only

SYSTEM WLM

SYSTEM GPnP

SYSTEM GPnP profiles

SYSTEM JAZNFILE

\jazn com\

\qosadmin\

\oc4jadmin\

\JtaAdmin\

\ascontrol_appadmin\

\oc4j-administrators\

\qosadmin\

\oc4jadmin\

\JtaAdmin

\qos_admin\

\qosadmin\

\oc4j-app-administrators\

\users\

\ascontrol_monitor\

\

\qosadmin\

\oc4jadmin\

\qos_admin\

\jazn com/oc4j-administrators\

\login\

\subject propagation\

\oracle security jazn

\jazn com/*\

\administration\

\jazn com\

\jazn com/ascontrol_admin\

\login\

\subject propagation\

\oracle security jazn

\oracl

\oracle security jazn

\jazn com/*\

\administration\

\jazn com\

\jazn com/oc4j-app-administrators\

\login\

\jazn com/users\

\login\

\oracle security jazn

\coreid password header\

\coreid resource operation\

\addAllRoles\

\coreid password attribute\

\coreid resource type\

\coreid name attribute\

\coreid resource name\

\core

\oracle security jazn

\addAllRoles\

\oracle security wss

\addAllRoles\

\oracle security jazn

\addAllRoles\

\oracle security jazn

\addAllRoles\

\oracle security jazn

\addAllRoles\

\oracle security wss

\addAllRoles\

\issuer name 1\

SYSTEM JAZNFILE STATE

SYSTEM CRSADMIN

SYSTEM CRSUSER

SYSTEM CRSD

SYSTEM CRSD DM

SYSTEM CRSD SERVERPOOLS

SYSTEM CRSD SERVERS

SYSTEM CRSD TYPES

SYSTEM CRSD RESOURCES

SYSTEM OCR

SYSTEM OCR BACKUP

DATABASE

DATABASE NODEAPPS

DATABASE NODEAPPS zfzhlhrdb1

DATABASE NODEAPPS zfzhlhrdb2

DATABASE VIP_RANGE

DATABASE LOG

DATABASE ASM

DATABASE ASM zfzhlhrdb1

DATABASE ASM zfzhlhrdb2

DATABASE DATABASES

CRS

CRS CUR

CRS HIS

CRS SEC

CRS STAGE

CRS STAGE node1

CRS STAGE node2

OCR存储内容的表现形式

  1. 同样地与Windows注册表来类比,OCR其存储内容的表现形式与其相同,是采用键值对的方式来展现。
  2. 整个OCR 的信息是树形结构,有3个大分支。分别是SYSTEM,DATABASE 和CRS。
  3. 每个分支下面又有许多小分支。这些记录的信息只能由root用户修改。
  4. 可以使用ocrdump命令将其内容全部导出或者按分支进行导出。

Voting Disk

Voting Disk 这个文件主要用于记录节点成员状态,在出现脑裂时,决定那个 Partion 获得控制权,其他的 Partion 必须从集群中剔除。在安装 Clusterware 时也会提示指定这个位置。安装完成后可以通过如下命令来查看 Voting Disk 位置。

健忘症(Amnesia)

集群环境配置文件不是集中存放的,而是每个节点都有一个本地副本,在集群正常运行时,用户可以在任何节点更改集群的配置,并且这种更改会自动同步到其他节点。有一种特殊情况: 节点 A 正常关闭, 在节点 B 上修改配置, 关闭结点 A,启动结点B。 这种情况下,修改的配置文件是丢失的, 就是所谓的健忘症。OCR 用于解决健忘问题。

健忘是由于某个节点更新了OCR中的内容,而集群中的另外一些节点此时处于关闭,维护或重启阶段,OCR Master进程来不及将其信息更新到这些异常节点缓存而导致的不一致。譬如,在A节点发出了添加ocr镜像的命令,在这个时候B节点处于重启阶段。重启后A已经更新完毕,而此时B并不知道已经为ocr增加了一个新的镜像磁盘,健忘由此而生。

如下例,节点bo2dbp添加了新的ocr之后,配置文件发生了变化,此时节点bo2dbs的ocr.loc会被更新,如果bo2dbs处于关闭或重启阶段,则该文件得不到该更新,此即位健忘一例。

脑裂(Split Brain)

在集群中,节点间通过某种机制(心跳)了解彼此的健康状态,以确保各节点协调工作。假设只有"心跳"出现问题, 各个节点还在正常运行, 这时,每个节点都认为其他的节点宕机了, 自己是整个集群环境中的"唯一建在者",自己应该获得整个集群的"控制权"。 在集群环境中,存储设备都是共享的, 这就意味着数据灾难, 这种情况就是"脑裂"解决这个问题的通常办法是使用投票算法(Quorum Algorithm). 它的算法机理如下:集群中各个节点需要心跳机制来通报彼此的"健康状态",假设每收到一个节点的"通报"代表一票。对于三个节点的集群,正常运行时,每个节点都会有 3 票。 当结点 A 心跳出现故障但节点 A 还在运行,这时整个集群就会分裂成 2 个小的 partition。 节点 A 是一个,剩下的 2 个是一个。 这是必须剔除一个 partition 才能保障集群的健康运行。对于有 3 个节点的集群, A 心跳出现问题后, B 和 C 是一个 partion,有 2 票, A只有 1 票。 按照投票算法, B 和 C 组成的集群获得控制权, A 被剔除。如果只有 2 个节点,投票算法就失效了。 因为每个节点上都只有 1 票。 这时就需要引入第三个设备: Quorum Device. Quorum Device 通常采用饿是共享磁盘,这个磁盘也叫作Quorum disk。 这个 Quorum Disk 也代表一票。 当 2 个结点的心跳出现问题时, 2 个节点同时去争取 Quorum Disk 这一票, 最早到达的请求被最先满足。 故最先获得 Quorum Disk的节点就获得 2 票。另一个节点就会被剔除。

OCR命令系列

ocrdump

该命令能以ASCII的方式打印出OCR的内容,但是这个命令不能用作OCR的备份恢复,也就是说产生的文件只能用作阅读,而不能用于恢复。

命令格式: ocrdump [-stdout] [filename] [-keyname name] [-xml]

参数说明:

-stdout: 把内容打印输出到屏幕上

Filename:内容输出到文件中

-keyname:只打印某个键及其子健内容

-xml:以xml格式打印输出

示例:把system.css键的内容以.xml格式打印输出到屏幕

[root@raw1 bin]# ./ocrdump -stdout -keyname system.css -xml|more

\

\03/08/2010 04:28:41\

\/dev/raw/raw1\

\./ocrdump.bin -stdout -keyname system.css -xml \

......

这个命令在执行过程中,会在$CRS_HOME/log/\/client 目录下产生日志文件,文件名ocrdump_\.log,如果命令执行出现问题,可以从这个日志查看问题原因。

ocrcheck

Ocrcheck 命令用于检查OCR内容的一致性,命令执行过程会在$CRS_HOME/log/nodename/client 目录下产生ocrcheck_pid.log 日志文件。 这个命令不需要参数。

Status of Oracle Cluster Registry is as follows :

Version : 3

Total space (kbytes) : 262120

Used space (kbytes) : 3176

Available space (kbytes) : 258944

ID : 362503260

Device/File Name : +DATA

Device/File integrity check succeeded

Device/File not configured

Device/File not configured

Device/File not configured

Device/File not configured

Cluster registry integrity check succeeded

Logical corruption check succeeded

ocrconfig

该命令用于维护OCR 磁盘,安装clusterware过程中,如果选择External Redundancy冗余方式,则只能输入一个OCR磁盘位置。 但是Oracle允许配置两个OCR 磁盘互为镜像,以防止OCR 磁盘的单点故障。 OCR 磁盘和Votedisk磁盘不一样,OCR磁盘最多只能有两个,一个Primary OCR 和一个Mirror OCR。

[root@raw1 bin]# ./ocrconfig --help

Name:

ocrconfig - Configuration tool for Oracle Cluster Registry.

Synopsis:

ocrconfig [option]

option:

-export \ [-s online]

- Export cluster register contents to a file

-import \ - Import cluster registry contents from a file

-upgrade [\ [\]]

- Upgrade cluster registry from previous version

-downgrade [-version \]

- Downgrade cluster registry to the specified version

-backuploc \ - Configure periodic backup location

-showbackup - Show backup information

-restore \ - Restore from physical backup

-replace ocr|ocrmirror [\] - Add/replace/remove a OCR device/file

-overwrite - Overwrite OCR configuration on disk

-repair ocr|ocrmirror \ - Repair local OCR configuration

-help - Print out this help information

Note:

A log file will be created in

$ORACLEHOME/log/\/client/ocrconfig\.log. Please ensure

you have file creation privileges in the above directory before

running this tool.

Oracle RAC OCR 的备份与恢复

Oracle Clusterware把整个集群的配置信息放在共享存储上,这些信息包括了集群节点的列表、集群数据库实例到节点的映射以及CRS应用程序资源信息。也即是存放在ocr 磁盘(或者ocfs文件)上。因此对于这个配置文件的重要性是不言而喻的。任意使得ocr配置发生变化的操作在操作之间或之后都建议立即备份ocr。

因为OCR的内容如此重要,Oracle 每4个小时对其做一次备份,并且保留最后的3个备份,以及前一天,前一周的最后一个备份。 这个备份由Master Node CRSD进程完成,备份的默认位置是$CRS_HOME/crs/cdata/\目录下。 每次备份后,备份文件名自动更改,以反应备份时间顺序,最近一次的备份叫作backup00.ocr。这些备份文件除了保存在本地,DBA还应该在其他存储设备上保留一份,以防止意外的存储故障。

与Oracle数据库备份恢复相似,OCR的备份也有物理备份或逻辑备份的概念,因此有两种备份方式,两种恢复方式。

常用命令:

crsctl query css votedisk

lquerypv -h /dev/rhdisk2

crsctl stop has -f

crsctl start has

crsctl stat res -t

dd备份恢复

备份表决磁盘:

dd if=/dev/raw/raw3 of=/tmp/votedisk_lhr.bak bs=1024k count=4

恢复表决磁盘:

dd if=/tmp/votedisk_lhr.bak of=/dev/raw/raw3 bs=1024k count=4

注:11g不推荐使用dd来进行备份恢复,盘头一般是前4K

kfed恢复磁盘头

dd if=/dev/rhdisk2 of=/asm_rhdisk2_dd.bak bs=1024 count=4

dd if=/dev/zero of=/dev/rhdisk2 bs=1024 count=4

kfed repair /dev/rhdisk2

关于kfed、kfod、amdu的更多内容可以参考:http://blog.itpub.net/26736162/viewspace-1694198/

http://blog.itpub.net/26736162/viewspace-1694199/

md_backup和md_restore恢复磁盘头

asmcmd md_backup /oracle/app/11.2.0/grid/cdata/ZFTPCCDB-crs/asm_md_backup.bak

asmcmd md_restore /oracle/app/11.2.0/grid/cdata/ZFTPCCDB-crs/asm_md_backup.bak

dd if=/dev/rhdisk2 of=/asm_rhdisk2_dd.bak bs=1024k count=4

dd if=/dev/zero of=/dev/rhdisk2 bs=1024k count=4

crsctl stop has -f

crsctl start has

ASMCMD [+] > startup force nomount;

ASMCMD [+] > md_restore /asm_rhdisk2_dd.bak

ASMCMD [+] > md_backup /rman/asm_md.bak

dd if=/dev/zero of=/dev/rhdisk2 bs=1024 count=4

crsctl stop has -f

crsctl start has

ASMCMD [+] > startup force nomount;

ASMCMD [+] > md_restore /rman/asm_md.bak

关于md_backup和md_restore更多内容可以参考:http://blog.itpub.net/26736162/viewspace-2121309/

物理备份与恢复(自动备份)

缺省情况下,Oracle 每4个小时对其做一次备份,并且保留最后的3个副本,以及前一天,前一周的最后一个备份副本。用户不能自定义备份频率以及备份文件的副本数。

对于OCR的备份由是由Master Node CRSD进程完成,因此备份的默认位置是$CRS_HOME/crs/cdata/\目录下。

备份的文件会自动更名,以反应备份时间顺序,最近一次的备份叫作backup00.ocr。

由于是在Master Node的节点之上进行备份,因此备份文件仅存在于Master Node节点。

对于Master Node的节点crash之后则由剩余节点接管。

备份目录可以通过ocrconfig -backuploc \ 命令修改。

OCR磁盘最多只能有两个,一个Primary OCR 和一个Mirror OCR。两者互为镜像以避免单点故障。

对于物理备份恢复,不能简单的使用操作系统级别的复制命令(使用ocr文件时)来完成,该操作将导致ocr不可用。

对于物理备份,仅仅只能使用restore方式来进行恢复,而不支持import方式

1,查看备份磁盘

zfzhlhrdb2:grid:/home/grid>ocrconfig -showbackup

zfzhlhrdb1 2016/06/30 15:13:46 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup00.ocr

zfzhlhrdb1 2016/06/30 11:13:45 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup01.ocr

zfzhlhrdb1 2016/06/30 07:13:45 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup02.ocr

zfzhlhrdb1 2016/06/29 03:13:41 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/day.ocr

zfzhlhrdb1 2016/06/20 03:13:08 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/week.ocr

PROT-25: Manual backups for the Oracle Cluster Registry are not available

zfzhlhrdb2:grid:/home/grid>oerr prot 25

00025, 0, "Manual backups for the Oracle Cluster Registry are not available"

// *Cause: Manual backups for the Oracle Cluster Registry were not yet created.

// *Action: Manual backups can be created using 'ocrconfig -manualbackup'

// command.

zfzhlhrdb2:grid:/home/grid>ocrconfig -manualbackup

PROT-20: Insufficient permission to proceed. Require privileged user

zfzhlhrdb2:root:/>ocrconfig -manualbackup

zfzhlhrdb1 2016/06/30 16:21:34 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup_20160630_162134.ocr

zfzhlhrdb2:root:/>ocrconfig -showbackup

zfzhlhrdb1 2016/06/30 15:13:46 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup00.ocr

zfzhlhrdb1 2016/06/30 11:13:45 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup01.ocr

zfzhlhrdb1 2016/06/30 07:13:45 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup02.ocr

zfzhlhrdb1 2016/06/29 03:13:41 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/day.ocr

zfzhlhrdb1 2016/06/20 03:13:08 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/week.ocr

zfzhlhrdb1 2016/06/30 16:21:34 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup_20160630_162134.ocr

在节点一执行,可以看到2个节点得到的内容一致:

zfzhlhrdb1:root:/>ocrconfig -showbackup

zfzhlhrdb1 2016/06/30 15:13:46 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup00.ocr

zfzhlhrdb1 2016/06/30 11:13:45 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup01.ocr

zfzhlhrdb1 2016/06/30 07:13:45 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup02.ocr

zfzhlhrdb1 2016/06/29 03:13:41 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/day.ocr

zfzhlhrdb1 2016/06/20 03:13:08 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/week.ocr

zfzhlhrdb1 2016/06/30 16:21:34 /oracle/app/11.2.0/grid/cdata/zfzhlhrdb-crs/backup_20160630_162134.ocr

2,恢复

ocrconfig -restore /app/crs/product/11.0.6/crs/cdata/racluster/backup01.ocr

3,查看配置

[grid@rac1 ~]$ more /etc/oracle/ocr.loc

ocrconfig_loc=+DATA

local_only=FALSE

[grid@rac1 ~]$

4,查看进程

[grid@rac1 ~]$ ps -ef | grep d.bin

root 4694 1 0 10:00 ? 00:00:13 /u01/grid/bin/ohasd.bin reboot

grid 4821 1 0 10:00 ? 00:00:28 /u01/grid/bin/oraagent.bin

root 4823 1 0 10:00 ? 00:00:04 /u01/grid/bin/orarootagent.bin

grid 4846 1 0 10:00 ? 00:00:00 /u01/grid/bin/gipcd.bin

grid 4859 1 0 10:00 ? 00:00:00 /u01/grid/bin/mdnsd.bin

grid 4874 1 0 10:00 ? 00:00:01 /u01/grid/bin/gpnpd.bin

root 8645 1 0 10:47 ? 00:00:04 /u01/grid/bin/cssdmonitor

root 8662 1 0 10:48 ? 00:00:05 /u01/grid/bin/cssdagent

grid 8664 1 0 10:48 ? 00:00:01 /u01/grid/bin/diskmon.bin -d -f

grid 8688 1 0 10:48 ? 00:00:40 /u01/grid/bin/ocssd.bin

root 8754 1 0 10:50 ? 00:00:01 /u01/grid/bin/octssd.bin

grid 8770 1 0 10:50 ? 00:00:02 /u01/grid/bin/evmd.bin

grid 8888 1 0 10:51 ? 00:00:00 /u01/grid/bin/oclskd.bin

root 8920 1 0 10:51 ? 00:00:07 /u01/grid/bin/crsd.bin reboot

root 8966 1 0 10:51 ? 00:00:00 /u01/grid/bin/oclskd.bin

grid 9013 8770 0 10:51 ? 00:00:00 /u01/grid/bin/evmlogger.bin -o /u01/grid/evm/log/evmlogger.info -l /u01/grid/evm/log/evmlogger.log

grid 9055 1 0 10:51 ? 00:00:06 /u01/grid/bin/oraagent.bin

root 9059 1 0 10:51 ? 00:00:42 /u01/grid/bin/orarootagent.bin

grid 9283 1 0 10:52 ? 00:00:00 /u01/grid/bin/tnslsnr LISTENER -inherit

oracle 9549 1 0 10:58 ? 00:00:26 /u01/grid/bin/oraagent.bin

oracle 9773 1 0 11:00 ? 00:00:00 /u01/grid/bin/oclskd.bin

grid 18618 1 0 13:46 ? 00:00:00 /u01/grid/bin/tnslsnr LISTENER_SCAN1 -inherit

grid 22527 21370 0 14:58 pts/2 00:00:00 grep d.bin

[grid@rac1 ~]$

注:

ocssd:用于管理与协调集群中各个节点的关系,并用于节点通信。该进程非常的重要,如果这个进程异常中止,会导致系统自动重启。在某些极端的情况下,如果ocssd无法正常启动,就会导致操作系统循环重启。

crsd:监控节点各个资源,当某个资源发生异常是,自动重启或者切换该资源。

evmd:是一个基于后台的事件检测程序。

oclskd:该守护进程是Oracle 11g(11.10.6)新增的一个后台进程,主要是用于监控RAC数据库节点实例,当某个实例挂起时,就重启该节点。

逻辑备份与恢复(手动备份)

其实OCR也可以通过手动的方式导出、导入、方法如下:

ocrconfig -export /tmp/ocr_bak

ocrconfig -import /tmp/ocr_bak

使用ocrconfig -export 方式产生的备份,统称之为逻辑备份。

对于重大的ocr配置发生变化前后,如添加删除节点,修改集群资源,创建数据库等,都建议使用逻辑备份。

对于由于错误配置而导致的ocr被损坏的情形下,我们可以使用ocrconfig -import方式进行恢复。

对于这种逻辑方式也可以还原丢失或损坏的ocr磁盘(文件)。

如何修复11.2 Grid权限误操作

关于Oracle GRID HOME文件目录的权限问题

  1. chown -R 误操作了,将整个/u01/app的权限修过了如何恢复?
  2. 删除了$GRID_HOME/log文件夹下的所有内容,集群不能启动,如何恢复?

使用chown -R 误操作了,将整个/u01/app的权限修过了,导致grid无法启动。,搜了下mos发现了一篇文档:Tips for checking file permissions on GRID environment(ID 1931142.1)

该文档中描述到,$GRID_HOME/crs/utl下面的几个文件中记录了整个GRID_HOME下面的文件和目录的相关权限。

Check the permissions from the following 2 files which are created during Grid Infrastructure installation.

In $GRID_HOME/crs/utl (for 11.2 and 12.1.0.1) and \/crs/utl/\ (for 12.1.0.2) directory:

crsconfig_dirs :which has all directories listed in \ and their permissions

crsconfig_fileperms :which has list of files and their permissions and locations in \.

我们来看下是否是这样的,cd $ORACLE_HOME/crs/utl:

我们可以看到,确实是这样,crsconfig_dirs里面记录所有$GRID_HOME相关目录的权限。crsconfig_fileperms中记录了文件的权限.

校验权限

我们可以通过命令来校验:Validate the \ by using cluvfy tool.

$ cluvfy comp software -n all -verbose

[zfzhlhrdb1:grid]:/home/grid>cluvfy comp software -n all -verbose

Verifying software

Check: Software

Component: crs

Node Name: zfzhlhrdb2

/oracle/app/11.2.0/grid/bin/racgeut..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgeut" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/racgmain..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgmain" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/asmproxy..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/asmproxy" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/lib/oc4jctl_common.pm..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/lib/oc4jctl_common.pm" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/lib/oc4jctl_lib.pm..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/lib/oc4jctl_lib.pm" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/appagent.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/appagent.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/clssproxy.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/clssproxy.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_getperm.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_getperm.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_profile.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_profile.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_register.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_register.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_relocate.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_relocate.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_setperm.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_setperm.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_start.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_start.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_stat.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_stat.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_stop.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_stop.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_unregister.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_unregister.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gipcd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gipcd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/mdnsd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/mdnsd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gpnpd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gpnpd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gpnptool.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gpnptool.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oranetmonitor.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oranetmonitor.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evminfo.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evminfo.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmlogger.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmlogger.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmmkbin.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmmkbin.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmmklib.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmmklib.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmpost.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmpost.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmshow.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmshow.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmsort.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmsort.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmwatch.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmwatch.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oraagent.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oraagent.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/racgevtf..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgevtf" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/racgvip..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgvip" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/sclsspawn..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/sclsspawn" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/scriptagent.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/scriptagent.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oprocd..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oprocd" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/emcrsp.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/emcrsp.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/clsid.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/clsid.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/ocssd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/ocssd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crstmpl.scr..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crstmpl.scr" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evt.sh..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evt.sh" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/cemutls.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/cemutls.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/cemutlo.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/cemutlo.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/lsdb.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/lsdb.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oifcfg.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oifcfg.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/olsnodes.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/olsnodes.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gsd..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gsd" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oc4jctl.pl..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oc4jctl.pl" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/lib/s_oc4jctl_lib.pm..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/lib/s_oc4jctl_lib.pm" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/appvipcfg.pl..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/appvipcfg.pl" did not match the expected value. [Expected = "0750" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/lxinst..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/lxinst" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/clone/rootpre/ORCLcluster/lib/libskgxnr.a...No such file or directory

Node Name: zfzhlhrdb1

/oracle/app/11.2.0/grid/bin/racgeut..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgeut" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/racgmain..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgmain" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/asmproxy..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/asmproxy" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/lib/oc4jctl_common.pm..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/lib/oc4jctl_common.pm" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/lib/oc4jctl_lib.pm..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/lib/oc4jctl_lib.pm" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/appagent.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/appagent.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/clssproxy.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/clssproxy.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_getperm.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_getperm.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_profile.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_profile.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_register.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_register.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_relocate.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_relocate.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_setperm.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_setperm.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_start.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_start.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_stat.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_stat.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_stop.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_stop.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crs_unregister.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crs_unregister.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gipcd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gipcd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/mdnsd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/mdnsd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gpnpd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gpnpd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gpnptool.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gpnptool.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oranetmonitor.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oranetmonitor.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evminfo.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evminfo.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmlogger.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmlogger.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmmkbin.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmmkbin.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmmklib.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmmklib.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmpost.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmpost.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmshow.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmshow.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmsort.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmsort.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evmwatch.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evmwatch.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oraagent.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oraagent.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/racgevtf..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgevtf" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/racgvip..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/racgvip" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/sclsspawn..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/sclsspawn" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/scriptagent.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/scriptagent.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oprocd..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oprocd" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/emcrsp.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/emcrsp.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/clsid.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/clsid.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/ocssd.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/ocssd.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/crstmpl.scr..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/crstmpl.scr" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/evt.sh..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/evt.sh" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/cemutls.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/cemutls.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/cemutlo.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/cemutlo.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/lsdb.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/lsdb.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oifcfg.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oifcfg.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/olsnodes.bin..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/olsnodes.bin" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/gsd..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/gsd" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/oc4jctl.pl..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/oc4jctl.pl" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/lib/s_oc4jctl_lib.pm..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/lib/s_oc4jctl_lib.pm" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/appvipcfg.pl..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/appvipcfg.pl" did not match the expected value. [Expected = "0750" ; Found = "0775"]

/oracle/app/11.2.0/grid/bin/lxinst..."Permissions" did not match reference

Permissions of file "/oracle/app/11.2.0/grid/bin/lxinst" did not match the expected value. [Expected = "0755" ; Found = "0775"]

/oracle/app/11.2.0/grid/clone/rootpre/ORCLcluster/lib/libskgxnr.a...No such file or directory

1227 files verified

Software check failed

Verification of software was unsuccessful on all the specified nodes.

解决

所以要解决这个问题其实并不难,我们大致可以通过如下几种方法来解决:

1. 根据前面的几个权限配置脚本自己参考进行修改,实际上并不难,直接UE编辑就很快搞定.

2. 根据Mos文档提供的建议通过 $GRID_HOME/crs/install/rootcrs.pl -init 或 roothas.pl -init进行解决. rootcrs.pl –init是在PSU>11.2.0.3.6下执行的,如果PSU\<11.2.0.3.6可以执行如下两条命令来实现同样的效果

\/crs/install/rootcrs.pl -unlock

\/crs/install/rootcrs.pl -patch

3.采用MOS1515018.1文档提供的脚本在正常库上生成脚本,然后将生成的脚本在异常库上执行从而来修复权限问题(应该和方法2结合使用)。

4. 11gR2可以deconfig crs的配置,然后重新跑root.sh即可。重新跑root.sh脚本并不影响数据库,所以无需担心(个人推荐的一种方式).

$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose

$ORACLE_HOME/root.sh

5. 如果是rac的某个节点的误操作,那么还可以通过delete node然后add node来做,不过这个相对麻烦太多了,但是或许是最保险的一种方式。oracle也推荐这样,因为你如果人为修改文件权限,很难保证以后运行过程中不会出现什么问题。

补充:

Linux环境中还可以通过getfacl和setfacl来进行操作,如下是例子:

1) getfacl /home/grid/app/11.2/grid > dir_privs.txt

2) set –restore dir_privs.txt

总结:

在安装有GI的环境下,权限、属主是严格被设定的,任何对于它们的错误修改容易引发一系列的问题,而且这些问题往往都很诡异很难按照常规的思路去诊断。万一权限或属主被修改了可以通过rootcrs.pl -init及permission.pl进行修复,rootcrs.pl –init仅修复GI的核心目录,所以其修复速度较快,如果遇到GI无法启动的问题,建议首选这种方法以使GI能够快速启动,但其缺点在于无法全量的进行修复,GI虽然正常了,并不能保证之后的运行过程中不出现这样那样的问题,这时就需要permission.pl出场了,permission.pl的运行模式决定了源库(权限正确的库)与目标库(权限错误的库)间的软件版本尽可能的一致,所以源库一定要选好,否则问题会更糟,另外如果源、目标两个库的安装目录不一样还需要对permission*脚本作调整后再执行。

所以个人建议还是跑root.sh来的稳妥一点。

MOS 1515018.1 permission.pl脚本的使用

chmod 755 permission.pl

oracle用户获取ORACLE_HOME: ./permission.pl $ORACLE_HOME

root用户获取GRID_HOME: ./permission.pl $ORACLE_HOME

Script generates two files
a. permission-\ - This contains file permission in octal value, owner and group information of the files captured
b. restore-perm-\ - This contains command to change the permission, owner, and group of the captured files

拷贝到目标主机后分别执行:

chmod 755 restore-perm-\.cmd

./restore-perm-\.cmd

如何修复ASM实例名和节点名不一致的情况

对于10g的情况,我们可以参考Dave大神的blog:RAC修改ASM实例名的步骤:http://blog.csdn.net/tianlesoftware/article/details/6275827

对于11g的情况,我们只能重新执行root.sh脚本来修复这个问题。

如何彻底清除CRS信息

ZFTPCCDB1:root:/>$ORACLE_HOME/crs/install/rootcrs.pl -h

Unknown option: h

Usage:

rootcrs.pl [-verbose] [-upgrade [-force] | -patch]

[-paramfile \]

[-deconfig [-deinstall] [-keepdg] | -downgrade] [-force] [-lastnode]

[-downgrade] [-oldcrshome \] [-version \]

[-unlock [-crshome \] [-nocrsstop]]

Options:

-verbose Run this script in verbose mode

-upgrade Oracle HA is being upgraded from previous version

-patch Oracle HA is being upgraded to a patch version

-paramfile Complete path of file specifying HA parameter values

-lastnode Force the node this is executing on to be considered the

last node of the install and perform actions associated

with configuring the last node

-downgrade Downgrade the clusterware

-version For use with downgrade; special handling is required if

downgrading to 9i. This is the old crs version in the format

A.B.C.D.E (e.g 11.1.0.6.0).

-deconfig Remove Oracle Clusterware to allow it to be uninstalled or reinstalled.

-force Force the execution of steps in delete that cannot be verified

to be safe

-deinstall Reset the permissions on CRS home during de-configuration

-keepdg Keep existing diskgroups during de-configuration

-unlock Unlock CRS home

-crshome Complete path of crs home. Use with unlock option.

-oldcrshome For use with downgrade. Complete path of the old crs home.

-nocrsstop used with unlock option to reset permissions on an inactive grid home

If neither -upgrade nor -patch is supplied, a new install is performed

To see the full manpage for this program, execute:

perldoc rootcrs.pl

根据MOS How to Proceed from Failed 11gR2 Grid Infrastructure (CRS) Installation (文档 ID 942166.1) 文档,若要重新执行root.sh脚本,我们可以如下操作:

在除最后一个节点外的所有节点执行:$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose

在最后一个节点执行:$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose -lastnode

重启OS后再执行:$ORACLE_HOME/root.sh

需要注意的一点是,我们在执行完$ORACLE_HOME/crs/install/rootcrs.pl -deconfig -force -verbose执成之后需要删除如下的文件:

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!
AiDBA后续精彩内容已被站长无情隐藏,请输入验证码解锁本文!
验证码:
获取验证码: 请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“AiDBA”或者“dbaup6”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复