This topic describes how to defragment spaces in the databases for which the Open (DMS OnlineDDL first) feature is enabled in Data Management (DMS).
- You have permissions to change table data in the database in which you want to defragment spaces. For more information, see View owned permissions.
- The Open (DMS OnlineDDL first) feature is enabled for the database instance to which the database belongs. For more information, see Enable the Open (DMS OnlineDDL first) feature.
Frequent execution of
DELETE statements in a database results in space fragments. These space fragments may be
wasted if they are not recycled. You can recycle space fragments to improve database
- If you do not need to change table schemas in the short run, you can submit a data change ticket to recycle space fragments.
- If you need to change table schemas in the short run, you can submit a data change ticket to change schemas and recycle space fragments at the same time. This reduces workload.
- Log on to the DMS console V5.0.
- On the Data Change Ticket Application page, set the parameters as required and enter
the SQL statements that are used to modify the comments on tables or fields in the
SQL Text field. After the data change, the table space is defragmented. For more information,
see Change regular data.
You can use one of the following SQL statements in the ticket:
ALTER TABLE table_name COMMENT 'Modified table comments';
ALTER TABLE table_name ENGINE=InnoDB;
OPTIMIZE TABLE table_name;
ALTER TABLE table_name MODIFY COLUMN field_name INT COMMENT 'Modified field comments';