Thursday 3 April 2014

script to find the tables and records count in a perticular schema

declare
cnt number;
v_st varchar2(2000);
begin
for rec in (select table_name from all_tables where owner='APPS') loop
cnt :=0;
v_st :='';
v_st :=' Select count(1) from ' || rec.table_name;
 execute_immediate (v_st) into 
cnt ;
dbms_output.put_line(rec.table_name||'|'||cnt);
end loop;
end;
/


* replace the Apps into your schema name.

No comments:

Post a Comment