Secondary backup of data backups
The secondary backup of data backups is performed by transferring the data backups saved at the source backup location to the destination backup location.
Run the following commands to perform secondary backup on data backups:
obclient> ALTER SYSTEM BACKUP BACKUPSET ALL;
obclient> ALTER SYSTEM BACKUP BACKUPSET N;
In the commands:
ALLindicates the backup set of all data backups.Nindicates thebackup_set_idof backups to be included in the secondary backup.
Assume that five backup sets exist with backup_set_id of 1, 2, 3, 4, and 5, and that 1, 2, and 4 are full backups whereas 3 and 5 are incremental backups. The following examples perform secondary backup on them.
Perform secondary backup on all current backup sets.
obclient> ALTER SYSTEM BACKUP BACKUPSET ALL;Perform secondary backup on the backup set whose
backup_set_idis3.obclient> ALTER SYSTEM BACKUP BACKUPSET 3;If one backup set is dependent on another, and you have performed secondary backup by specifying the
backup_set_idof the referenced backup set first, the system prompts an execution error when you try to perform secondary backup by specifying thebackup_set_idof the dependent backup set.For the example backup sets, if you execute
ALTER SYSTEM BACKUP BACKUPSET 3;first and thenALTER SYSTEM BACKUP BACKUPSET 1;, the execution will fail.
Secondary backup of non-split log backups
The secondary backup of non-split log backups is performed by transferring the logs saved at the source backup location to the destination backup location.
Configure the destination for secondary backup.
Before you perform secondary backup, you must specify the destination for secondary backup by setting
backup_backup_destto an OSS or NFS storage. This is similar to settingbackup_dest. For more information about settingbackup_dest, see Backup by using commands.Example:
In the command,
xxxindicates the destination for secondary backup.obclient> ALTER SYSTEM SET backup_backup_dest='xxx';Set the interval for the worker thread of secondary backup.
In the
backup_backup_dest_optionconfiguration item, log_archive_checkpoint_interval specifies the interval for performing secondary backup on log backups. For more information aboutbackup_backup_dest_option, see the "backup_backup_dest_option" topic in Reference Guide (MySQL Mode) or Reference Guide (Oracle Mode).Example:
obclient> ALTER SYSTEM SET backup_backup_dest_option = 'log_archive_checkpoint_interval='30s';Start the worker thread of secondary backup for log backups.
obclient> ALTER SYSTEM START BACKUP ARCHIVELOG;Note
After the worker thread is started, you can execute the
ALTER SYSTEM STOP BACKUP ARCHIVELOG;statement to stop it.
Secondary backup of split log backups
In physical backup and recovery, the content of the backup directory can be split. You can resolve the problem of insufficient capacity on the backup storage media by performing secondary backup on the split content.
Preparations
To split the content of the backup directory, you need to set the options for each backup destination first. That is,
backup_dest_optionandbackup_backup_dest_optionneed to be set.Set
backup_dest_option.backup_dest_optionspecifies parameters related to backup. For more information aboutbackup_dest_option, see the "backup_dest_option" topic in Reference Guide (MySQL Mode) or Reference Guide (Oracle Mode).Example:
obclient> ALTER SYSTEM SET backup_dest_option='log_archive_checkpoint_interval=2m&recovery_window=7d&auto_delete_obsolete_backup=true&log_archive_piece_switch_interval=1d&backup_copies=2';In this example, the log archiving interval is 5s, and a backup piece is split from the log backups every day. This backup piece is retained for seven days, and then automatically cleared. By setting
backup_copiesto2, the original backup is only recycled after its secondary backup is performed.Set
backup_backup_dest_option.backup_backup_dest_optionspecifies parameters related to secondary backup. For more information aboutbackup_backup_dest_option, see the "backup_backup_dest_option" topic in Reference Guide (MySQL Mode) or Reference Guide (Oracle Mode).Example:
obclient> ALTER SYSTEM SET backup_backup_dest_option='log_archive_checkpoint_interval=2m&recovery_window=14d&auto_delete_obsolete_backup=true';In this example, a secondary backup is performed on the log backups every 2 minutes, and these secondary backups expire in fourteen days.
Start physical backup. For more information about physical backup, see Backup by using commands.
Perform secondary backup on a single backup directory
If you need to perform secondary backup on a single backup directory, you can specify a single backup set or backup piece. To archive the secondary backup to a destination different from the one specified in backup_backup_dest, you can specify another destination in the secondary backup command.
Run the following commands to perform secondary backup on a single backup directory:
obclient> ALTER SYSTEM BACKUP BACKUPSET [=N] [backup_backup_dest = uri];
obclient> ALTER SYSTEM BACKUP BACKUPPIECE [=N] [backup_backup_dest = uri];
In the commands:
Nindicates thebackup_set_idorpiece_idto be included in the secondary backup.uriindicates the destination for archiving the secondary backup data.
Examples:
Save a secondary backup for the backup whose
backup_set_idis1to thefile:///data/backup_backup_nfsdirectory.obclient> ALTER SYSTEM BACKUP BACKUPSET 1 backup_backup_dest = 'file:///data/backup_backup_nfs';Save a secondary backup for the backup whose
piece_idis1to thefile:///data/backup_backup_nfsdirectory.obclient> ALTER SYSTEM BACKUP BACKUPPIECE 1 backup_backup_dest = 'file:///data/backup_backup_nfs';
Perform secondary backup on multiple backup directories
Run the following commands to perform secondary backup on multiple backup directories:
Perform secondary backup on all directories or specified directories in the backup set.
obclient> ALTER SYSTEM BACKUP BACKUPSET ALL [backup_backup_dest = 'xxxxx']; obclient> ALTER SYSTEM BACKUP BACKUPSET ALL NOT BACKED UP N TIMES backup_backup_dest = 'xxxxx';Perform secondary backup on all directories or specified directories in the backup piece.
obclient> ALTER SYSTEM BACKUP BACKUPPIECE ALL [backup_backup_dest = 'xxxxx']; obclient> ALTER SYSTEM BACKUP BACKUPPIECE ALL NOT BACKED UP N TIMES backup_backup_dest = 'xxxxx';
In the commands:
ALLindicates that allbackup_set_idandpiece_iddirectories whosefile_statusisAVAILABLEwill be included in the secondary backup.The
NOT BACKED UP N TIMESparameter indicates that data that has been backed up N times will not be included in the secondary backup.Nindicates the number of times.If the
NOT BACKED UP N TIMESparameter is specified in the command, thebackup_backup_destparameter must also be specified. Otherwise, thebackup_backup_destparameter does not need to be specified, and the backup data is archived to the directory specified by thebackup_backup_destconfiguration item by default.