Check rights on directory in Oracle

13,838

Solution 1

If you are talking about an Oracle directory object (CREATE DIRECTORY ...),

SELECT grantee, table_name directory_name, privilege
  FROM dba_tab_privs
 WHERE table_name = <<directory name>>

Note that if you don't have access to the DBA_* tables, you can use ALL_TAB_PRIVS or USER_TAB_PRIVS instead.

If you are talking about an operating system directory, you'd need to create an Oracle directory object that corresponds to the operating system directory. You could then use the UTL_FILE package's FOPEN method to try to open a file in the directory. If it succeeds, you have permission to the directory. Otherwise, you'll catch an exception.

Solution 2

select * from dba_tab_privs where table_name = 'your_directory'

Share:
13,838
SouravM
Author by

SouravM

Updated on June 14, 2022

Comments

  • SouravM
    SouravM almost 2 years

    How can I know if I have rights on directory using query in Oracle??