Home » RDBMS Server » Server Administration » Directory issue in 11g (RDBMS 11.2.0.1, Oracle Linux 5)
Directory issue in 11g [message #645662] Thu, 10 December 2015 11:08 Go to next message
hboswell
Messages: 5
Registered: December 2015
Junior Member
I'm having a problem getting a directory to work in 11gr2 (11.2.0.1). I've set the Linux permissions - the oracle Linux user can create a file in that directory. I've created the directory as SYS and granted read,write to the Oracle user. But when I test against the directory, with either SYS or the granted user, it doesn't see the file that Oracle created:


DECLARE

l_exists boolean;
l_size integer;
l_block_size integer;

BEGIN

utl_file.fgetattr( 'HB_ORA_DIR',
'test.fil',
l_exists,
l_size,
l_block_size );

if( l_exists )
then
dbms_output.put_line( 'The file exists and has a size of ' || l_size );
else
dbms_output.put_line( 'The file does not exist or is not visible to Oracle - l_exists = ' ||case l_exists when true then 'True' else 'False' end );
end if;

END;

/

DBMS_OUTPUT --> The file does not exist or is not visible to Oracle - l_exists = False

Linux directory permissions: drwxrwxr-x 2 hboswell users 4096 Dec 10 11:23 oradir

Directory:
CREATE OR REPLACE DIRECTORY
HB_ORA_DIR AS
'/home/hboswell/oradir';

GRANT READ, WRITE ON DIRECTORY HB_ORA_DIR TO OPC_WRIMS;

It appears to be set up the same way it was on 10g (different server), but the database just doesn't seem to have visibility into that directory. What am I forgetting?

Thanks,

Harry
Re: Directory issue in 11g [message #645663 is a reply to message #645662] Thu, 10 December 2015 11:13 Go to previous messageGo to next message
BlackSwan
Messages: 25856
Registered: January 2009
Location: SoCal
Senior Member
Welcome to this forum

ls -ld /home/hboswell/
ls -ld /home/

post results from OS commands above

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read

Re: Directory issue in 11g [message #645664 is a reply to message #645663] Thu, 10 December 2015 11:21 Go to previous messageGo to next message
hboswell
Messages: 5
Registered: December 2015
Junior Member
ls -ld /home/hboswell ==> drwxrwx--- 4 hboswell users 4096 Dec 10 11:22 /home/hboswell

ls -ld /home ==> drwxr-xr-x 7 root root 4096 Jul 18 2012 /home
Re: Directory issue in 11g [message #645665 is a reply to message #645664] Thu, 10 December 2015 11:24 Go to previous messageGo to next message
BlackSwan
Messages: 25856
Registered: January 2009
Location: SoCal
Senior Member
hboswell wrote on Thu, 10 December 2015 09:21
ls -ld /home/hboswell ==> drwxrwx--- 4 hboswell users 4096 Dec 10 11:22 /home/hboswell


I suspect that Oracle OS user can not access directory above
Re: Directory issue in 11g [message #645666 is a reply to message #645665] Thu, 10 December 2015 11:39 Go to previous messageGo to next message
hboswell
Messages: 5
Registered: December 2015
Junior Member
BlackSwan wrote on Thu, 10 December 2015 11:24
hboswell wrote on Thu, 10 December 2015 09:21
ls -ld /home/hboswell ==> drwxrwx--- 4 hboswell users 4096 Dec 10 11:22 /home/hboswell


I suspect that Oracle OS user can not access directory above


Just tried that, and it could create a file:

[oracle@opcdb-dev hboswell]$ > test.fil
[oracle@opcdb-dev hboswell]$ ls -ltr
total 4
drwxrwxr-x 2 hboswell users 4096 Dec 10 11:23 oradir
-rw-r--r-- 1 oracle   dba      0 Dec 10 12:35 test.fil
Re: Directory issue in 11g [message #645667 is a reply to message #645666] Thu, 10 December 2015 11:56 Go to previous messageGo to next message
John Watson
Messages: 7262
Registered: January 2010
Location: Global Village
Senior Member
Harry, I can't work out what is going on with your file permissions, can you just run these commands again, and use copy/paste?

ls -la /home/hboswell
ls -la /home/hboswell/oradir
id oracle

[Updated on: Thu, 10 December 2015 11:57]

Report message to a moderator

Re: Directory issue in 11g [message #645677 is a reply to message #645667] Thu, 10 December 2015 13:14 Go to previous messageGo to next message
hboswell
Messages: 5
Registered: December 2015
Junior Member
[root@opcdb-dev hboswell]# ls -la /home/hboswell
total 40
drwxrwx--- 4 hboswell users 4096 Dec 10 12:35 .
drwxrwxr-x 7 root     root  4096 Jul 18  2012 ..
-rw------- 1 hboswell users   46 Dec 10 11:22 .bash_history
-rw-r--r-- 1 hboswell users   33 Jan 21  2009 .bash_logout
-rw-r--r-- 1 hboswell users  176 Jan 21  2009 .bash_profile
-rw-r--r-- 1 hboswell users  124 Jan 21  2009 .bashrc
-rw-r--r-- 1 hboswell users  515 Mar 13  2008 .emacs
drwxr-xr-x 4 hboswell users 4096 Dec  9  2010 .mozilla
drwxrwxr-x 2 hboswell users 4096 Dec 10 11:23 oradir
-rw-r--r-- 1 oracle   dba      0 Dec 10 14:09 test.fil

[root@opcdb-dev hboswell]# ls -la /home/hboswell/oradir
total 8
drwxrwxr-x 2 hboswell users 4096 Dec 10 11:23 .
drwxrwx--- 4 hboswell users 4096 Dec 10 12:35 ..
-rw-rw-rw- 1 oracle   dba      0 Dec 10 11:23 test.fil

[root@opcdb-dev hboswell]# id oracle
uid=500(oracle) gid=501(dba) groups=501(dba),100(users)

Re: Directory issue in 11g [message #645679 is a reply to message #645677] Thu, 10 December 2015 13:41 Go to previous message
hboswell
Messages: 5
Registered: December 2015
Junior Member
Well, I think I solved it, but I'm not sure why. I had to grant 'o+x' to the /home/kosal' directory; when I did that and ran the test, it succeeded:

The file exists and has a size of 0

[Updated on: Thu, 10 December 2015 14:47]

Report message to a moderator

Previous Topic: Unable to connect via wallet credentials - ORA-12534: TNS:operation not supported
Next Topic: UTF8 or conversion to Best Practice?
Goto Forum:
  


Current Time: Wed Feb 21 17:54:45 CST 2018

Total time taken to generate the page: 0.02349 seconds