Created
June 14, 2013 12:35
-
-
Save mjbommar/5781482 to your computer and use it in GitHub Desktop.
For an Oracle database, select the (possibly stale) table row counts from all_tab_statistics for all tables with a given field name and owner. This example is based on the Oracle Transportation Management (OTM) schema and shows all table row counts for tables with a domain_name field.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_name, num_rows, last_analyzed | |
FROM all_tab_statistics | |
WHERE table_name IN (SELECT table_name | |
FROM all_tab_cols | |
WHERE column_name = 'DOMAIN_NAME' | |
AND owner IN ('GLOGOWNER')) | |
ORDER BY num_rows DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment