Tables used by materialized views in a schema

Query to show all tables used (and how many times) by your materialized views in a schema

SELECT ad.detailobj_owner
, ad.detailobj_name
, count(1) as occurrence
FROM all_mview_detail_relations ad
WHERE ad.owner = 'YOURSCHEMA'
GROUP BY ad.detailobj_owner, ad.detailobj_name
ORDER BY ad.detailobj_owner, ad.detailobj_name

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.