Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How do I find emty tables
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote in message
news:tg2sksbb43016c_at_beta-news.demon.nl...
>
> "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
>
>
Just to add some speed:
select count(*) from <table> where rownum=1
Boris Received on Wed May 16 2001 - 03:00:04 CDT