ITPub博客

首页 > 数据库 > Oracle > RAC安装目录权限快速恢复

RAC安装目录权限快速恢复

原创 Oracle 作者:yingyifeng306 时间:2022-04-15 08:15:38 0 删除 编辑

 

安装目录权限快速恢复

1  Validate the <GRID_HOME> by using cluvfy tool.

$ cluvfy comp software -n all -verbose

This though only validates the binary files and theirs permissions. This is mentioned in unpublished bug 18407533 (closed as not a bug).

 

2  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 <GRID_HOME>/crs/utl/<hostname> (for 12.1.0.2) directory:

 

- crsconfig_dirs which has all directories listed in <GRID_HOME> and their permissions

 

- crsconfig_fileperms which has list of files and their permissions and locations in <GRID_HOME>.

 

3  The permissions can be reverted back to original values with rootcrs.pl or roothas.pl.  For versions 11.2.0.3.6 and higher, there is an option -init:    

Reset the permissions of all files and directories under Oracle <GRID_HOME>. Please ensure CRS is not running while performing the followings:

 

For 11.2:

For clustered Grid Infrastructure, as root user

 

# cd <GRID_HOME>/crs/install/

# ./rootcrs.pl -init

For Standalone Grid Infrastructure, as root user

 

# cd <GRID_HOME>/crs/install/

# ./roothas.pl  -init

 

For 12c:

For clustered Grid Infrastructure, as root user

 

# cd <GRID_HOME>/crs/install/

# ./rootcrs.sh -init

 

 

Need to add or modify executable permissions of crsctl binary , if modified after execucting rootcrs.sh -init as per the BUG 21032304 - LNX64-12C-UD: SOME FILES NOT EXECUTABLE AFTER EXECUTING "ROOTCRS.SH -INIT"

 

For Standalone Grid Infrastructure, as root user

 

 

# cd <GRID_HOME>/crs/install/

# ./roothas.sh -init

 

简便方法:

getfacl、 setfacl命令

 

a.在节点 2上获取文件及目录的权限 :

     # getfacl -pR /oracle > backup.txt

b.拷贝 backup.txt 至节点 1

c.替换 backup.txt中的 rac2为 rac1、 ASM2为 ASM1、 orcl2为 orcl1

     vi bakcup.txt

     :1,$s/rac2/rac1/g  回车 (:n,$s/ rac2/ rac1/g 替换第 n 行开始到最后一行中每一行所有 rac2为 rac1)

d.在节点 1上恢复权限(切到 backup.txt目录下)

     # setfacl --restore=backup.txt

e. crsctl start crs

f.srvctl start instance -d orcl -i orcl1

g.检查验证。

 

然后去检查节点 1上的权限是否已经恢复 ,包含用户 ,group,acl,suid,sgid等 .

 

重启!

总结: /oracle 目录被修改之后

1、 srvctl stop instance -d orcl -i orcl1

2、停止 asm实例   停不下来   kill -9 pid of asm_smon_+ASM1

3、停止 crs  停不下来   kill -9 pid of /oracle/grid/crs_1/bin/crsd.bin reboot

4、 crsctl stop crs -f

5、恢复目录权限:

         a.在节点 2上获取文件及目录的权限 :

           # getfacl -pR /oracle > backup.txt

         b.拷贝 backup.txt 至节点 1

         c.替换 backup.txt中的 rac2为 rac1、 ASM2为 ASM1、 orcl2为 orcl1

           vi bakcup.txt

              :1,$s/rac2/rac1/g  回车 (:n,$s/ rac2/ rac1/g 替换第 n 行开始到最后一行中每一行所有 rac2为 rac1)

          d.在节点 1上恢复权限(切到 backup.txt目录下)

             # setfacl --restore=backup.txt

6、 crsctl start crs

7、 srvctl start instance -d orcl -i orcl1

8、检查验证。

 

 

 

 

 


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23732248/viewspace-2887194/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
ITpub论坛高可用版主,擅长研究Oracle 内部原理、新特性、高可用和性能调优等,多年来一直保持着对新事务旺盛的求知欲。热切关注 Oracle 和其它相关技术

注册时间:2011-10-12

  • 博文量
    291
  • 访问量
    1593078