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

Home -> Community -> Usenet -> c.d.o.server -> Re: Find Empty Tables

Re: Find Empty Tables

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Thu, 05 Jun 2003 07:28:46 +0000
Message-ID: <bbmkhu$2cn$1@ctb-nnrp2.saix.net>


Marc Blum wrote:

>>I manage several SAP R/3 databases that each contain 25,000 tables and
>>exceed 1TB in size. They are of both 8i and 9i versions.
>>

>
> a SQL*Plus-script will do the job
>
> SET pages 0
> SET head OFF
> SET feed OFF
> SET TRIMSPOOL ON
> SET lines 1000
> SET DEFINE OFF
> SET TERMOUT OFF
> SPOOL tmp.SQL
> SELECT 'SELECT '''||table_name||''' as tab
> FROM '||table_name||'
> WHERE ROWNUM = 1;'
> FROM user_tables;
> SPOOL OFF
> SET TERMOUT ON
> @@tmp.SQL

This will work, but it not ideal on large tables. The difference between an ALL_ROWS (which is what your SELECT will be doing) and a FIRST_ROWS is the difference between several minutes and a second in response time.

--
Billy
Received on Thu Jun 05 2003 - 02:28:46 CDT

Original text of this message

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