-
Ok, I know this is an easy one but I am having a serious brain fart.
I created a script that does a count(1) on all tables for a schema. Ex...
select count(1) from jeff.myhero;
select count(1) from jeff.palforlife;
Ect...
How do I get this to display the table_name, all this displays is count(1)
100 rows
but no table name.
I played with the SQL* plus, verify, echo, termout, serveroutput but i got nada, suggestions?
Thanks;
MH
I remember when this place was cool.
-
exec dbms_utility.analyze_schema('JEFF','COMPUTE');
select table_name, num_rows
from user_tables;
Jeff Hunter
-
Are you generating your script from user_tables? If so, add a second column:
select 'THE_ULTIMATE_MASTER' tabname, count(*) num_rows
from jeff.the_ultimate_master;
Jeff Hunter
-
Thanks Jeff;
I thought about running an analyze but this is a production box and I'm not sure how much impact that will have or if it will screw up the optimizer or not. What say you?
BTW this is Oracle 8.0.4.4.0 on HP/UX
MH
I remember when this place was cool.
-
select 'select count(1) from SCHEMA.'||table_name||';'
from dba_tables
where owner='SCHEMA';
This is how I generated the script, I spooled it.
MH
I remember when this place was cool.
-
select 'select ' || table_name || ', count(1) from SCHEMA.'||table_name||';'
from dba_tables
where owner='SCHEMA';
Jeff Hunter
-
Originally posted by marist89
select 'select ' || table_name || ', count(1) from SCHEMA.'||table_name||';'
from dba_tables
where owner='SCHEMA';
Close but no cigar quiz kid, either I am doing something wrong or this SQL is schmutzed.
Thanks though;
MH
I remember when this place was cool.
-
OK, OK.
select 'select ''' || table_name || ''', count(1) from SCHEMA.'||table_name||';'
from dba_tables
where owner='SCHEMA';
Surely, an OCP like yourself could have figured that out...
Jeff Hunter
-
You have to admire a man that gets defensive when he SCREWS UP!!
Thanks;
Hugs and Kisses
MH
I remember when this place was cool.
-
Originally posted by Mr.Hanky
You have to admire a man that gets defensive when he SCREWS UP!!
Your welcome?
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|