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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which catalog table has total pages, used pages

Status
Not open for further replies.

solvetek

Programmer
Jul 17, 2001
12
US
We are running UDB ver 6 on AIX.
if i run "list tablespace show detail" command
it gives me the following info:
Total pages = 1000
Useable pages = 992
Used pages = 160
Free pages = 832
High water mark (pages) = 160

Does anyone know which catalog table the above info comes from?? It is not in sysibm.systablespaces and i can not find in in any other tablespaces.
 
Hi There

There is no catalogue table that tells you how much space is allocated to a tablespace you can only find out how much is used by a query like

DB2 SELECT TABNAME, COLCOUNT, TABLEID, TBSPACEID, CARD,NPAGES,FPAGES,(((FPAGES*4096)/1024)/1024) as SizeUsed,TBSPACE,INDEX_TBSPACE FROM SYSCAT.TABLES WHERE TBSPACEID IN (SELECT TBSPACEID FROM SYSCAT.TABLESPACES WHERE TBSPACETYPE = 'D')

The only way to get how much is used is to use the API's db2 provide. You can use the api's or modify the sample programs. There is one called tabspace.sqc which you precompile using the command

db2 prep tabspace.sqc bindfile using bindfilename

This will produce a c program that you need to then compile. You can then modify the c programm to do and get the information you want. I have done this and it works quite well.

I hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top