By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,282 Members | 1,617 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,282 IT Pros & Developers. It's quick & easy.

tablespace query

P: n/a
Newbie question

Is there a way using SQL to see which tables use a particular
tablespace?

Sep 29 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ar********@yahoo.co.uk wrote:
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

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Sep 29 '06 #2

P: n/a
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

Sep 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.