Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: arguments

Re: arguments

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 1998/03/19
Message-ID: <6er47o$202$2@news00.btx.dtag.de>#1/1

On Thu, 19 Mar 1998 10:50:24 GMT, a.habraken_at_delion.com (Arthur Habraken) wrote: Hi,

one way would be:

set head off pages 0 feed off
spool t.sql
select 'Select Count(*) Counts,' || tablename || ' table from' || owner || '.' ||table_name|| ' ;' from all_tables
where
owner= <YOUR_SCHEMA>
/
spool off
spool analyze.log
set termout on
set echo on
@t.sql;
spool off

Another to anlayze the tables and then inspect column 'NUW_ROWS' in table all_tables.

set head off pages 0 feed off
spool t.sql
select 'analyze table' || owner '.' ||table_name||' COMPUTE statistics;' from all_tables
where
owner='YOU'
/
spool off
spool analyze.log
set termout on
set echo on
@t.sql;
spool off

>I want something very simple. For testing purposes I need to count the
>number of records in a lot of tables. I'd like to make a procedure
>count_records like this :
>
>declare
> procedure count_records(thetable IN char) is
> max number;
> begin
> select count(*) into max from thetable;
> dbms_output.put_line('# records in ' || thetable || ' :' || max);
> end count_records;
>
>begin
> count_records('table1');
> count_records('table2');
> count_records('table3);
>.
>.
>.
>.
> count_records('table101');
> count_records('table102');
> count_records('table103');
>end;
>
>This doesn't work. Is there another solution to do something like this
>?
>
>Thanks in advance,
>
>Arthur Habraken,
>The Netherlands

--

Regards

Matthias Gresz    :-)

GreMa_at_T-online.de
Received on Thu Mar 19 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US