DB2 viewing tablespaces and increasing table space capacity

Source: Internet
Author: User
Tags db2 db2 connect db2 connect to

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

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.