You can initiate a data backup for a specified tenant based on your business needs.
Limitations
When you initiate a data backup for a tenant, you must specify a backup path that is different from the backup path of the cluster.
You can initiate a data backup for tenants only when log backup is enabled at the cluster level.
If a backup file of a tenant is generated at a specified path, you cannot clear the backup file by setting
backup_dest_optionor back up the backup file.
Initiate a data backup by using SQL statements
Log on to the
systenant as therootuser.Execute the following statement to initiate a data backup task for the tenant.
Note
You can initiate a data backup for tenants only when log backup is enabled. For more information about how to enable log backup, see Initiate a log backup.
obclient>ALTER SYSTEM BACKUP TENANT tenant_name_list TO backup_destination;tenant_name_listspecifies the list of tenants whose snapshots are to be backed up.backup_destinationspecifies the destination of backup files. You can use Network File System (NFS), Object Storage Service (OSS), and Tencent Cloud Object Storage (COS) as the backup media.
For example:
obclient>ALTER SYSTEM BACKUP TENANT tenant1,tenant2 TO "file:///ob_backup/";After you initiate a backup, you can query the
oceanbase.CDB_OB_BACKUP_PROGRESSandoceanbase.CDB_OB_BACKUP_SET_DETAILSviews to check the backup progress. The method is the same as that for checking the progress of a full backup. For more information, see Check the backup progress.
Initiate an immediate backup in OCP
You can create a task in the OceanBase Cloud Platform (OCP) console to initiate a tenant-level immediate backup.
Log on to the OCP console.
In the left-side navigation pane, choose Backup & Recovery > Backup. Then, choose Back Up Now > Back Up Tenant in the upper-right corner of the page.
Select the tenant to be backed up.
Select the tenant to back up in the drop-down list and specify the storage configuration.
Click Test to test the storage configuration.
Click Back Up Now.