How to expand a DB2 tablespace

Source: Internet
Author: User

When using the DB2 database, if the tablespace is full, how can we resize it? The following describes how to expand the tablespace of a DB2 database for your reference.

1) Example of directly adding a container:

Db2 "alter tablespace payroll add (DEVICE '/dev/rhdisk9' 10000 )"
After adding a container, DB2 will have an automatic balance process, which may last for several hours !!! Be sure to pay attention to this option. check whether this option can meet your business needs before modification!

2) change the size of the existing container (this method does not trigger the balance, but if the tablespace is created on the bare device, the space of the bare device will be expanded ):

Db2 "alter tablespace TS1 RESIZE (FILE '/conts/cont0' 2000, devic'/dev/rcont1 '2000, FILE 'cont2' 2000 )"

Note that this method is to change the size of the original container to 2000 pages.

Db2 "alter tablespace TS1 RESIZE (ALL 2000 )"

This method is to change the size of all containers in the tablespace to 2000 pages.

Db2 "alter tablespace TS1 EXTEND (FILE '/conts/cont0' 1000, devic'/dev/rcont1 '1000, FILE 'cont2' 1000 )"

This method expands the corresponding containers by 1000 pages, that is, by 1000 pages.

Db2 "alter tablespace DATA_TS EXTEND (ALL 1000 )"

This method adds 1000 pages to all containers.


 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.