Saturday, September 8, 2018

Fix Oracle Binary permission -- Copy using unix stat command



Fix Oracle Binary permission -- Copy using unix stat command



One of biggest challenge we have  when your oracle binary  permission is messed up either for patching  or for any other reason .

There are multiple  ways people choose like applying  sticky  bit ,  ACL  etc   which  depends from environment to environment .

However when nothing is   working  best work around is   to  copy   binary permission from Good oracle home and  apply same to  home where  issue persist

Please note this is just work around  undocumented method  need to be used at you own risk

In below  case source  server is from where you want to copy binary permission from  and target server is where binary permission are messed up and  you need to apply  binary permission to




######  on source  server ##### 

Use below  to copy   good binary  permission   to be applied to target  .


cd $ORACLE_HOME
cd ..

stat -c "%a %n" `find db_1` > /optware/oracle/tmp/a.txt
or
find db_1 -exec stat -c "%a %n" {} \; >> /optware/oracle/tmp/a.txt





######   on target ###########

Copy   a.txt    from   source  server and follow  below to apply  permission to  target binary server


cd $ORACLE_HOME
cd ..
sh /optware/oracle/tmp/perm.ksh      (  below is  content of  file )



cat  /optware/oracle/tmp/perm.ksh
#!/usr/bin/ksh
cat  /tmp/b.txt|while read ln
do
chmod $ln |tee -a /optware/oracle/tmp/permchange.log
done




No comments:

Post a Comment