Answer the question
In order to leave comments, you need to log in
Where to sell the project of this subject?
Tell me the resources where you can put up for sale the project _vezunchik.us
The largest exchange Telderi - does not allow referring to the rules ...
Thanks for any advice
Answer the question
In order to leave comments, you need to log in
select * from dba_role_privs where (GRANTED_ROLE='CONNECT' OR GRANTED_ROLE='PRESS')
try again
select * from dba_role_privs t1 join dba_role_privs t2 on t1.GRANTED_ROLE='CONNECT' and t2.GRANTED_ROLE='PRESS'
Dirty, can be optimized:
select t.grantee
from (select grantee, count(grantee) as counts
from dba_role_privs
where grantee in
(select grantee
from dba_role_privs
where granted_role = 'PRESS'
and grantee in
(select grantee
from dba_role_privs
where granted_role = 'CONNECT'))
group by grantee) t
where t.counts = 2
select distinct grantee
from (select p.grantee,
sum(decode(p.granted_role, 'PRESS', 1, 'CONNECT', 1, 0)) over (partition by p.grantee) cnt,
count(*) over (partition by p.grantee) cnt_all
from dba_role_privs p)
where cnt = 2
and cnt_all = 2
just for lulz:
select grantee
from dba_role_privs
group by grantee
having count(*)=2
and cast(collect(GRANTED_ROLE) as sys.ku$_vcnt) = sys.ku$_vcnt('CONNECT','RESOURCE')
select grantee
from dba_role_privs
group by grantee
having count(*)=2
and min(GRANTED_ROLE) ='CONNECT'
and max(GRANTED_ROLE) ='RESOURCE'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question