Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The CDB_OB_LS_REPLICA_TASKS view displays the disaster recovery tasks at the replica level that are currently running. This view is supported only for system tenants.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID |
| LS_ID | bigint(20) | NO | Log stream ID |
| TASK_TYPE | varchar(64) | NO | Task type. Valid values include:
|
| TASK_ID | varchar(200) | NO | Task ID |
| TASK_STATUS | varchar(2048) | YES | Task status. Valid values include:
|
| PRIORITY | varchar(5) | NO | Task priority. Valid values include:
|
| TARGET_REPLICA_SVR_IP | varchar(46) | YES | IP address of the target replica server. |
| TARGET_REPLICA_SVR_PORT | bigint(20) | YES | Port number of the target replica server. |
| TARGET_PAXOS_REPLICA_NUMBER | bigint(20) | YES | Number of required Paxos replicas for the target log stream. |
| TARGET_REPLICA_TYPE | varchar(16) | YES | Type of the target replica. |
| SOURCE_REPLICA_SVR_IP | varchar(46) | YES | IP address of the source replica server. This field is invalid for tasks such as replica deletion and modification of the number of required Paxos replicas, and displays as NULL. |
| SOURCE_REPLICA_SVR_PORT | bigint(20) | YES | Port number of the source replica server. This field is invalid for tasks such as replica deletion and modification of the number of required Paxos replicas, and displays as 0. |
| SOURCE_PAXOS_REPLICA_NUMBER | bigint(20) | YES | Number of required Paxos replicas for the source log stream. |
| SOURCE_REPLICA_TYPE | varchar(16) | YES | Type of the source replica. This field is invalid for tasks such as replica deletion and modification of the number of required Paxos replicas, and displays as NULL. |
| DATA_SOURCE_SVR_IP | varchar(46) | YES | IP address of the data source
Note
|
| DATA_SOURCE_SVR_PORT | bigint(20) | YES | PORT of the data source
Note
|
| IS_MANUAL | varchar(6) | NO | Source of the disaster recovery task. Valid values include:
Note
|
| TASK_EXEC_SVR_IP | varchar(46) | YES | IP address of the task execution server. |
| TASK_EXEC_SVR_PORT | bigint(20) | YES | Port number of the task execution server. |
| CREATE_TIME | datetime | NO | Task creation time |
| START_TIME | datetime | NO | Task scheduling time |
| MODIFY_TIME | datetime | NO | Time when the task status was last updated |
| COMMENT | varchar(2048) | YES | Remarks about the reason for generating the task |
Sample query
The following example queries all disaster recovery tasks at the replica level that are currently running in all tenants.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_LS_REPLICA_TASKS;
The query result is as follows:
+-----------+-------+-------------+------------------------------------+-------------+----------+-----------------------+-------------------------+-----------------------------+---------------------+-----------------------+-------------------------+-----------------------------+---------------------+--------------------+----------------------+-----------+------------------+--------------------+---------------------+---------------------+---------------------+-----------------------+
| TENANT_ID | LS_ID | TASK_TYPE | TASK_ID | TASK_STATUS | PRIORITY | TARGET_REPLICA_SVR_IP | TARGET_REPLICA_SVR_PORT | TARGET_PAXOS_REPLICA_NUMBER | TARGET_REPLICA_TYPE | SOURCE_REPLICA_SVR_IP | SOURCE_REPLICA_SVR_PORT | SOURCE_PAXOS_REPLICA_NUMBER | SOURCE_REPLICA_TYPE | DATA_SOURCE_SVR_IP | DATA_SOURCE_SVR_PORT | IS_MANUAL | TASK_EXEC_SVR_IP | TASK_EXEC_SVR_PORT | CREATE_TIME | START_TIME | MODIFY_TIME | COMMENT |
+-----------+-------+-------------+------------------------------------+-------------+----------+-----------------------+-------------------------+-----------------------------+---------------------+-----------------------+-------------------------+-----------------------------+---------------------+--------------------+----------------------+-----------+------------------+--------------------+---------------------+---------------------+---------------------+-----------------------+
| 1 | 1 | ADD REPLICA | Y13CE64586BD4-000614A082B90C60-0-0 | INPROGRESS | HIGH | xx.xx.xx.xx | 5078 | 4 | FULL | xx.xx.xx.xx | 5070 | 4 | FULL | 0.0.0.0 | 0 | TRUE | xx.xx.xx.xx | 5078 | 2024-03-27 17:09:13 | 2024-03-27 17:09:13 | 2024-03-27 17:09:13 | add replica by manual |
+-----------+-------+-------------+------------------------------------+-------------+----------+-----------------------+-------------------------+-----------------------------+---------------------+-----------------------+-------------------------+-----------------------------+---------------------+--------------------+----------------------+-----------+------------------+--------------------+---------------------+---------------------+---------------------+-----------------------+
1 row in set