Created
December 29, 2012 20:08
-
-
Save velppa/4409100 to your computer and use it in GitHub Desktop.
Prints number of rows in each table on given scheme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE | |
n NUMBER; | |
BEGIN | |
FOR rec IN (SELECT owner, | |
table_name | |
FROM all_tables WHERE owner = 'OWNER') -- replace OWNER with target schema | |
LOOP | |
EXECUTE IMMEDIATE 'begin | |
select count(*) into :n from '|| | |
rec.owner||'.'||rec.table_name||'; | |
end;' | |
USING OUT n; | |
dbms_output.put_line(rec.owner||'.'||rec.table_name||' - '||n); | |
END LOOP; | |
END; | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment