Newbie question
Is there a way using SQL to see which tables use a particular
tablespace?
Knut Stolze - 29 Sep 2006 21:30 GMT
> Newbie question
>
> Is there a way using SQL to see which tables use a particular
> tablespace?
SELECT tbspaceid
FROM syscat.tables
or if you prefer the names:
SELECT ( SELECT tbspace
FROM syscat.tablespaces AS ts
WHERE ts.tbspaceid = t.tbspaceid )
FROM syscat.tables

Signature
Knut Stolze
DB2 Information Integration Development
IBM Germany
Artur - 01 Oct 2006 00:26 GMT
DB2 Control Center can help you to learn, how to write such SQLs.
Just right click on selected tablespace and choose "Show related", and
then look for the "Show SQL" button. It will show SQL that queries DB2
system calalog. You can do the same with other objects and relations,
like "what are the indexes for the table?".
-- Artur Wronski