私も同じような状況で、特定のパッケージを使用するパッケージのリストを取得する必要があるだけでした。だから私はこのクエリを作成しました、おそらくそれは役に立ちます:
with dep2 as (
select dep.*
from all_dependencies dep
where dep.owner not in ('SYS', 'SYSTEM', 'PUBLIC', 'XDB')
and dep.referenced_owner not in ('SYS', 'SYSTEM', 'PUBLIC', 'XDB')
and dep.referenced_type = 'PACKAGE'
and dep.dependency_type != 'NON-EXISTENT'
and (dep.referenced_owner || '.' || dep.referenced_name) != (dep.owner || '.' || dep.name)
),
dep3 as (
select owner || '.' || name as child,
referenced_owner || '.' || referenced_name as parent
from dep2
)
select connect_by_root parent, lpad(' ',2*(level-1)) || to_char(child)
from dep3
start with parent = 'SCHEMA.PACKAGE_NAME'
connect by nocycle prior child = parent
and exists (select 1 from all_source where (owner || '.' || name) = dep3.child and upper(text) like upper('%optional, some string you may want to search%'))
;