View the archiving parameter settings

2023-12-25 08:49:40  Updated

You can view the settings of archiving parameters during log archiving.

View the archiving parameter settings of tenants from the sys tenant

  1. Log on to the sys tenant of the cluster as the root user.

  2. Execute the following statements to view the archiving parameter settings of tenants.

    • View the settings of the LOG_ARCHIVE_DEST parameter of all tenants.

      You can query the CDB_OB_ARCHIVE_DEST view from the sys for the settings of the LOG_ARCHIVE_DEST parameter 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 set
      

      In the preceding example, the current cluster contains two tenants with the tenant IDs 1002 and 1004, for which the LOG_ARCHIVE_DEST parameter is configured.

      Execute the following statement to configure the LOG_ARCHIVE_DEST parameter for tenant 1002:

      obclient> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=file:///data/nfs/backup/archive BINDING=Optional PIECE_SWITCH_INTERVAL=1d';
      

      The system assigns 1002 to dest_id and enables archiving for this path.

      Execute the following statement to configure the LOG_ARCHIVE_DEST parameter for tenant 1004:

      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 1001 to dest_id and enables archiving for this path.

      For more information about the CDB_OB_ARCHIVE_DEST view, 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 is 0, which indicates that the concurrency of log archiving is adaptive. For more information about the log_archive_concurrency parameter, see log_archive_concurrency.

      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        |
      +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+
      | zone1 | observer | xxx.xx.xxx.198 |     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 |
      | zone3 | observer | xxx.xx.xxx.197 |     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 |
      | zone2 | observer | xxx.xx.xxx.196 |     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 |
      | zone2 | observer | xxx.xx.xxx.192 |     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 |
      | zone1 | observer | xxx.xx.xxx.194 |     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 |
      +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+
      5 rows in set
      

View the archiving parameter settings of a user tenant

  1. Log on to the database as a tenant administrator.

    Note

    The administrator user of a MySQL tenant is root and that of an Oracle tenant is SYS.

  2. Execute the following statements to view the archiving parameters of the current tenant:

    • View the LOG_ARCHIVE_DEST parameter of the current tenant.

      You can query the oceanbase.DBA_OB_ARCHIVE_DEST view from a MySQL tenant or the sys.DBA_OB_ARCHIVE_DEST view from an Oracle tenant for the setting of the LOG_ARCHIVE_DEST parameter for the current tenant.

      To view the setting of the LOG_ARCHIVE_DEST parameter 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 set
      
    • 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 is 0, which indicates that the concurrency of log archiving is adaptive. For more information about the log_archive_concurrency parameter, see log_archive_concurrency.

      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        |
      +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+
      | zone1 | observer | xxx.xx.xxx.198 |     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 |
      | zone2 | observer | xxx.xx.xxx.196 |     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 |
      | zone3 | observer | xxx.xx.xxx.197 |     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 |
      | zone1 | observer | xxx.xx.xxx.194 |     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 |
      +-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+
      4 rows in set
      

References

For more information about how to set the archiving parameters, see Preparations.

Contact Us