Wednesday, December 16, 2015

RAC - Importance of file permissions in RAC environment (Grid filesystem), CRS-5802, a use of awk command in Dba Life.

Recently got solved a permission problem in a RAC environment.
The issue have started after some junior dba changed the ownership of the root file system .
The impact of this operation was in srvctl.
As, from the node where the ownership of files was changed, the database could not be started using srvctl.
Also the other node, which did not have any problems  can only start its own instance .
In other words; "srvctl start database -d PROD" command could not start the instance in node1 where the permission of files were changed.

srvctl start database -d PROD command was failing with the following:

PRCR-1013 : Failed to start resource ora.PROD1.db
PRCR-1064 : Failed to start resource ora.PROD1.db on node1
CRS-2680: Clean of 'ora.PROD1.db' on 'node1' failed
CRS-5802: Unable to start the agent process
I have analyzed the crsd log file and found that it was the oraagent process that was failed to be started.

The reason behind this was -> the permission of the files in the directory $ORACLE_BASE/crsdata/output/ crsd_oraagent were not proper.

Then I logged in to the node2 which didnt not have this problem.
Changed my directory to $ORACLE_BASE/crsdata/output/ crsd_oraagent and run the following awk command to generate the chown commands which need to be executed in node1 to correct permissions for me. There were several files and I thought that using a dynamic method for generating the chown command might ease my job, and actually it did.

I used the following command in node2 and executed the output of this command in node1 to correct the file permissions in node1.

cd $ORACLE_BASE/crsdata/output/ crsd_oraagent
ls -l | awk '{print "chown " $3 ":" $4 " " $9}'

No comments :

Post a Comment