DB2 reorg table, error due to insufficient tablespace

Source: Internet
Author: User

After the structure of a table is changed, You Need To reorg the table and reorganize its directory statistics to provide information for the database access plan, so as to perform operations on it efficiently.

 

When a column of a table is added to a database for maintenance, the reorg operation is performed on it. An error occurs "? The error cause for sql0xxx "check is that the physical space is full. Then, check $ db2_install_dir/sqllib/db2dump/and view db2diag. log to find that the tablespace size is insufficient. If reorg table does not specify the tablespace to use for reorg operations, the tablespace where the table is located will be used by default. reorg table and index XXX means that the table and its indexes are reorg together, the system temporary tablespace is used by default.

 

My table has a large amount of data, so I created a new temporary tablespace named mytempspace1 on a disk with a large space, then use the tablespace for reorg operation reorg table $ tablename index $ indexname use mytempspace1

 

This table space will be created here. Its pagesize must match the pagesize of the table. Then, the maintenance personnel can use the statements used to create the table space in the original DB2 to refer to creating their own new table space. Use db2look-d $ dbname-l-e-x-o $ db. Layout

 

In this way, you can view dB. layout to copy some parameters of the originally created tablespace.

 

At the end of the execution, because my table is too big, there is still a problem. When my temporary tablespace is reduced by about 40 GB, I don't need this space (I still have more than 50 GB space. I don't know if it restricts this space when I create a tablespace. I haven't checked it yet ), when the default temporary system tablespace (30 GB) is used up, the system reports that the error space is insufficient.

 

 

At that time, it was about to crash. I tried to only execute reorg table $ tablename use mytempspace1. After one hour of execution, the execution was successful !!!

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.