You can automatically clear secondary backup data as needed.
Notes
Only data stored in the backup destination specified by
backup_backup_destcan be automatically cleared. If the destination of a secondary backup has been changed, it must be manually cleared upon expiration.Automatic data clearing will retain at least one valid secondary backup copy. If an expired backup is the only valid copy, it will not be automatically cleared.
Enable automatic clearing
Log on to the database as the root user of the sys tenant.
Run the following command to set the expiration time and clearing policy of backup data:
The following example enables automatic clearing of data older than fourteen days.
obclient> ALTER SYSTEM SET backup_backup_dest_option='recovery_window=14d&auto_delete_obsolete_backup=true';In the command:
recovery_windowspecifies the retention period of secondary backup data.If you do not specify this parameter in the
backup_backup_dest_optionconfiguration item, the value of the cluster-level configuration itembackup_recovery_windowis used by default. If you do not specify eitherbackup_dest_optionorbackup_recovery_window, the default value0is used, indicating that secondary backup data will never expire. We recommend that you usebackup_backup_dest_optionto specify the retention period of secondary backup data.When the secondary backup expires, the system automatically clears it based on preset rules.
auto_delete_obsolete_backupspecifies whether to automatically delete expired backup data.If you do not specify this parameter in the
backup_backup_dest_optionconfiguration item, the value of the cluster-level configuration itemauto_delete_expired_backupis used by default. If you do not specify eitherbackup_dest_optionorauto_delete_expired_backup, the default valuefalseis used, indicating that expired backup data will not be automatically deleted. In this case,auto_delete_obsolete_backupmust be set totrue. We recommend that you usebackup_backup_dest_optionto specify whether to automatically clear expired backup data.
For more information about
backup_backup_dest_option, see the "backup_backup_dest_option" topic in Reference Guide (MySQL Mode) or Reference Guide (Oracle Mode).