Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

oracle query to find priveleges on a stored procedure

What query can I run to simply see whether a user has privelege to execute a stored procedure.

lets say user is UserA and stored procedure name is my_stored_proc

I want to know whether UserA has execute permission on my_stored_proc

UserA is not the owner of the storedproc. Some other owner grants him the permission.

like image 426
Omnipresent Avatar asked Jan 28 '10 18:01

Omnipresent


1 Answers

To account for grants through a role:

  select grantee, table_name, privilege
     from dba_tab_privs
     where
       table_name = 'my_stored_proc'
        and 
       owner = 'ownerOfObject'
       and
       (grantee = 'userA'
         or
         grantee in
          (select granted_role
        from dba_role_privs
        where grantee = 'userA'
           )
        )
like image 104
dpbradley Avatar answered Nov 09 '22 03:11

dpbradley