首批通过分布式安全可靠测评,为关键业务系统打造
查看归档参数
更新时间:2024-08-09 17:50:46
日志归档过程中,您可以查看归档相关的参数配置信息。
系统租户查看租户的归档参数
使用
root用户登录集群的sys租户。执行以下语句,查看租户归档相关的参数。
查看所有租户的
LOG_ARCHIVE_DEST参数sys租户可以通过CDB_OB_ARCHIVE_DEST视图查看集群中所有租户的LOG_ARCHIVE_DEST参数的配置信息。obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_ARCHIVE_DEST;查询结果如下:
+-----------+---------+-----------------------+-------------------------------------------------------------------------------------------------------------------------+ | 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上面的示例中, 当前集群中有租户 ID 为
1002和1004的 2 个租户配置了LOG_ARCHIVE_DEST参数。1002租户LOG_ARCHIVE_DEST参数配置的命令如下:obclient [(none)]> ALTER SYSTEM SET LOG_ARCHIVE_DEST = 'LOCATION=file:///data/nfs/backup/archive BINDING=Optional PIECE_SWITCH_INTERVAL=1d';配置成功后,系统为该路径分配的
dest_id是1002,并且该路径的归档已经打开。1004租户LOG_ARCHIVE_DEST参数配置的命令如下:obclient [(none)]> 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';配置成功后,系统为该路径分配的
dest_id是1001,且该路径的归档也已经打开。更多
CDB_OB_ARCHIVE_DEST视图的说明,请参见 CDB_OB_ARCHIVE_DEST。查看租户的日志归档并行度
租户的日志归档并行度由租户级配置项
log_archive_concurrency控制,该配置项的取值范围为 [0, 100],默认值为0,表示使用 OceanBase 数据库自适应的日志归档并行度。有关配置项log_archive_concurrency的详细说明,请参见 log_archive_concurrency。obclient [(none)]> SHOW PARAMETERS LIKE 'log_archive_concurrency';查询结果的示例如下:
+-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+ | 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
用户租户查看本租户的归档参数
用户租户可以通过 oceanbase.DBA_OB_ARCHIVE_DEST 视图(MySQL 模式)和 sys.DBA_OB_ARCHIVE_DEST 视图(Oracle 模式)查看本租户的归档参数。
租户管理员登录到数据库。
说明
MySQL 租户的管理员用户为
root用户,Oracle 租户的管理员用户为SYS用户。执行以下语句,查看当前租户归档相关的参数。
查看本租户的
LOG_ARCHIVE_DEST参数用户租户可以通过
oceanbase.DBA_OB_ARCHIVE_DEST视图(MySQL 模式)和SYS.DBA_OB_ARCHIVE_DEST视图(Oracle 模式)查看本租户LOG_ARCHIVE_DEST参数的配置信息。MySQL 租户查看本租户的
LOG_ARCHIVE_DEST参数的示例如下:obclient [(none)]> SELECT * FROM oceanbase.DBA_OB_ARCHIVE_DEST;查询结果如下:
+---------+-----------------------+---------------------------------+ | 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查看租户的日志归档并行度
租户的日志归档并行度由租户级配置项
log_archive_concurrency控制,该配置项的取值范围为 [0, 100],默认值为0,表示使用 OceanBase 数据库自适应的日志归档并行度。有关配置项log_archive_concurrency的详细说明,请参见 log_archive_concurrency。obclient [(none)]> SHOW PARAMETERS LIKE 'log_archive_concurrency';查询结果的示例如下:
+-------+----------+----------------+----------+-------------------------+-----------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+--------+---------+-------------------+ | 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
相关文档
关于归档参数的设置,请参见 准备工作。