473,466 Members | 1,439 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 26178
<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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.