The following query will give the list of tablename and the corresponding row count.
- SELECT table_name, total_count FROM (
- SELECT table_name, extractvalue(xml_data,'/ROWSET/ROW/TOTAL_COUNT/text()') AS total_count FROM(
- SELECT table_name, XMLTYPE(dbms_xmlgen.getxml('SELECT COUNT(1) AS TOTAL_COUNT FROM '||table_name)) AS xml_data
- FROM (
- SELECT table_name
- FROM user_tables WHERE ROWNUM>=0
- )
- )
- )
- ORDER BY total_count DESC;
- The output looks something like this.
- TABLE_NAME | TOTAL_COUNT
- --------------------------|-----------
- CLIENT | 9539
- EBA_DEMO_PROJ_TASK_TODOS | 9
- EBA_DEMO_MD_TASK_TODOS | 9
- ITRAVEL_TABLES | 80
- TCC_EMP | 8
- INVHEAD | 76073
- EBA_DEMO_FILE_PROJECTS | 73
- EBA_UT_CHART_TASKS | 73
- EBA_DEMO_PROJ_TASK_LINKS | 7
No comments:
Post a Comment