We recently made some database security changes. After that, when user presses F4 key on the package name after connecting to the database, it takes 30 minutes before the package spec/body is displayed. Note that this package is in a different schema. Same thing happens if they try to pull database package via Schema browser. This used to work before. I captured the SQL that it runs on the back end which is below. I ran this SQL from toad and it ran for 30 min. It works fine if I connect as my id which has more privileges. I want to figure out which particular privilege they are missing. TOAD version is 12.1.0.22
select o.*, NVL(d.debuginfo, 'F') DEBUGINFO, nvl(p.AUTHID, 'DEFINER') authid
from (
Select owner, object_name, object_type, decode(status, 'VALID', 'V', 'I') status, last_ddl_time, object_id, created
from sys.ALL_OBJECTS
where owner = :own
and object_type in ('PACKAGE', 'PACKAGE BODY')
and object_name = :obj
) o, sys.all_probe_objects d
,(SELECT object_id, AUTHID
FROM sys.ALL_PROCEDURES
where 1=1
AND subprogram_id = 0
AND object_type = 'PACKAGE'
AND object_name = :obj
and owner = :own
GROUP BY object_id, AUTHID) p
where p.object_id (+) = o.object_id
and o.OBJECT_ID = d.object_id (+)
and d.owner (+) = :own
And O.Object_Name = D.Object_Name (+)
And ((d.object_type is null) or (d.object_type in ('PACKAGE', 'PACKAGE BODY')))
union all
Select distinct o.owner, s.name, 'PACKAGE BODY', 'V', null, null, null, null, null
from sys.ALL_SOURCE s, sys.all_objects o
where s.type = 'PACKAGE BODY'
and s.owner = :own
and o.owner = s.owner
and o.object_name = s.name
and o.object_type = 'PACKAGE'
and not exists (select 'x'
from sys.all_objects o_sub
where o_sub.owner = s.owner
and o_sub.object_name = s.name
and o_sub.object_type = 'PACKAGE BODY')
order by 3
Thanks for any help!
Sam