The DLM feature uses two system tables: mysql.dlm_policies
and mysql.dlm_progress
. You can use a privileged account to view all available DLM policies and their execution records on the current cluster. The two tables are automatically created when the system starts. You do not need to manually create them.
mysql.dlm_policies table
The mysql.dlm_policies
table records all available DLM policies on the current cluster.
CREATE TABLE `dlm_policies` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT,
`Table_schema` varchar(64) NOT NULL,
`Table_name` varchar(64) NOT NULL,
`Policy_name` varchar(64) NOT NULL,
`Policy_type` varchar(64) DEFAULT NULL,
`Archive_type` varchar(20) DEFAULT NULL,
`Storage_mode` varchar(20) DEFAULT NULL,
`Storage_engine` varchar(64) DEFAULT NULL,
`Storage_media` varchar(20) DEFAULT NULL,
`Storage_schema_name` varchar(64) DEFAULT NULL,
`Storage_table_name` varchar(64) DEFAULT NULL,
`Data_compressed` varchar(10) DEFAULT 'OFF',
`Compressed_algorithm` varchar(64) DEFAULT NULL,
`Enabled` varchar(10) DEFAULT 'ON',
`Priority_number` int(11) NOT NULL,
`Tier_partition_number` int(11) DEFAULT '0',
`Tier_condition` varchar(512) DEFAULT NULL,
`Extra_info` json NOT NULL,
`Comment` varchar(2048) DEFAULT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `unique_policy` (`Table_schema`,`Table_name`,`Policy_name`)
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='PolarDB DLM policies table'
1 row in set (0.00 sec)
ParametersParameter | Description |
---|---|
Id | The auto-increment primary key. |
Table_schema | The database that contains the table. |
Table_name | The name of the table. |
Policy_name | The name of the DLM policy. |
Policy_type | The type of the DLM policy. Default value: TABLE. Valid values:
|
Archive_type | The execution mode of the DLM policy. Default value: PARTITION COUNT. Valid values:
|
Storage_mode | The storage mode. Default value: READ ONLY. Valid values:
|
Storage_engine | The storage engine of the DLM table. Currently, data can be archived only in the CSV format. |
Storage_media | The storage medium of the DLM table. Currently, data can be archived only on OSS. |
Storage_schema_name | The database that contains the table when DLM data is archive is a table. |
Storage_table_name | The name of the table when DLM data is archived as a table. |
Data_compressed | Specifies whether the archived data is compressed. This value will be supported soon. |
Compressed_algorithm | The data compression algorithm. This value will be supported soon. |
Enabled | Specifies whether the DLM policy is enabled. Default value: ENABLED. Valid values:
|
Priority_number | The execution priority of the DLM policy. This value will be supported soon. |
Tier_partition_number | The number of partitions for data archiving when Archive_type is set to PARTITION COUNT. |
Tier_condition | The execution condition for data archiving when Archive_type is set to CONDITION. This value will be supported soon. |
Extra_info | The additional information. |
Comment | The comment of the DLM policy. |
mysql.dlm_progress table
The mysql.dlm_progress
table stores the execution records of DLM policies on the current cluster.
CREATE TABLE `dlm_progress` (
`Id` bigint(20) NOT NULL AUTO_INCREMENT,
`Table_schema` varchar(64) NOT NULL,
`Table_name` varchar(64) NOT NULL,
`Policy_name` varchar(64) NOT NULL,
`Policy_type` varchar(64) DEFAULT NULL,
`Archive_option` varchar(64) DEFAULT NULL,
`Storage_engine` varchar(64) DEFAULT NULL,
`Storage_media` varchar(20) DEFAULT NULL,
`Data_compressed` varchar(10) DEFAULT 'OFF',
`Compressed_algorithm` varchar(64) DEFAULT NULL,
`Archive_partitions` varchar(2048) DEFAULT NULL,
`Archive_stage` varchar(64) DEFAULT NULL,
`Archive_percentage` int(11) DEFAULT NULL,
`Archived_file_info` json NOT NULL,
`Start_time` datetime NOT NULL,
`End_time` datetime DEFAULT NULL,
`Extra_info` json NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE KEY `unique_progress` (`Table_schema`,`Table_name`,`Policy_name`,`Start_time`)
) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='PolarDB DLM progress table'
1 row in set (0.00 sec)
ParametersParameter | Description |
---|---|
Id | The auto-increment primary key. |
Table_schema | The database that contains the table. |
Table_name | The name of the table. |
Policy_name | The name of the DLM policy. |
Policy_type | The type of the DLM policy. Default value: TABLE. Valid values:
|
Archive_option | The execution condition of the DLM policy. |
Storage_engine | The storage engine of the DLM policy. Currently, data can be archived only in the CSV format. |
Storage_media | The storage medium of the DLM policy. Default value: OSS. Valid values:
|
Data_compressed | Specifies whether the archived data is compressed. This value will be supported soon. |
Compressed_algorithm | The data compression algorithm. This value will be supported soon. |
Archive_partitions | Name of the partition for data archiving. |
Archive_stage | The execution phase of the DLM policy. Valid values:
Note
|
Archive_percentage | The execution progress in percentage of the current DLM policy. |
Archived_file_info | The file information after the DLM policy is archived. |
Start_time | The execution start time of the DLM policy. |
End_time | The execution end time of the DLM policy. |
Extra_info | The additional information. |