Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

But you can tweak the whole think thing under the hood:

...

Panel
select distinct owner from DBA_OBJECTS where object_type ='DIRECTORY';
OWNER
------------------------------
SYS
Panel
CREATE OR replace FORCE VIEW "SYS"."DBA_DIRECTORIES"

...

Panel
 ("OWNER", "DIRECTORY_NAME", "DIRECTORY_PATH")
AS
SELECT u.NAME,
o.NAME,
d.os_path
FROM sys.user$ u,
sys.obj$ o,
sys.dir$ d
WHERE u.user# = o.owner#
AND o.obj# = d.obj#
Panel
select owner# from sys.obj$ where obj#=XXX;
Panel
OWNER#
----------
0
Panel
declare
Panel
f utl_file.file_type;
begin
f := utl_file.fopen('D1', 'something.txt', 'w');
utl_file.put_line(f, 'line one: some text');
utl_file.fclose(f);
end;
/

You will expect something like

Panel
ERROR at line 1:
ORA-29289: directory access denied
ORA-06512: at "SYS.UTL_FILE", line 41
ORA-06512: at "SYS.UTL_FILE", line 478
ORA-06512: at line 5

Now let's give user XX the ownership of that directory.

Panel
update sys.obj$ set owner#=XX where obj#=XXX;
Panel
SQL> grant read, write on directory D1 to

...

 XX;
Panel
grant read, write on directory D1 to berx
*
ERROR at line 1:
ORA-00603: ORACLE server session terminated by fatal error
Panel
SQL> update sys.obj$ set owner#=0 where obj#=XXX;
Panel
1 row updated.
SQL> commit;
Commit complete.
Panel

SQL> grant read, write on directory D1 to XX;

Panel

Grant succeeded.

 

PL/SQL procedure successfully completed.

...