If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to know the tablespace size using command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-31-04, 08:45
newhu114 newhu114 is offline
Registered User
 
Join Date: Jul 2004
Posts: 17
How to know the tablespace size using command

When I create the tablespace, I can only set the "pagesize" and the "extent size",but I can't set the tablespace physical size like oracle.
Also , the command "list tablespace containers for tablespace_id show detail" can only show the "total pages " and "used pages",they are equals。Actually,the tablespace's size is 580M when I telnet the server to see the physical tablespace file。
Please tell me how to get the actual tablespace used by db,also I want to knnow the fragment percentage in the tablespace file。
Thanks
Reply With Quote
  #2 (permalink)  
Old 07-31-04, 14:54
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If you use SMS (system managed storage) in your Create Tablespace, the size is indefinite and will grow as needed in the path you defined.

If you use DMS (database managed storage) the size is finite and the list tablespace command (show detail) will tell you the size.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 07-31-04, 22:11
newhu114 newhu114 is offline
Registered User
 
Join Date: Jul 2004
Posts: 17
thanks,as to the SMS tablespace,I think I can get the snapshot for tablespace physical size, do you think so? How to ?
Reply With Quote
  #4 (permalink)  
Old 07-31-04, 23:58
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If you do a list tablespaces show detail you will get the following information:

SMS example:
Tablespace ID = 0
Name = SYSCATSPACE
Type = System managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 8083
Useable pages = 8083
Used pages = 8083
Free pages = Not applicable
High water mark (pages) = Not applicable
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1

Note that on SMS, the Total Pages is the same size Used Pages, since the tablespace increases and decreases as needed (although table/index reorgs may be needed to free up empty pages).

DMS Example (Name assigned by DBA):
Tablespace ID = 4
Name = TBSPACE1
Type = Database managed space
Contents = Any data
State = 0x0000
Detailed explanation:
Normal
Total pages = 768000
Useable pages = 767968
Used pages = 253440
Free pages = 514528
High water mark (pages) = 476832
Page size (bytes) = 4096
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1

Note that on DMS, the Total Pages is the size specified by the DBA when the tablespace was created (actually the total of all the containers).
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 08-01-04 at 00:11.
Reply With Quote
  #5 (permalink)  
Old 08-02-04, 10:37
db2hrishy db2hrishy is offline
Registered User
 
Join Date: Jun 2004
Posts: 115
Hi

How can i get something like this

Tablepsace-Name Free Space M bytes Used-Spcae in M bytes


any syscat views that tell me this

regards
Hrishy
Reply With Quote
  #6 (permalink)  
Old 08-02-04, 12:38
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Since you have not mentioned the version, I would assume you are in Version 8 ...

db2 "select * from table( SNAPSHOT_TBS_CFG ('sample',-1)) as test"

and
db2 "select * from table( SNAPSHOT_CONTAINER ('sample',-1)) as test"

If you are still on Version 7 (or lower) ,

then a script in http://www.db2click.com/scripts.htm
should help

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On