How to Count Records of All Tables in Oracle Schema

SELECT  TABLE_NAME,
        TO_NUMBER(
            EXTRACTVALUE(
                XMLTYPE(
                    DBMS_XMLGEN.GETXML(
                        'SELECT COUNT(1) C FROM '||TABLE_NAME
                    )
                ), '/ROWSET/ROW/C'
            )
        ) RECORDS_COUNT
FROM    USER_TABLES;

Expert in Oracle Database 10g and 11g. Deep knowledge on SQL, PL/SQL and Java programming. Working at Square InformatiX Limited as Oracle Database Administrator.

Posted in Oracle Tagged with:

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>