SQL*Plus

Count the number of rows for ALL tables in current schema

OEasy 2006. 12. 26. 15:14
rem -----------------------------------------------------------------------
rem Filename:   countall.sql
rem Purpose:    Count the number of rows for ALL tables in the current schema
rem Date:       30-Apr-1999
rem Author:     Frank Naude, Oracle FAQ
rem -----------------------------------------------------------------------

set termout off echo off feed off trimspool on head off pages 0

spool countall.tmp
select 'SELECT count(*), '''||table_name||''' from '||table_name||';'
from   user_tables
/
spool off

set termout on
@@countall.tmp

set head on feed on