Deleting Multiversion Backup Data
Function
The retention period of multiversion backup data takes effect each time the insert overwrite or truncate statement is executed. If neither statement is executed for the table, multiversion backup data out of the retention period will not be automatically deleted. You can run the SQL commands described in this section to manually delete multiversion backup data.
Syntax
clear history for table [db_name.]table_name older_than 'timestamp';
Keywords
- clear history for table: Used to delete multiversion backup data
- older_than: Used to specify the time range for deleting multiversion backup data
Parameters
Parameter |
Description |
---|---|
db_name |
Database name, which consists of letters, digits, and underscores (_). The value cannot contain only digits or start with a digit or underscore (_). |
table_name |
Table name |
Timestamp |
Multiversion backup data generated before the timestamp will be deleted. Timestamp format: yyyy-MM-dd HH:mm:ss |
Precautions
- Currently, the multiversion function supports only OBS tables created using the Hive syntax. For details about the syntax for creating a table, see Creating an OBS Table Using the Hive Syntax.
- This statement does not delete the backup data of the current version.
Example
clear history for table dliTable older_than '2021-09-25 23:59:59';
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.