This topic describes how to configure the destination for a secondary backup, backup parameters, and secondary backup parameters before you perform a secondary backup.
Configure the destination for a secondary backup
Before you perform a secondary backup, you can configure the destination for a secondary backup operation by using the backup_backup_dest parameter. OceanBase Database allows you to use Network File System (NFS) and Object Storage Service (OSS) as the destination for the secondary backup.
Log on to the
systenant as therootuser.Configure the destination for secondary backup.
The setting method of the
backup_backup_destparameter is the same as that of thebackup_destparameter. For more information about the setting of thebackup_destparameter, see Preparations for backup.Notice
Before you set
backup_backup_dest, ensure thatbackup_destis set.The destination specified in
backup_backup_destmust be different from that specified inbackup_dest.
Here are the examples:
NFS
Notice
When you use NFS as the destination for the secondary backup, note the following points:
The value of
backup_backup_destcannot be a string with a question mark (?).We recommend that you set
backup_backup_destto an absolute path to ensure that the OBServer node has the write permission onbackup_backup_dest.Ensure that all OBServer nodes are mounted to NFS of the same server and use the parameter settings recommended in this topic. For more information about the procedure of mounting NFS, see Deploy the NFS client.
Set the backup destination to NFS:
obclient> ALTER SYSTEM SET backup_backup_dest='file:///data/nfs/backup_backup';OSS
Set the destination for the secondary backup to OSS and configure a clearing mode:
obclient> ALTER SYSTEM SET backup_backup_dest='oss://oceanbase-test-bucket/backup_backup/?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=delete';
After the destination for the secondary backup is configured, you can replace the destination after performing the following operation during a secondary backup task:
Stop the secondary backup task.
For more information, see Stop a secondary backup task.
Recommended. Stop secondary backup clearing.
For more information, see Stop secondary backup clearing.
(Optional) Configure backup parameters
Before you perform a secondary backup, if you want two copies of all backup set pieces, you must set the copies of the backup set by configuring the backup_copies parameter for backup_dest_option.
Log on to the
systenant as therootuser.Configure the
backup_copiesparameter forbackup_dest_option.The
backup_dest_optionparameter specifies backup-related parameters. Thebackup_copiesparameter specifies the number of backup copies. The value range of this parameter is [0, 8] and the default value is0. If the value ofbackup_copiesis set to a value less than2, the result of the secondary backup task does not affect the backup clearing task. Ifbackup_copies=2, the source backup data can be cleared only when the secondary backup is successful. If secondary backup is not set, we recommend that you use the default value.For more information about the configuration and description of the
backup_copiesparameter forbackup_dest_option, see Preparations for backup.For more information about the
backup_dest_optionparameter, see backup_dest_option.
(Optional) Configure secondary backup parameters
Log on to the
systenant as therootuser.Set the
backup_backup_dest_optionparameter to configure parameters related to secondary backup.You can set the following secondary backup-related parameters for
backup_backup_dest_option:log_archive_checkpoint_intervalThe
log_archive_checkpoint_intervalparameter specifies the interval of secondary log backup operations when log splitting is not enabled.If you do not specify this parameter, the value of the cluster-level
log_archive_checkpoint_intervalis used. If you do not specify eitherbackup_backup_dest_optionorlog_archive_checkpoint_interval, the default value 0 is used.We recommend that you enable log splitting to start a secondary log backup.
recovery_windowThe
recovery_windowparameter specifies the time window for restoring secondary backup data. The system determines whether secondary backup data has expired based on the value of this parameter. For example, the configurationrecovery_window='7d'indicates that backup data within the last 7 days can be restored, and the secondary backup data beyond this restore window is considered expired. For more information about therecovery_windowparameter, see Automatically clear backup data for clusters.If you do not specify the parameter in this parameter, the value of the cluster-level parameter
backup_recovery_windowis used by default. If you do not specify eitherbackup_backup_dest_optionorbackup_recovery_window, the default value0is used, which indicates that secondary backup data does not expire.auto_delete_obsolete_backupThe
auto_delete_obsolete_backupparameter specifies whether to automatically clear expired secondary backup data. For example,auto_delete_obsolete_backup=truespecifies that expired secondary backup data is automatically cleared.If you do not specify this parameter, the value of the cluster-level parameter
auto_delete_expired_backupis used by default. If you do not specify eitherbackup_backup_dest_optionorauto_delete_expired_backup, the default valuefalseis used, indicating that expired secondary backup data will not be automatically cleared.For example:
obclient> ALTER SYSTEM SET backup_backup_dest_option='recovery_window=14d&auto_delete_obsolete_backup=true';For more information about the
backup_backup_dest_optionparameter, see backup_backup_dest_option.