This article is applicable to the scenario of independent deployment of obdiag. It can display the merge status, progress, diagnostic information and suggestions of the OceanBase database with one click.
Description
This scenario only supports OceanBase database V4.0.0.0 and above.
Instructions for use
obdiag display scene run --scene=observer.compaction [options]
The options are explained below:
Option name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| -c | No | string | ~/.obdiag/config.yml |
Configuration file path. |
| --inner_config | No | string | Default is empty | obdiag's own configuration. |
| --config | No | string | Default is empty | Configuration of the cluster to be diagnosed by obdiag, fixed style: --config key1=value1 --config key2=value2.
ExplanationParameters that support configuration through this option can be found in obdiag configuration. |
| --config_password | No | string | Default is empty | obdiag When using an encrypted configuration file, you need to pass in the corresponding password through this option.
ExplanationFor details, please see Configuration file encryption. |
Usage example
Method 1: Use without configuration file (out of the box)
obdiag display scene run --scene=observer.compaction \
--config db_host=xx.xx.xx.xx \
--config db_port=xxxx \
--config tenant_sys.user=root@sys \
--config tenant_sys.password=***
Method 2: Use with configuration file
You need to ensure that the login information of the node to be collected has been configured in the obdiag configuration file config.yml. For related detailed configuration introduction, see obdiag configuration.
obdiag display scene run --scene=observer.compaction
Display content
This scenario will display the following four types of merger-related information.
Major Compaction Status
Displays the Major Compaction status of all tenants. The data comes from the CDB_OB_MAJOR_COMPACTION view, including the following information:
TENANT_ID: Tenant IDFROZEN_SCN: frozen version numberGLOBAL_BROADCAST_SCN: Global broadcast version numberLAST_SCN: The version number of the last completed mergeLAST_FINISH_TIME: Last merge completion timeSTART_TIME: the start time of this mergerSTATUS: merge statusIS_ERROR: whether an error occurredIS_SUSPENDED: whether to suspendINFO: additional information
Merge progress
Shows the progress of the ongoing merger. The data comes from the GV$OB_COMPACTION_PROGRESS view, including the following information:
TENANT_ID: Tenant IDSVR_IP: Server IPSVR_PORT: server portZONE: Zone nameCOMPACTION_SCN: merge version numberSTATUS: statusTOTAL_TABLET_COUNT: Total number of TabletsUNFINISHED_TABLET_COUNT: Number of unfinished TabletsDATA_SIZE_GB: Total data size (GB)UNFINISHED_DATA_SIZE_GB: Unfinished data size (GB)START_TIME: start timeESTIMATED_FINISH_TIME: estimated completion time
Merge diagnostic information
Displays the diagnostic information of failed or running merge tasks. The data comes from the __all_virtual_compaction_diagnose_info view and contains the following information:
tenant_id: tenant IDsvr_ip: server IPsvr_port: server portls_id: Log stream IDtablet_id: Tablet IDtype: typestatus: statuscreate_time: Creation timediagnose_info: diagnostic information
Merge suggestions
Displays the merger optimization suggestions given by the system. The data comes from the GV$OB_COMPACTION_SUGGESTIONS view, which contains the following information:
TENANT_ID: Tenant IDSVR_IP: Server IPSVR_PORT: server portTYPE: typeLS_ID: Log stream IDTABLET_ID: Tablet IDSTART_TIME: start timeFINISH_TIME: completion timeSUGGESTION: Suggested content
