During log archiving, you can view the settings of archiving parameters.
View the archiving parameter settings of tenants from the sys tenant
Log in to the
systenant of the cluster as therootuser.Execute the following statements to view the archiving parameter settings of tenants.
View the archive parameter information for the log archive configuration of all tenants.
The
CDB_OB_ARCHIVE_DESTview records the archive parameter information configured for the log archives of all tenants.obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_ARCHIVE_DEST;The query result is as follows:
+-----------+---------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | TENANT_ID | DEST_NO | NAME | VALUE | +-----------+---------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 1002 | 0 | binding | OPTIONAL | | 1002 | 0 | dest_id | 1002 | | 1002 | 0 | path | s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com&access_id=xxx&access_key=xxx&delete_mode=tagging&checksum_type=md5&enable_worm=true | | 1002 | 0 | piece_switch_interval | 1d | | 1002 | 0 | state | ENBALE | | 1004 | 0 | binding | Mandatory | | 1004 | 0 | dest_id | 1001 | | 1004 | 0 | path | s3://oceanbase-test-bucket/backup/archive?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=tagging&checksum_type=md5&enable_worm=true | | 1004 | 0 | piece_switch_interval | 1d | | 1004 | 0 | state | ENBALE | +-----------+---------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ 10 rows in setIn the query example, there are two tenants with the IDs
1002and1004that have configured archive parameters in the current cluster.For the tenant with ID
1002, the archive path for log archiving iss3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com&access_id=xxx&access_key=xxx&delete_mode=tagging. The value ofbindingisOPTIONAL, which indicates that the priority mode between archiving and business operations is set to theOptionalmode, meaning user business operations take priority. Thepiece_switch_intervalis set to1d, meaning a log piece is split every day during log archiving. ThestateisENABLE, indicating that this archive destination is enabled.For the tenant with ID
1004, the archive path and related parameters for log archiving ares3://oceanbase-test-bucket/backup/archive?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=tagging. The value ofbindingisMandatory, which indicates that the priority mode between archiving and business operations is set to theMandatorymode, meaning archiving takes priority. Thepiece_switch_intervalis set to1d, meaning a log piece is split every day during log archiving. ThestateisENABLE, indicating that this archive destination is enabled.For more information about the
CDB_OB_ARCHIVE_DESTview, see CDB_OB_ARCHIVE_DEST.View the archive path-related information for log archiving of all tenants.
The
CDB_OB_BACKUP_STORAGE_INFOview records the configuration information of backup or archive paths for all tenants.obclient(root@sys)[oceanbase]> SELECT TENANT_ID, PATH, DEST_TYPE, EXTENSION, MAX_IOPS, MAX_BANDWIDTH, MAX_BANDWIDTH_DISPLAY FROM oceanbase.CDB_OB_BACKUP_STORAGE_INFO WHERE DEST_TYPE='archive_log';A sample query result is as follows:
+-----------+---------------------------------------------+-------------+-----------------------------------------------+----------+---------------+-----------------------+ | TENANT_ID | PATH | DEST_TYPE | EXTENSION | MAX_IOPS | MAX_BANDWIDTH | MAX_BANDWIDTH_DISPLAY | +-----------+---------------------------------------------+-------------+-----------------------------------------------+----------+---------------+-----------------------+ | 1004 | S3://oceanbase-test-bucket/backup/archive | archive_log | checksum_type=md5&enable_worm=true&zone=zone1 | 1000 | 0 | UNLIMITED | +-----------+---------------------------------------------+-------------+-----------------------------------------------+----------+---------------+-----------------------+ 1 row in setIn the query result, for the tenant with ID
1004, the archive path isS3://oceanbase-test-bucket/backup/archive. The parameterenable_worm=trueindicates that OceanBase AI Database performs write and delete operations on this path according to WORM (Write Once Read Many) specifications. The parameterchecksum_type=md5indicates that the MD5 algorithm is used to verify the integrity of the archive files. The source-side configurationzone=zone1indicates that only nodes inzone1can access this path. For I/O throttling,MAX_IOPSis1000, meaning the current archive path allows at most approximately 1000 I/O requests per second.MAX_BANDWIDTH_DISPLAYisUNLIMITED, indicating no bandwidth limit.View the log archiving concurrency of a tenant.
The log archiving concurrency of a tenant is controlled by the tenant-level configuration item
log_archive_concurrency. The value range for this configuration item is [0, 100], and the default value is0, which means OceanBase AI Database uses an adaptive log archiving concurrency. For more information about thelog_archive_concurrencyconfiguration item, see log_archive_concurrency.obclient(root@sys)[(none)]> SHOW PARAMETERS LIKE 'log_archive_concurrency';A sample query result is as follows:
+-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+---------------+-----------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | default_value | isdefault | +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+---------------+-----------+ | zone1 | observer | 172.xx.xxx.xxx | 2882 | log_archive_concurrency | INT | 0 | log archive concurrency, for both archive fetcher and sender. If the value is default 0, the database will automatically calculate the number of archive worker threads based on the tenant specification, which is tenant max_cpu divided by 4; otherwise set the the worker count equals to the value.Range: [0, 100] in integer | LOGSERVICE | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | 0 | 1 | +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+---------------+-----------+ 1 row in set
View the archiving parameter settings of a user tenant
Log in to the database as a tenant administrator.
Note
The administrator user of a user tenant is the
rootuser.Execute the following statements to view the archiving parameter settings of the current tenant.
View the archive parameter information of the log archive configuration for the current tenant.
You can query the
oceanbase.DBA_OB_ARCHIVE_DESTview to view the archive parameter information configured for the current tenant.obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_ARCHIVE_DEST;The query result is as follows:
+---------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | DEST_NO | NAME | VALUE | +---------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 0 | binding | OPTIONAL | | 0 | dest_id | 1002 | | 0 | path | s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com&access_id=xxx&access_key=xxx&delete_mode=tagging&checksum_type=md5&enable_worm=true | | 0 | piece_switch_interval | 1d | | 0 | state | ENBALE | +---------+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ 6 rows in setView the related information of the archive path for log archiving of the current tenant.
You can query the
oceanbase.DBA_OB_BACKUP_STORAGE_INFOview to view the configuration information of the archive path for the current tenant.obclient(root@mysql001)[oceanbase]> SELECT PATH, DEST_TYPE, EXTENSION, MAX_IOPS, MAX_BANDWIDTH, MAX_BANDWIDTH_DISPLAY FROM oceanbase.DBA_OB_BACKUP_STORAGE_INFO WHERE DEST_TYPE='archive_log';An example of the query result is as follows:
+--------------------------------------------+-------------+------------------------------+----------+---------------+-----------------------+ | PATH | DEST_TYPE | EXTENSION | MAX_IOPS | MAX_BANDWIDTH | MAX_BANDWIDTH_DISPLAY | +--------------------------------------------+-------------+------------------------------+----------+---------------+-----------------------+ | S3://oceanbase-test-bucket/backup/archive | archive_log | checksum_type=md5&zone=zone1 | 1000 | 0 | UNLIMITED | +--------------------------------------------+-------------+------------------------------+----------+---------------+-----------------------+ 1 row in setView the log archiving concurrency of the tenant.
The log archiving concurrency of a tenant is controlled by the tenant-level configuration item
log_archive_concurrency. The value range for this configuration item is [0, 100], and the default value is0, which means OceanBase AI Database uses an adaptive log archiving concurrency. For more information about thelog_archive_concurrencyconfiguration item, see log_archive_concurrency.obclient(root@mysql001)[(none)]> SHOW PARAMETERS LIKE 'log_archive_concurrency';An example of the query result is as follows:
+-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+---------------+-----------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | default_value | isdefault | +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+---------------+-----------+ | zone1 | observer | 172.xx.xxx.xxx | 2882 | log_archive_concurrency | INT | 0 | log archive concurrency, for both archive fetcher and sender. If the value is default 0, the database will automatically calculate the number of archive worker threads based on the tenant specification, which is tenant max_cpu divided by 4; otherwise set the the worker count equals to the value.Range: [0, 100] in integer | LOGSERVICE | TENANT | DEFAULT | DYNAMIC_EFFECTIVE | 0 | 1 | +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+---------------+-----------+ 1 row in set
References
For more information about how to set the archiving parameters, see Prepare for log archiving.