I have a directory in all_directories, but I need to find out what permissions are associated with it, i.e. what has been granted on it?
Querying DBA/USER Privilege Views A database administrator (DBA) for Oracle can simply execute a query to view the rows in DBA_SYS_PRIVS , DBA_TAB_PRIVS , and DBA_ROLE_PRIVS to retrieve information about user privileges related to the system , tables , and roles , respectively.
After you create a directory alias, grant users and groups access rights to the files contained in that directory, using the following PL/SQL syntax: GRANT permission ON DIRECTORY alias TO {user | role | PUBLIC};
How do I view privileges in Oracle SQL Developer? To check the roles granted to a user: SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTEE = 'USERNAME'; Permissions already have: SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = 'USERNAME'; System privileges granted: SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE = 'USERNAME';
This should give you the roles, users and permissions granted on a directory:
SELECT *
FROM all_tab_privs
WHERE table_name = 'your_directory'; --> needs to be upper case
And yes, it IS in the all_TAB_privs view ;-) A better name for that view would be something like "ALL_OBJECT_PRIVS", since it also includes PL/SQL objects and their execute permissions as well.
You can see all the privileges for all directories wit the following
SELECT *
from all_tab_privs
where table_name in
(select directory_name
from dba_directories);
The following gives you the sql statements to grant the privileges should you need to backup what you've done or something
select 'Grant '||privilege||' on directory '||table_schema||'.'||table_name||' to '||grantee
from all_tab_privs
where table_name in (select directory_name from dba_directories);
Wasn't sure if you meant which Oracle users can read\write with the directory or the correlation of the permissions between Oracle Directory Object and the underlying Operating System Directory.
As DCookie has covered the Oracle side of the fence, the following is taken from the Oracle documentation found here.
Privileges granted for the directory are created independently of the permissions defined for the operating system directory, and the two may or may not correspond exactly. For example, an error occurs if sample user hr is granted READ privilege on the directory object but the corresponding operating system directory does not have READ permission defined for Oracle Database processes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With