PL/SQL Code for Counting Rows In Schema Tables
DECLARE
i INTEGER;
BEGIN
dbms_output.Put_line(‘Table Name,Row Count,’
|| To_char(SYSDATE, ‘DD-MON-YYYY HH24:MI:SS’));
FOR v_table IN (SELECT ut.table_name
FROM user_tables ut) LOOP
EXECUTE IMMEDIATE ‘select count(*) from ‘|| v_table.table_name INTO i;
dbms_output.Put_line(v_table.table_name
|| ‘,’
|| To_char(i));
END LOOP;
END;