Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

largest tables in database

Status
Not open for further replies.

cougartrace

Technical User
Sep 9, 2003
29
US
Can someone help me with a query that will give me the 30 largest tables in a DB2 UDB database?

Thanks,

CougarTrace
 
Something like:

Code:
Select * from SYSCAT.TABLES WHERE TABSCHEMA = 'TARGET' order by NPAGES DESC FETCH FIRST 30 ROWS ONLY

Ties Blom
Information analyst
 
Ties is assuming you are using same pagesize for all tables, which of course in most cases is correct. otherwise you need to join with syscat.tablespaces to get the pagesize and multiply.

(assuming from the host system catalog structure)

Juliane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top