selecting multiple grants on same object
Hi,
(The following SQl will be ran on 9i, 10g and 11g database versions)
Im trying produce a list of directory grants that are the same from 2 different users (but only display the details of grants from one user)
to clarify....
lets say we have 100 directories, and 2 users that have granted permissions on them, User A and User B.
Permissions can be granted on a directory by just user A, just user B or the same permission granted on the same directory by users A and B.
I want to produce a list that shows details of directories where user A and user B have granted the same permission (but in the list only display details of user A's grants)
so the following SQL will give me all directory permissions granted by user A
select p.table_name,p.grantee,p.owner,p.grantor,p.privilege, o.object_type
from dba_tab_privs p
inner join dba_objects o
on o.object_name = p.table_name
where o.object_type = 'DIRECTORY'
and p.grantor = 'USERA';
so i want to produce the same list of grants by just USERA but only if those directories have also been granted the same permission by USERB
any ideas of the easiest way to do this?
Thanks