Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The V$OB_LOG_STAT view displays the Palf status of log streams. You can use this view to perform the following operations:
- Query whether a log stream has a leader.
- Query the member list (number of Paxos replicas) of a log stream.
- Query the replica synchronization status.
- Query the recyclable checkpoint of the logs of a log stream.
- Query the log consumption service scope of a log stream based on the log sequence number (LSN) or system change number (SCN).
- Query the access mode of Palf.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | NUMBER(38) | NO | The ID of the tenant. |
| LS_ID | NUMBER(38) | NO | The ID of the log stream. |
| SVR_IP | VARCHAR2(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | NUMBER(38) | NO | The port number of the OBServer node. |
| ROLE | VARCHAR2(32) | NO | The role of the replica. Valid values: LEADERFOLLOWER |
| PROPOSAL_ID | NUMBER(38) | NO | The proposal ID of Paxos. |
| CONFIG_VERSION | VARCHAR2(128) | NO | The version number corresponding to the configuration change, such as change of the member list, number of replicas, and access mode. |
| ACCESS_MODE | VARCHAR2(32) | NO | The access mode. Valid values: APPENDRAW_WRITE |
| PAXOS_MEMBER_LIST | VARCHAR2(1024) | NO | The list of Paxos members. |
| PAXOS_REPLICA_NUM | NUMBER(38) | NO | The number of Paxos replicas. |
| IN_SYNC | VARCHAR2(3) | NO | Indicates whether the replica is completely synchronized with the leader. |
| BASE_LSN | NUMBER(38) | NO | The maximum recyclable checkpoint. |
| BEGIN_LSN | NUMBER(38) | NO | The LSN of the minimum consumption checkpoint. |
| BEGIN_SCN | NUMBER(38) | NO | The SCN of the minimum consumption checkpoint. |
| END_LSN | NUMBER(38) | NO | The LSN of the maximum consecutive majority checkpoint, also known as the maximum consumption checkpoint. |
| END_SCN | NUMBER(38) | NO | The SCN of the maximum consecutive majority checkpoint, also known as the maximum consumption checkpoint. |
| MAX_LSN | NUMBER(38) | NO | The LSN of the maximum write point. |
| MAX_SCN | NUMBER(38) | NO | The SCN of the maximum write point. |
| ARBITRATION_MEMBER | VARCHAR2(128) | NO | The server address of the arbitration member.
NoteThis column is introduced since OceanBase Database V4.1.0. |
| DEGRADED_LIST | VARCHAR2(1024) | NO | The list of degraded full-featured replicas with arbitration enabled.
NoteThis column is introduced since OceanBase Database V4.1.0. |
| LEARNER_LIST | CLOB | NO | The list of read-only replicas in the current log stream.
NoteThis column is introduced since OceanBase Database V4.2.0. |
Sample query
Query the log stream replicas of a user tenant from the user tenant.
obclient [SYS]> SELECT * FROM SYS.V$OB_LOG_STAT\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1004
LS_ID: 1
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 1
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
PAXOS_MEMBER_LIST: 172.xx.xx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 67104768
BEGIN_LSN: 0
BEGIN_SCN: 2
END_LSN: 146437277
END_SCN: 1723169055695895001
MAX_LSN: 146437277
MAX_SCN: 1723169055695895001
ARBITRATION_MEMBER: NULL
DEGRADED_LIST: NULL
LEARNER_LIST: NULL
*************************** 2. row ***************************
TENANT_ID: 1004
LS_ID: 1001
SVR_IP: 172.xx.xx.xx
SVR_PORT: 2882
ROLE: LEADER
PROPOSAL_ID: 1
CONFIG_VERSION: {proposal_id:1, config_seq:2}
ACCESS_MODE: APPEND
PAXOS_MEMBER_LIST: 172.xx.xx.xx:2882:1
PAXOS_REPLICA_NUM: 1
IN_SYNC: YES
BASE_LSN: 67104768
BEGIN_LSN: 0
BEGIN_SCN: 1723084154840180002
END_LSN: 103629061
END_SCN: 1723169055695895001
MAX_LSN: 103629061
MAX_SCN: 1723169055695895001
ARBITRATION_MEMBER: NULL
DEGRADED_LIST: NULL
LEARNER_LIST: NULL
2 rows in set