Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How do I find emty tables
"Niklas Danielsson" <niklas.danielsson_at_eget.fi> wrote in message
news:3B0106D8.C42783C_at_eget.fi...
> Hello all!
>
> I would like to find alla tables that are emty = 0 rows in the database.
> The problem is that I can't analyze the the tables so I can't use
> NUM_ROWS in DBA_TABLES.
>
> Is there any other way?
>
> TIA
>
> niklas.danielsson_at_eget.fi
>
If you don't want to do it the easy way, you obviously need to resort to ...
select count(*) from <table>
and then a series of them.
You could of course filter out all tables with more than 1 extent (they likely don't need to be counted), but the rest ... no other solution. Yes, it will be slow, as the non-empty tables will be counted.
Regards,
Sybrand Bakker, Oracle DBA Received on Tue May 15 2001 - 13:19:08 CDT