It's all about the answers!

Ask a question

How to extend tablespace?

Jack Smith (1323) | asked Aug 04 '15, 6:53 p.m.
One of tablespace "CONTENTSS' has been used up to 70% in CCM database . I think I should extend the space? How?

Tiago Moura commented Aug 04 '15, 6:56 p.m.

 It is a quite broad question. Try to give more details, which version? which database?

Jack Smith commented Aug 05 '15, 2:25 a.m.

It is RTC version 4.0.6 with IBM DB2 9.7.

Accepted answer

permanent link
Taki Nakajo (1.1k2746) | answered Aug 05 '15, 5:29 a.m.
When you run "db2pd" command against the DB2 database 'CCM',  the column "AR" in the Tablespace Autoresize Statistics says "Yes" for the tablespace "CONTENTTS", which means Auto resize is enabled that the tablespace will be extended automatically so you don't need to extend manually.

Database Partition 0 -- Database CCM -- Active -- Up 0 days 02:54:19 -- Date 07/15/2015 11:17:36
Tablespace Configuration:
Address            Id    Type Content PageSz ExtentSz Auto Prefetch BufID BufIDDisk FSC NumCntrs MaxStripe  LastConsecPg Name
0x00002AF9956CFF60 4     DMS  Large   16384  32       Yes  192      1     1         Off 1        0          31           CONTENTTS

Tablespace Statistics:
Address            Id    TotalPgs   UsablePgs  UsedPgs    PndFreePgs FreePgs    HWM        Max HWM    State      MinRecTime NQuiescers PathsDropped
0x00002AF9956CFF60 4     9830400    9830368    5348512    0          4481856    5348512    5348512    0x00000000 0          0          No          
Tablespace Autoresize Statistics:
Address            Id    AS  AR  InitSize    IncSize     IIP MaxSize     LastResize                 LRF
0x00002AF9956CFF60 4     No  Yes 0           -1          No  None        None                       No  

If not, you can enable by the following db2 command.
db2 "alter tablespace <name of tablespace> autoresize yes"
For example:
db2 "alter tablespace CONTENTTS autoresize yes"
See more details in Automatic re-sizing of DMS table spaces.

If you want to extend/resize manually, you can do by the following db2 command.
db2 "alter tablespace <name of tablespace> extend (file 'name of container' <extend size>)"

For example:
db2 "alter tablespace CONTENTTS extend (file '/work/dsiddms' 15M)"
db2 "alter tablespace CONTENTTS resize (file '/work/dsiddms' 15M)"

See more details in ALTER TABLESPACE Statement

Note: It is recommended you always consult your database administrator before doing this task.
Jack Smith selected this answer as the correct answer

Your answer

Register or to post your answer.