473,806 Members | 2,944 Online
Bytes | Software Development & Data Engineering Community
+ 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(tbsp aceid))
|| case tbspacetype when 'S' then ' using (path '||''''
||'/db2_test/epmtst01/data/'||tbspace||''' '||');'
when 'D' then ' using (file ' ||''''
||'db2_test/epmtst01/data/'||tbspace||'.D BF '||
rtrim(char(page size))||''''||' );'
end
from syscat.tablespa ce

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 26208
<aa*******@yaho o.com> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
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(tbsp aceid))
|| case tbspacetype when 'S' then ' using (path '||''''
||'/db2_test/epmtst01/data/'||tbspace||''' '||');'
when 'D' then ' using (file ' ||''''
||'db2_test/epmtst01/data/'||tbspace||'.D BF '||
rtrim(char(page size))||''''||' );'
end
from syscat.tablespa ce

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*******@yaho o.com> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
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(tbsp aceid))
|| case tbspacetype when 'S' then ' using (path '||''''
||'/db2_test/epmtst01/data/'||tbspace||''' '||');'
when 'D' then ' using (file ' ||''''
||'db2_test/epmtst01/data/'||tbspace||'.D BF '||
rtrim(char(page size))||''''||' );'
end
from syscat.tablespa ce

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
2282
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 at all Michael
1
1401
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 system tables.... Any ideas. Thanks Matt.
4
2463
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 procedure statements in syscomments table. My questions are: If you script your whole database everything you end up having in the text sql scripts, are those also located in the system tables? That means i could simply read those system tables...
9
2345
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! Backup and restore the database!" and I would answer "I can't, the database size is above 50GB and I just can't do it every time I need to recreate the info". So, ¿Do you know any simple way to do these? I don't need the data on the user...
1
1247
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 affecting the overall look of the aspx page. MTIA, Grawsha
13
4922
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 has recently come up because I've been playing around with converting my front end to A2003 format. At some point, I had a corruption issue with a system file MSStorage something. Access kept saying it couldn't find it. When I looked in the db...
1
2271
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 one table showing, sysdiagrams; however, I was able to query sql stmts though. where are they located? or Do I need to contact a dba to release those tables? thanks.
0
826
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 problems and need a bit of help. Firstly, when recreating the tables float type values are seen as real type values, why is this? Secondly, I need to know the scale and precision values for decimals like MyDecimalField (18,2). Where do I find the 18...
7
12449
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 tedious job for me to calculate each table size manually. Thanks in advance, Kamalnath.V
0
2412
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 of all DB2 jobs that are present on particular DB2 database server. Usually system tables are the ones which are created and maintained internally by the database itself . (This is the concept in Microsoft SQL Server ). Also I would like to know the...
0
9719
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10620
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10369
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10110
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5546
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.