DB2 Connect to XXX
Db2 "LIST tablespaces SHOW DETAIL"
Tablespace ID = 7
Name = Tsasnaa
Type = Database Managed Space
Contents = All permanent data. Large table space.
State = 0x0000
Detailed Explanation:[@[email protected]]
Normal
Total Pages = 14800
useable pages = 14752
Used pages = 12864
Free pages = 1888
High water mark (pages) = 12864
Page size (bytes) = 8192
Extent size (pages) = 32
Prefetch size (pages) = 32
Number of containers = 1
Increase table space size
When the DB2 database is in use, how can it be scaled if the tablespace is full? The following will teach you how to expand the DB2 database table space, for your reference, I hope you have some help.
1) Example of adding a container directly:
DB2 "ALTER tablespace PAYROLL ADD (DEVICE '/DEV/RHDISK9 ' 10000)"
After adding the container DB2 will have an automatic balance process that may last for several hours!!! Be sure to note this option before you make a change to confirm that this option meets your business needs!
2) Change the size of the existing container (this method does not trigger balance, but if the table space is built on a bare device, the bare device space is to be flushed):
DB2 "ALTER tablespace TS1 RESIZE (file '/conts/cont0 ', DEVICE '/dev/rcont1 ', file ' Cont2 ' 2000)"
Note that this way is to change the original corresponding container to size is 2000 pages
DB2 "ALTER tablespace TS1 RESIZE (all 2000)"
In this way, all the container sizes in the table space are changed to 2000 pages.
DB2 "ALTER tablespace TS1 EXTEND (file '/conts/cont0 ', DEVICE '/dev/rcont1 ', file ' cont2 ' 1000)"
This approach is to expand the corresponding container to 1000 pages, that is, add 1000 pages.
DB2 "ALTER tablespace data_ts EXTEND (all 1000)"
This means adding 1000 pages to all the containers.
DB2 viewing tablespaces and increasing table space capacity