You can view the settings of archiving parameters during log archiving.
View the archiving parameter settings of tenants from the sys tenant
Log in to the
systenant of the cluster as therootuser.View the archiving parameter settings of tenants. Here are some examples:
View the settings of the
LOG_ARCHIVE_DESTparameter of all tenants.You can query the
CDB_OB_ARCHIVE_DESTview from thesystenant for the settings of theLOG_ARCHIVE_DESTparameter of all tenants in the cluster.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 | ENABLE | | 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 | | 1004 | 0 | piece_switch_interval | 1d | | 1004 | 0 | state | ENABLE | +-----------+---------+-----------------------+-------------------------------------------------------------------------------------------------------------------------+ 10 rows in setIn the preceding example, the current cluster contains two tenants with the tenant IDs
1002and1004, and theLOG_ARCHIVE_DESTparameter is configured for the tenants.You can execute the following statement to configure the
LOG_ARCHIVE_DESTparameter for tenant1002:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=file:///data/nfs/backup/archive BINDING=Optional PIECE_SWITCH_INTERVAL=1d';The system assigns
1002todest_idand enables archiving for this path.You can execute the following statement to configure the
LOG_ARCHIVE_DESTparameter for tenant1004:obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=oss://oceanbase-test-bucket/backup/archive?host=xxx.aliyun-inc.com&access_id=xxx&access_key=xxx&delete_mode=tagging BINDING=Mandatory PIECE_SWITCH_INTERVAL=1d';The system assigns
1001todest_idand enables archiving for this path.View the concurrency of log archiving for a tenant.
The concurrency of log archiving for a tenant is controlled by the tenant-level parameter
log_archive_concurrency. The value range of the parameter is [0, 100], and the default value0indicates that the concurrency of log archiving is adaptive.obclient [(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 | 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 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 is the
rootuser in a MySQL tenant and theSYSuser in an Oracle tenant.View the archiving parameter settings of the current tenant. Here are some examples:
View the setting of the
LOG_ARCHIVE_DESTparameter of the current tenant.You can query the
oceanbase.DBA_OB_ARCHIVE_DESTview from a user tenant in MySQL mode or theSYS.DBA_OB_ARCHIVE_DESTview from a user tenant in Oracle mode for the setting of theLOG_ARCHIVE_DESTparameter of the current tenant.You can execute the following statement in a MySQL tenant to query its
LOG_ARCHIVE_DESTparameter:obclient [(none)]> 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 | file:///data/nfs/backup/archive | | 0 | piece_switch_interval | 1d | | 0 | state | ENABLE | +---------+-----------------------+---------------------------------+ 6 rows in setView the concurrency of log archiving for a tenant.
The concurrency of log archiving for a tenant is controlled by the tenant-level parameter
log_archive_concurrency. The value range of the parameter is [0, 100], and the default value0indicates that the concurrency of log archiving is adaptive.obclient [(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 | 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 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 Preparations.