Monthly Archive: July 2011

Jul 27 2011

HOWTO: Count all Rows in all Tables – The XMLDB Way

Someone beat me to it in this good post: Oracle Tip: Counting ROWS for all tables in a Schema . So here a reminder for me where to find it. SELECT TABLE_NAME , to_number(extractvalue(xmltype( dbms_xmlgen.getxml(’select count(*) c from ‘||TABLE_NAME)) ,’/ROWSET/ROW/C’)) COUNT FROM user_tables; That said, I don’t like the use of DBMS_XMLGEN (performance reasons/compatibility), so …

Continue reading »