Online Implementation of changing the DB2 page size

Source: Internet
Author: User

In order to change the DB2 page size, the data in the table can still be accessed by this "online" page size conversion, follow these steps to change the DB2 page size online:

1) if no tablespace or buffer pool of the page size needs to be used exists, you should first create the buffer pool and tablespace of the required page size.

2) You can use the DB2LOOK tool to obtain the DDL statements for creating a table, such:

Db2look-d <Database Name>-e-tw <Table Name>-o <output file name>

Modify the output file to create a new table with a table name different from the original table in a tablespace with the required page size.

3) use the modified DDL script to create a new table that is the same as the original table.

4) use the following statement to insert data from the original table to the new table:

Db2 "insert into <new Table Name> (select * from <original table name> )"

5) Delete the original table:

Db2 "drop table <original table name>"

After this operation, the data in the table cannot be accessed by the application.

6) Rename the new table name to the original table name:

Db2 "rename table <new table Name> to <original table name>"

7) restore the application's access to the data in the table.

At this time, the page size of the new table renamed the original table name has been converted from the original page size to the required page size, thus meeting the user's new requirements for the table size. Table data is only inaccessible at an instant from step 4 to step 5 of the entire process. Data in other timelines is in an accessible "online" status.

Note that the preceding steps only apply to the absence of objects dependent on the table in the database. If there are objects dependent on the table in the database, after the DDL statements containing these objects are saved, remove these dependencies first, delete the original table and rename the new table, and then recreate these dependencies.
 

Create a DB2 tablespace in windows

Implementation of DB2 string connection

DB2 update statements for records in the same table

How to expand the tablespace and Field Length in db2

Introduction to DB2 numeric data types

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.