Came across an interesting scenario in UTL_FILE operation, here it goes
Following error happens
- You have created a directory to which the file operation should happen, under a different user,
- Permission is granted to oracle aka rdbms owner, via addition of group, which has write permission to the above directory
- DB is on Grid Infrastructure
- Database instance and listener is managed via srvctl/ and started via srvctl.
- Cluster has not been bounced since #2
- Connection is made from a remote client.
[root@myexaadm011 ~]# dcli -g dbs_group -l root id orpncsni
myexaadm011: uid=3982(orpncsni) gid=11001(dborgrid) groups=11001(dborgrid),10005(oinstall),8500(dba)
myexaadm012: uid=3982(orpncsni) gid=11001(dborgrid) groups=11001(dborgrid),10005(oinstall),8500(dba)
- Physical path / directory exists on all DB nodes ,
- oracle aka rdbms owner can write to it on all nodes in RAC
- Database and Listeners are bounced many a times
- Do the same execution from different DB Tier nodes multiple times - All Success !! but still clients cannot use the code
Lets look the listener process
-- > When started via srvctl
[orpncsni@myexaadm011 ]$ ps -ef |grep tns|grep PNCSNI
orpncsni 43740 1 0 18:32 ? 00:00:00 /pncsni/oracle/product/12102/bin/tnslsnr PNCSNI -no_crs_notify -inherit
orpncsni 111991 1 0 19:18 ? 00:00:00 /pncsni/oracle/product/12102/bin/tnslsnr PNCSNI -inherit
Here you can see that when listener is started via srvctl, the process does not have the group attributes which was recently added. Hence the server processes it spawns also wont have the same and it cannot write to the directory
If the listener is started using SRVCTL then it does not inherit groupid 10005 (oinstall) which has the write permission to the directory . If the listener is started using LSNRCTL then it does , and everything works.
This issue can be fixed via a quick CRSD bounce
[orgrid@myexaadm011 ~]$ crsctl stop resource ora.crsd -init
[orgrid@myexaadm011 ~]$ crsctl start resource ora.crsd -init
This can be done rolling and very quickly , does not affect other resources running on the server. This bounce repopulates the user information about all its resource owners.