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;

Rahinur Rahaman is an Oracle Database Administrator. Currently he is working at Square InformatiX Limited, Dhaka, Bangladesh.

Tagged with:
Posted in Oracle

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>