SELECT *
FROM ( SELECT owner,
table_name,
'TABLE' as TYPE,
TO_NUMBER (
EXTRACTVALUE (
xmltype (
DBMS_XMLGEN.getxml (
'select count(*) c from '
|| owner
|| '.'
|| table_name)),
'/ROWSET/ROW/C'))
COUNT
FROM all_tables
WHERE table_name IN
('<list Tables here or provide SELECT>')
UNION ALL
SELECT owner,
view_name,
'VIEW' as TYPE,
TO_NUMBER (
EXTRACTVALUE (
xmltype (
DBMS_XMLGEN.getxml (
'select count(*) c from '
|| owner
|| '.'
|| view_name)),
'/ROWSET/ROW/C'))
COUNT
FROM all_views
WHERE view_name IN
('<list Views here or provide SELECT>')
ORDER BY owner, view_name)
ORDER BY COUNT DESC;
This script was derived from the this post.
No comments:
Post a Comment