Create Oracle Script To Count All Rows In Each Table

Create Script to count rows in each table.  

The Script Looks as follows:

 

set lines 200
set pages 200
select 'Select count(*) from ' ||owner|| '.' ||table_name|| ';' from dba_all_tables order by owner, table_name; 

 

 

This will produce a script that looks like:

 

Select count(*) from XDBPM.REVISED_CHOICE_MODEL;
Select count(*) from XDBPM.REVISED_COLL_TYPES;
Select count(*) from XDBPM.REVISED_TYPES;
Select count(*) from XDBPM.REVISED_TYPE_ATTRS;
Select count(*) from XDBPM.REVISED_TYPE_SUMMARY;
Select count(*) from XDBPM.SQLLDR_STAGING_TARGET;
Select count(*) from XDBPM.STORAGE_MODEL_CACHE;
Select count(*) from XDBPM.TYPE_SUMMARY;
Select count(*) from XDBPM.XDBPM_INDEX_DDL_CACHE;

Leave a Reply

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