An incremental data backup job backs up all macroblocks modified since the last full backup or incremental data backup. For example, when the system initiates an incremental data backup job for a tenant, if a full backup was performed in the last data backup job and a full backup file named full_backup_set was generated, the system will back up all macroblocks modified since the generation of full_backup_set, and if an incremental backup was performed in the last data backup job and an incremental backup file named inc_backup_set was generated, the system will back up all macroblocks modified since the generation of inc_backup_set.
Limitations and considerations
To perform an incremental data backup, make sure that a full data backup exists. If an incremental backup is initiated without a full data backup, the system will automatically convert the incremental backup to a full backup.
For scenarios where a cluster of a low version is upgraded to a high version, even if the current tenant has performed a full backup in the low version, when upgrading to the high version, if an incremental backup is directly initiated, the system will automatically convert the incremental backup to a full backup.
Procedure
After you complete the preparations, you can perform the following steps to initiate an incremental data backup job.
Assume that the current cluster contains three tenants: sys, mysql_tenant, and oracle_tenant.
Initiate an incremental data backup job from the sys tenant
You can initiate an incremental data backup job for all tenants or a specified tenant in the cluster from the sys tenant.
Log on to the
systenant of the cluster as therootuser.(Optional) Set the backup concurrency for the tenant.
You can configure the backup concurrency by setting the tenant-level parameter
ha_low_thread_score, which specifies the weight of worker threads for job queues with a low or medium priority, such as backup job queues and backup cleanup job queues. The value range is [0, 100]. The default value is0. Before you start the backup job, you can increase the value ofha_low_thread_score. We recommend that you double the value each time. For more information about the operations related to theha_low_thread_scoreparameter, see View data backup parameter settings.For more information about the
ha_low_thread_scoreparameter, see ha_low_thread_score.Set the backup concurrency for all tenants in the cluster
obclient [(none)]> ALTER SYSTEM SET ha_low_thread_score = 10 TENANT = all_user;or
obclient [(none)]> ALTER SYSTEM SET ha_low_thread_score = 10 TENANT = all;Note
In OceanBase Database V4.2.1 and later,
TENANT = all_userandTENANT = allexpress the same semantics. If you want an operation to take effect on all user tenants, we recommend that you useTENANT = all_user.TENANT = allwill be deprecated.Set the backup concurrency for a specified tenant in the cluster
obclient [(none)]> ALTER SYSTEM SET ha_low_thread_score = 10 TENANT = mysql_tenant;
Execute the following statement to initiate an incremental data backup job.
Initiate an incremental data backup job for all tenants in the cluster
Execute the following statement to initiate an incremental data backup job for all tenants in the cluster.
obclient [(none)]> ALTER SYSTEM BACKUP INCREMENTAL DATABASE;After the statement is executed, the system initiates an incremental data backup job for the
mysql_tenantandoracle_tenanttenants in the cluster.Initiate an incremental data backup job for a specified tenant in the cluster
You can initiate an incremental data backup job for a specified tenant without affecting other tenants in the cluster.
To initiate an incremental data backup job for the
mysql_tenanttenant, execute the following statement:obclient [(none)]> ALTER SYSTEM BACKUP INCREMENTAL TENANT = mysql_tenant;Note
If you specify multiple tenants, separate the tenant names with commas (,).
After the statement is executed, the system initiates an incremental data backup job for the
mysql_tenanttenant.
You can view the backup progress in real time. For more information, see View the data backup progress.
Initiate an incremental data backup job for a user tenant
You can initiate an incremental data backup job for a user tenant without affecting other tenants.
Log on to the database as a tenant administrator.
In this example, you can log on to the
mysql_tenanttenant as therootuser, or to theoracle_tenanttenant as theSYSuser.(Optional) Set the backup concurrency.
You can configure the backup concurrency by setting the tenant-level parameter
ha_low_thread_score, which specifies the weight of worker threads for job queues with a low or medium priority, such as backup job queues and backup cleanup job queues. The value range is [0, 100]. The default value is0. Before you start the backup job, you can increase the value ofha_low_thread_score. We recommend that you double the value each time. For more information about the operations related to theha_low_thread_scoreparameter, see View data backup parameter settings.For more information about the
ha_low_thread_scoreparameter, see ha_low_thread_score.obclient [(none)]> ALTER SYSTEM SET ha_low_thread_score = 10;Execute the following statement to initiate an incremental data backup job:
obclient [(none)]> ALTER SYSTEM BACKUP INCREMENTAL DATABASE;After the statement is executed, the system initiates an incremental data backup job for the current tenant.
You can view the backup progress in real time. For more information, see View the data backup progress.