During log archiving, you can view archive-related parameter settings.
View tenant archive parameters as the sys tenant
Log in to the
systenant of the cluster as therootuser.Run the following statements to view archive-related parameters of tenants.
View log archive parameter information of all tenants (excluding source-side configuration information).
The
CDB_OB_ARCHIVE_DESTview records the log archive parameters configured for all tenants.obclient [(none)]> 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 | file:///data/nfs/backuparchive | | 1002 | 0 | piece_switch_interval | 1d | | 1002 | 0 | state | ENBALE | | 1004 | 0 | binding | Mandatory | | 1004 | 0 | dest_id | 1001 | | 1004 | 0 | path | oss://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 example query result, two tenants with tenant IDs
1002and1004in the current cluster have archive parameters configured.For the tenant with tenant ID
1002, the archive path for log archiving isfile:///data/nfs/backuparchive. The value ofbindingisOPTIONAL, which means the priority mode between archiving and business operations isOptionalmode and business operations take priority. The value ofpiece_switch_intervalis1d, which means a log piece is switched every day during log archiving. The value ofstateisENABLE, which means this archive destination is enabled.For the tenant with tenant ID
1004, the archive path and related path parameters for log archiving areoss://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. The value ofbindingisMandatory, which means the priority mode between archiving and business operations isMandatorymode and archiving takes priority. The value ofpiece_switch_intervalis1d, which means a log piece is switched every day during log archiving. The value ofstateisENABLE, which means this archive destination is enabled.For more information about the
CDB_OB_ARCHIVE_DESTview, see CDB_OB_ARCHIVE_DEST.View archive path information of all tenants for log archiving (including source-side configuration information).
The
CDB_OB_BACKUP_STORAGE_INFOview records the backup or archive path configuration information of all tenants.obclient [(none)]> SELECT TENANT_ID, PATH, DEST_TYPE, EXTENSION FROM oceanbase.CDB_OB_BACKUP_STORAGE_INFO WHERE DEST_TYPE='archive_log';Example query result:
+-----------+---------------------------------------------+-------------+-----------------------------------------------+ | TENANT_ID | PATH | DEST_TYPE | EXTENSION | +-----------+---------------------------------------------+-------------+-----------------------------------------------+ | 1004 | oss://oceanbase-test-bucket/backup/archive | archive_log | checksum_type=md5&enable_worm=true&zone=zone1 | +-----------+---------------------------------------------+-------------+-----------------------------------------------+ 1 row in setIn the query result, for the tenant with tenant ID
1004, the archive path isoss://oceanbase-test-bucket/backup/archive.enable_worm=truemeans that OceanBase Database performs write and delete operations on this path according to WORM rules.checksum_type=md5means that the MD5 algorithm is used to verify the integrity of archive files. The source-side configurationzone=zone1means that only nodes inzone1can access this path.View log archiving concurrency of tenants.
Log archiving concurrency is controlled by the tenant-level parameter
log_archive_concurrency. The value range is [0, 100]. The default value is0, which means the adaptive log archiving concurrency of OceanBase Database is used. For more information about thelog_archive_concurrencyparameter, see log_archive_concurrency.obclient [(none)]> SHOW PARAMETERS LIKE 'log_archive_concurrency';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 | NULL | 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 archive parameters of the current tenant as a user tenant
Log in to the database as the tenant administrator.
Note
The administrator user of a MySQL-compatible tenant is
root. The administrator user of an Oracle-compatible tenant isSYS.Run the following statements to view archive-related parameters of the current tenant.
View log archive parameter information of the current tenant (excluding source-side configuration information).
A user tenant can use the
oceanbase.DBA_OB_ARCHIVE_DESTview (MySQL-compatible mode) or theSYS.DBA_OB_ARCHIVE_DESTview (Oracle-compatible mode) to view archive parameters of the current tenant.MySQL-compatible modeOracle-compatible modeobclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_ARCHIVE_DEST;obclient [SYS]> SELECT * FROM SYS.DBA_OB_ARCHIVE_DEST;The query result is as follows:
+---------+-----------------------+---------------------------------+ | DEST_NO | NAME | VALUE | +---------+-----------------------+---------------------------------+ | 0 | binding | OPTIONAL | | 0 | dest_id | 1002 | | 0 | path | file:///data/nfs/backup/archive | | 0 | piece_switch_interval | 1d | | 0 | state | ENBALE | +---------+-----------------------+---------------------------------+ 6 rows in setView archive path information of the current tenant for log archiving (including source-side configuration information).
A user tenant can use the
oceanbase.DBA_OB_BACKUP_STORAGE_INFOview (MySQL-compatible mode) or theSYS.DBA_OB_BACKUP_STORAGE_INFOview (Oracle-compatible mode) to view source-side configuration information of the log archive path of the current tenant.MySQL-compatible modeOracle-compatible modeobclient [oceanbase]> SELECT PATH, DEST_TYPE, EXTENSION FROM oceanbase.DBA_OB_BACKUP_STORAGE_INFO WHERE DEST_TYPE='archive_log';obclient [SYS]> SELECT PATH, DEST_TYPE, EXTENSION FROM SYS.DBA_OB_BACKUP_STORAGE_INFO WHERE DEST_TYPE='archive_log';Example query result:
+--------------------------------------------+-------------+------------------------------+ | PATH | DEST_TYPE | EXTENSION | +--------------------------------------------+-------------+------------------------------+ | oss://oceanbase-test-bucket/backup/archive | archive_log | checksum_type=md5&zone=zone1 | +--------------------------------------------+-------------+------------------------------+ 1 row in setView log archiving concurrency of the tenant.
Log archiving concurrency is controlled by the tenant-level parameter
log_archive_concurrency. The value range is [0, 100]. The default value is0, which means the adaptive log archiving concurrency of OceanBase Database is used. For more information about thelog_archive_concurrencyparameter, see log_archive_concurrency.obclient [(none)]> SHOW PARAMETERS LIKE 'log_archive_concurrency';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 | NULL | 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 information about how to set archive parameters, see Prepare for log archiving.
