RE: EMPTY TABLES..

RE: EMPTY TABLES..

 

  

Sravanthi

If the stats are up to date for all tables in the db

SELECT NAME FROM SYSIBM.SYSTABLES WHERE CARD = 0 with ur;

Otherwise, a script can be generated to perform runstats...

SELECT 'RUNSTATS ON TABLE '||RTRIM(CREATOR)||'.'||NAME||' AND INDEXES ALL SHRLEVEL CHANGE;' R1
FROM SYSIBM.SYSTABLES
WHERE TYPE = 'T'
ORDER BY CREATOR,NAME
WITH UR;

The results from the script above can then be used to update stats for all tables, and the CARD value will be accurate then. You may want / need different options for the RUNSTATS command.

Hope this helps

Good luck

Raul Delhumeau


-----Original Message-----
From: Sravanthi Lacky
[mailto:db2udbdba-ezmlmshield-x33423294.[Email address protected]
Sent: Thursday, March 31, 2005 11:00 AM
To: LazyDBA Discussion
Subject: EMPTY TABLES..


Hello,
A simple question - can anybody tell me how to get the list of tables with
no data(rowcount of 0 ) from the system tables in DB2UDB V 8.1 ??


Thank you.

Regards,



---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


DB2 & UDB email list listserv db2-l LazyDBA home page