After a backup operation is performed, you can view the parameters related to backup by checking the settings of the relevant parameters.
Procedure
Log in to the
systenant of the cluster as therootuser.Execute the following statements to query parameters related to backup:
Query the current number of worker threads for high availability tasks with low priority, such as backup and backup cleanup.
Here is the sample code:
obclient [(none)]> SHOW PARAMETERS LIKE '%ha_low_thread_score%'\GHere is the sample result:
*************************** 1. row *************************** zone: zone1 svr_type: observer svr_ip: 172.xx.xxx.xxx svr_port: 2882 name: ha_low_thread_score data_type: INT value: 0 info: the current work thread score of high availability low thread. Range: [0,100] in integer. Especially, 0 means default value section: OBSERVER scope: TENANT source: DEFAULT edit_level: DYNAMIC_EFFECTIVE default_value: 0 isdefault: 1 1 row in setThe tenant-level parameter
ha_low_thread_scorespecifies the current number of worker threads for high availability tasks with low priority, such as backup and backup cleanup. The default value is0. If you find that the data backup task is running too slowly, you can appropriately increase the value of theha_low_thread_scoreparameter. We recommend that you double the value each time. For more information about theha_low_thread_scoreparameter, see ha_low_thread_score.Here is the sample code for setting the number of concurrent writes to the file system when performing a backup:
obclient [(none)]> ALTER SYSTEM SET ha_low_thread_score = 4 TENANT = mysql_tenant;In this example, the value of the
ha_low_thread_scoreparameter is set to4, which specifies the number of worker threads for backup tasks in themysql_tenanttenant.Query the backup parameters of a tenant.
The
systenant can query the backup parameters configured for each tenant in the current cluster by using theoceanbase.CDB_OB_BACKUP_PARAMETERview. A user tenant can query the backup parameters configured for the tenant by using theoceanbase.DBA_OB_BACKUP_PARAMETERview in MySQL mode or theSYS.DBA_OB_BACKUP_PARAMETERview in Oracle mode.obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_PARAMETER\GHere is the sample result:
*************************** 1. row *************************** TENANT_ID: 1004 NAME: data_backup_dest VALUE: oss://oceanbase-test-bucket/backup/data/?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=delete&checksum_type=md5&enable_worm=true 1 row in setIn this example, the data backup path (
data_backup_dest) for the tenant withTENANT_IDof1004isoss://oceanbase-test-bucket/backup/?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx, and its backup file cleanup mode (delete_mode) isdelete. Thedelete_modeparameter can take the following two values:delete: Directly delete the eligible backup files when performing backup file cleanup.In this mode, when you clean up backup files, the system directly deletes the files that meet the cleanup criteria.
tagging: Set a tag for the eligible backup files when performing backup file cleanup. The files will still be retained.In this mode, the system tags the backup files that meet the specified requirements during backup file cleanup. The tag
keyisdelete_mode, and the tagvalueistagging. You can manage these backup files on Alibaba Cloud Object Storage Service (OSS), Tencent Cloud Object Storage (COS), or Amazon Simple Storage Service (S3) over their lifecycle by tag.
Additionally, in the parameters of the backup path for the tenant,
checksum_type=md5indicates that the MD5 algorithm is used to verify the integrity of backup files, andenable_worm=truespecifies that OceanBase Database performs write and delete operations on the path according to the WORM policy.View information related to the backup path of a tenant.
The
CDB_OB_BACKUP_STORAGE_INFOview records information about the backup or archive paths for all tenants.obclient [oceanbase]> SELECT PATH, DEST_TYPE, EXTENSION FROM oceanbase.CDB_OB_BACKUP_STORAGE_INFO WHERE DEST_TYPE='backup_data';An example of the query result is as follows:
+-----------+---------------------------------------------+-------------+------------------------------------+ | TENANT_ID | PATH | DEST_TYPE | EXTENSION | +-----------+---------------------------------------------+-------------+------------------------------------+ | 1004 | oss://oceanbase-test-bucket/backup/data | backup_data | checksum_type=md5&enable_worm=true | +-----------+---------------------------------------------+-------------+------------------------------------+ 1 row in setIn the query result, for the tenant with ID
1004, the backup path isoss://oceanbase-test-bucket/backup/data. Thechecksum_type=md5indicates that the MD5 algorithm is used to verify the integrity of backup files, andenable_worm=truespecifies that OceanBase Database performs write and delete operations on the path according to the WORM policy.