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