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

How to find a tablespace storage size and containers size via system tables

P: n/a
I'm cloning a db and I need to redirect the files using the set
tablespace container command. However, that command requires the size
of the tablepsace - I've developed the following sql which will get my
tablspace names - where would I find the tablespace size for the
tablespaces I want to clone.

select 'set tablespace containers for '
|| rtrim(char(tbspaceid))
|| case tbspacetype when 'S' then ' using (path '||''''
||'/db2_test/epmtst01/data/'||tbspace||''''||');'
when 'D' then ' using (file ' ||''''
||'db2_test/epmtst01/data/'||tbspace||'.DBF '||
rtrim(char(pagesize))||''''||');'
end
from syscat.tablespace

It would output..

set tablespace containers for 237 using file
'(db2_test/epmtst01/data/WAWORKIDX.DBF)'

However, I need to add the number of pages at the end of that
statement.

thanks
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<aa*******@yahoo.com> wrote in message
news:6f**************************@posting.google.c om...
I'm cloning a db and I need to redirect the files using the set
tablespace container command. However, that command requires the size
of the tablepsace - I've developed the following sql which will get my
tablspace names - where would I find the tablespace size for the
tablespaces I want to clone.

select 'set tablespace containers for '
|| rtrim(char(tbspaceid))
|| case tbspacetype when 'S' then ' using (path '||''''
||'/db2_test/epmtst01/data/'||tbspace||''''||');'
when 'D' then ' using (file ' ||''''
||'db2_test/epmtst01/data/'||tbspace||'.DBF '||
rtrim(char(pagesize))||''''||');'
end
from syscat.tablespace

It would output..

set tablespace containers for 237 using file
'(db2_test/epmtst01/data/WAWORKIDX.DBF)'

However, I need to add the number of pages at the end of that
statement.

thanks


list tablespaces show detail

There is way in Version 8 to access this via SQL if you check out the
following article
www-106.ibm.com/developerworks/db2/library/techarticle/dm-0404snow/index.htm
l
see Appendix 1: Table Space Information Script
Nov 12 '05 #2

P: n/a
<aa*******@yahoo.com> wrote in message
news:6f**************************@posting.google.c om...
I'm cloning a db and I need to redirect the files using the set
tablespace container command. However, that command requires the size
of the tablepsace - I've developed the following sql which will get my
tablspace names - where would I find the tablespace size for the
tablespaces I want to clone.

select 'set tablespace containers for '
|| rtrim(char(tbspaceid))
|| case tbspacetype when 'S' then ' using (path '||''''
||'/db2_test/epmtst01/data/'||tbspace||''''||');'
when 'D' then ' using (file ' ||''''
||'db2_test/epmtst01/data/'||tbspace||'.DBF '||
rtrim(char(pagesize))||''''||');'
end
from syscat.tablespace

It would output..

set tablespace containers for 237 using file
'(db2_test/epmtst01/data/WAWORKIDX.DBF)'

However, I need to add the number of pages at the end of that
statement.

thanks


list tablespaces show detail

There is way in Version 8 to access this via SQL if you check out the
following article
www-106.ibm.com/developerworks/db2/library/techarticle/dm-0404snow/index.htm
l
see Appendix 1: Table Space Information Script
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.