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: Andy <andy.spaven_at_eps-hq.co.uk>
Date: Fri, 30 May 2003 10:16:26 +0100
Message-ID: <CfFBa.357$95.124@newsr2.u-net.net>


Charles

You could try SELECT 'X' FROM DUAL WHERE EXISTS( SELECT 'X' FROM table).

Oracle optimises EXISTS such that it only finds the first row before ending that query (the subquery in the case above). If the select above (whole statement) returns 'X' (you could 1 or NULL or whatever it's trivial and irrelevant in the grand scale of things) then you have a non empty table.

Andy

"Charles Davis" <cdavis10717_at_comcast.net> wrote in message news:3_Sdnd6lkMjJLEujXTWcqw_at_comcast.com...
> Hi, all!
>
> 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.
>
> Does anyone have a process or query that scales up well and that can find
> tables that are empty without doing a SELECT count(*) on each of the
tables?
>
> Thx.
>
> charles
>
>
Received on Fri May 30 2003 - 04:16:26 CDT

Original text of this message

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