During log archiving, you can view the settings of archiving parameters.
View the archiving parameter settings of tenants from the sys tenant
Log on to the
systenant of the cluster as therootuser.Execute the following statements to view the archiving parameter settings of tenants.
View the settings of the
LOG_ARCHIVE_DESTparameter of all tenants.You can query the
CDB_OB_ARCHIVE_DESTview from thesysfor 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 | 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 | | 1004 | 0 | piece_switch_interval | 1d | | 1004 | 0 | state | ENBALE | +-----------+---------+-----------------------+-------------------------------------------------------------------------------------------------------------------------+ 10 rows in setIn the preceding example, the current cluster contains two tenants with the tenant IDs
1002and1004, for which theLOG_ARCHIVE_DESTparameter is configured.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.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.For more information about the
CDB_OB_ARCHIVE_DESTview, see CDB_OB_ARCHIVE_DEST.View the concurrency of log archiving of a tenant.
The concurrency of log archiving of a tenant is controlled by the tenant-level parameter
log_archive_concurrency. The value range of the parameter is [0, 100], and the default value is0, which indicates that the concurrency of log archiving is adaptive. 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 | 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 on to the database as a tenant administrator.
Note
The administrator user of a MySQL tenant is
rootand that of an Oracle tenant isSYS.Execute the following statements to view the archiving parameters of the current tenant:
View the
LOG_ARCHIVE_DESTparameter of the current tenant.You can query the
oceanbase.DBA_OB_ARCHIVE_DESTview from a MySQL tenant or thesys.DBA_OB_ARCHIVE_DESTview from an Oracle tenant for the setting of theLOG_ARCHIVE_DESTparameter for the current tenant.To view the setting of the
LOG_ARCHIVE_DESTparameter of a MySQL tenant, execute the following statement: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 | ENBALE | +---------+-----------------------+---------------------------------+ 6 rows in setView the concurrency of log archiving of a tenant.
The concurrency of log archiving of a tenant is controlled by the tenant-level parameter
log_archive_concurrency. The value range of the parameter is [0, 100], and the default value is0, which indicates that the concurrency of log archiving is adaptive. 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 | 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 Preparations.