Setting the Retention Period for Multiversion Backup Data
Function
After multiversion is enabled, backup data is retained for seven days by default. You can change the retention period by setting system parameter dli.multi.version.retention.days. Multiversion data out of the retention period will be automatically deleted when the insert overwrite or truncate statement is executed. You can also set table attribute dli.multi.version.retention.days to adjust the retention period when adding a column or modifying a partitioned table. For details about the syntax for enabling or disabling the multiversion function, see Enabling or Disabling Multiversion Backup.
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.
Syntax
1 2 |
ALTER TABLE [db_name.]table_name SET TBLPROPERTIES ("dli.multi.version.retention.days"="days"); |
Keyword
- TBLPROPERTIES: This keyword is used to add a key/value property to a table.
Parameter
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 |
days |
Date when the multiversion backup data is reserved. The default value is 7 days. The value ranges from 1 to 7 days. |
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.
Example
1 2 |
ALTER TABLE test_table SET TBLPROPERTIES ("dli.multi.version.retention.days"="5"); |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot