473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
4 26156
<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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Michael, | last post by:
I dont want to see these at all and cannot find where to specify a view or modification of a view. can someone throw me a bone here and tell me where to make the adjustments if I can make them...
1
by: matt | last post by:
can you defrag system tables. They appear in my dbcc showcontig report. Some are worse than other but if it where a user table I would defrag it. However the reindex commands doesnt work on...
4
by: serge | last post by:
I tried all the INFORMATION_SCHEMA on SQL 2000 and I see that the system tables hold pretty much everything I am interested in: Objects names (columns, functions, stored procedures, ...) stored...
9
by: Vassago | last post by:
Hi! I need to recreate the system tables (sysobjects, syscolumns, sysindexes, sysforeignkeys, sysconstraints, sysreferences, sysindexkeys at least) in another SQL server. You may say "Thats easy!...
1
by: al | last post by:
Greetings, How should I adjust my text size on my 21(inch) screen so it looks nicely fit on client's 17(inch), all are with IE 6? I use 'Larger' text size but it appears large on client's and...
13
by: rdemyan via AccessMonster.com | last post by:
My front-end code manually links to the backend file. I was wondering what stops Access from linking to the system tables in the backend file. Is it just by virtue that they are hidden? This...
1
by: TGEAR | last post by:
I am using MS SQL Server management studio. I treid to see some system tables which are sysobjects, syscolumns, systypes, etc.., but i don't see the list under the system tables folder. There is...
0
by: bkelly1977 | last post by:
Hi all, I am trying to create a program in VB.NET that will go through the system tables of an SQL Server 2000 database and recreate it. I am making good progress but I have a couple of...
7
by: Gladiator | last post by:
Hi , I was trying to find the size of a schema (Size of all the tables in a schema). Can some one tell me an easy way to do this. There are more than 200 tables in my schema and it is very...
0
by: db2forumpost | last post by:
Hi, I am basically a Microsoft SQL Server DBA. I am relatively new to DB2 database. I would like to know if we can find out the name of the system table in DB2 database, which holds the list...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.