You can restore secondary backup data as needed.
Prerequisites
You have completed the secondary backup operation.
Procedure
Run the following commands in the sequence shown to obtain the path of the data to be restored.
In the following example,
xxxindicates the backup destination specified inbackup_destduring backup.obclient> ALTER SYSTEM RESTORE tenant1_restored FROM tenant1 AT 'xxx' UNTIL '2020-02-20 10:00:00.000000' WITH 'backup_cluster_name=ob_cluster_1&backup_cluster_id=1&pool_list=restore_pool&locality=F@z1,F@z2,F@z3' preview; obclient> SHOW RESTORE PREVIEW;Load the path of the data to be restored.
xxxindicates the path of the data to be restored.obclient> ALTER SYSTEM ADD RESTORE SOURCE 'xxx'If the path you entered is wrong, you can use the following SQL statement to cancel the previous input.
obclient> ALTER SYSTEM CLEAR RESTORE SOURCE;Run the restoration command.
Unlike a general physical restoration command, the SQL statement for a restoration based on multiple backup destinations does not include the
AT 'backup_dest'clause. Example:obclient> ALTER SYSTEM RESTORE <restore_tenant> FROM <backup_tenant> UNTIL '<restore_checkpoint>' WITH 'backup_cluster_name=<backup_cluster_name>&backup_cluster_id=<backup_cluster_id>&pool_list=small_pool_2&locality=F@z1&primary_zone=z1';In the command:
restore_tenantindicates the name of the restored tenant.backup_tenantindicates the name of the tenant that was backed up.restore_checkpointindicates the upper limit timestamp of the restoration operation.backup_cluster_nameindicates the name of the cluster that was backed up.backup_cluster_idindicates the ID of the cluster that was backed up.