WR periodically collects data from performance views and persists and displays the collected information, including ASH, statistics, wait events, and SQL execution details.
View historical session data
Query the
oceanbase.CDB_WR_ACTIVE_SESSION_HISTORYview for persistent ASH data of all tenants.obclient [oceanbase]> SELECT * FROM oceanbase.CDB_WR_ACTIVE_SESSION_HISTORY limit 1\GThe query result is as follows:
*************************** 1. row *************************** CLUSTER_ID: 10001 TENANT_ID: 1 SNAP_ID: 1 SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 SAMPLE_ID: 10 SESSION_ID: 4611686018427389188 SAMPLE_TIME: 2026-03-16 16:30:16.853022 USER_ID: 200001 SESSION_TYPE: 1 SESSION_STATE: ON CPU SQL_ID: F9C0A3AB0A89EA2048B7A9F436596C68 TRACE_ID: xxxxxxxxx-xxxxxxxxx-0-0 EVENT_NO: 0 EVENT_ID: NULL TIME_WAITED: 0 P1: 0 P2: 0 P3: 0 SQL_PLAN_LINE_ID: 1 GROUP_ID: 0 PLAN_HASH: 3290318591324336132 THREAD_ID: 111169 STMT_TYPE: 2 TX_ID: 27 BLOCKING_SESSION_ID: NULL TIME_MODEL: 0 IN_PARSE: N IN_PL_PARSE: N IN_PLAN_CACHE: N IN_SQL_OPTIMIZE: N IN_SQL_EXECUTION: N IN_PX_EXECUTION: N IN_SEQUENCE_LOAD: N IN_COMMITTING: N IN_STORAGE_READ: N IN_STORAGE_WRITE: N IN_REMOTE_DAS_EXECUTION: N IN_PLSQL_COMPILATION: N IN_PLSQL_EXECUTION: N IN_FILTER_ROWS: N IN_RPC_ENCODE: N IN_RPC_DECODE: N IN_CONNECTION_MGR: N PROGRAM: T1_RPC_REQUEST MODULE: LOCAL INNER SQL EXEC ACTION: NULL_INNER_SQL CLIENT_ID: NULL BACKTRACE: NULL PLAN_ID: 289 TM_DELTA_TIME: 37301 TM_DELTA_CPU_TIME: 36278 TM_DELTA_DB_TIME: 36295 TOP_LEVEL_SQL_ID: NULL PLSQL_ENTRY_OBJECT_ID: NULL PLSQL_ENTRY_SUBPROGRAM_ID: NULL PLSQL_ENTRY_SUBPROGRAM_NAME: NULL PLSQL_OBJECT_ID: NULL PLSQL_SUBPROGRAM_ID: NULL PLSQL_SUBPROGRAM_NAME: NULL DELTA_READ_IO_REQUESTS: 0 DELTA_READ_IO_BYTES: 0 DELTA_WRITE_IO_REQUESTS: 0 DELTA_WRITE_IO_BYTES: 0 TABLET_ID: NULL PROXY_SID: 4611686018427389188 WEIGHT: 1The following table describes the fields.
FieldDescriptionCLUSTER_ID The cluster ID. TENANT_ID The tenant ID. SNAP_ID The snapshot ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. SAMPLE_ID The sample ID. SESSION_ID The ID of the sampled session. SAMPLE_TIME The sampling time. USER_ID The user ID of the sampled session. SESSION_TYPE The session type. - N: FOREGROUND indicates a foreground session, that is, a user session.
- Y: BACKGROUND indicates a background session.
SESSION_STATE The state of the session at the time of sampling. EVENT_NO == 0: "ON CPU" indicates no wait and SQL logic is being executed.EVENT_NO ≠ 0: "WAITING" indicates a wait is in progress. For details, refer to the EVENT column.
SQL_ID The SQL ID. TRACE_ID TRACE_ID EVENT_NO The internal number of the waiting event, used for cross-table queries. EVENT_ID The ID of the current waiting event. TIME_WAITED The total wait time for this waiting event, in microseconds (us). P1 The value of parameter 1 of the waiting event. P2 The value of parameter 2 of the waiting event. P3 The value of parameter 3 of the waiting event. SQL_PLAN_LINE_ID The ID of the corresponding SQL operator at the time of sampling. The value is NULL if no operator is found. GROUP_ID The group information at the sampling point. PLAN_HASH The plan hash of the SQL command being executed. THREAD_ID The thread ID of the current active session. STMT_TYPE The SQL type of the current active session. TIME_MODEL Information related to TIME MODEL. IN_PARSE Whether the current session is performing SQL parse at the time of sampling. IN_PL_PARSE Whether the current session is performing SQL PL parse at the time of sampling. IN_PLAN_CACHE Whether the current session is performing plan cache at the time of sampling. IN_SQL_OPTIMIZE Whether the current session is performing SQL optimization at the time of sampling. IN_SQL_EXECUTION Whether the current session is performing SQL execution at the time of sampling. IN_PX_EXECUTION Whether the current session is performing SQL parallel execution at the time of sampling. When the session is in this state, it must also be in the IN_SQL_EXECUTION state. IN_SEQUENCE_LOAD Whether the current session is retrieving values from an auto-increment column or a sequence at the time of sampling. IN_COMMITTING Whether the current sampling point is in the transaction commit phase. IN_STORAGE_READ Whether the current sampling point is in the storage read phase. IN_STORAGE_WRITE Whether the current sampling point is in the storage write phase. IN_REMOTE_DAS_EXECUTION Whether the current sampling point is in the DAS remote execution phase. IN_FILTER_ROWS Indicates whether the current sampling point is in the storage pushdown execution phase. IN_RPC_ENCODE Indicates whether the current SQL is undergoing serialization. IN_RPC_DECODE Indicates whether the current SQL is undergoing deserialization. IN_CONNECTION_MGR Indicates whether the current SQL is establishing a connection. PROGRAM The program name being executed at the current sampling point: - Background thread: refers to the thread name, for example,
observer,WrTimer, etc. - Frontend thread:
- For regular requests:
user@client_ip (thread_name) inner_sqlremote execution:INNER SQL REMOTE EXEC (thread_name)- DAS remote execution:
DAS REMOTE EXEC (thread_name)
- For regular requests:
MODULE The MODULE value recorded for the current session at the sampling moment, set via the DBMS_APPLICATION_INFO.SET_MODULEpackageACTION The ACTION value recorded for the current session at the sampling moment, set via the DBMS_APPLICATION_INFO.SET_ACTIONpackageCLIENT_ID The CLIENT_ID value recorded for the current session at the sampling moment, set via the DBMS_APPLICATION_INFO.set_identifierpackageBACKTRACE An auxiliary debugging field used to record the code call stack when an event occurs PLAN_ID The plan ID of the sampled SQL in the PLAN CACHE, used to associate the sampling point with the plan TM_DELTA_TIME The time interval calculated for the time model, in microseconds TM_DELTA_CPU_TIME The amount of time spent on the CPU during the past TM_DELTA_TIMEperiodTM_DELTA_DB_TIME The amount of time spent on database calls during the past TM_DELTA_TIMEperiodTOP_LEVEL_SQL_ID The top-level SQL ID IN_PLSQL_COMPILATION The current PL compilation status: Y/N IN_PLSQL_EXECUTION The current PL execution status: Y/N PLSQL_ENTRY_OBJECT_ID The OBJECT ID of the top-level PL PLSQL_ENTRY_SUBPROGRAM_ID The Sub project ID of the top-level PL PLSQL_ENTRY_SUBPROGRAM_NAME The Sub project name of the top-level PL PLSQL_OBJECT_ID The ID of the PL object currently being executed PLSQL_SUBPROGRAM_ID The ID of the PL subprogram currently being executed PLSQL_SUBPROGRAM_NAME The name of the PL subprogram currently being executed BLOCKING_SESSION_ID If the current session is blocked, displays the session ID that blocked it. Currently only effective in lock conflict scenarios, showing the ID of the session holding the lock. TABLET_ID The ID of the tablet being processed by the current SQL PROXY_sid The proxy session ID TX_ID The current transaction ID DELTA_READ_IO_REQUESTS The number of reads between two samples DELTA_READ_IO_BYTES The cumulative size of files read between two samples DELTA_WRITE_IO_REQUESTS The number of writes between two samples DELTA_WRITE_IO_BYTES The cumulative size of files written between two samples WEIGHT The number of occurrences of the same tenant and action within the time range corresponding to this WR record For more information about the oceanbase.CDB_WR_ACTIVE_SESSION_HISTORY view, see oceanbase.CDB_WR_ACTIVE_SESSION_HISTORY.
Use the
oceanbase.DBA_WR_ACTIVE_SESSION_HISTORYview to view ASH data of the current tenant after it is persisted.obclient [oceanbase]> SELECT * FROM oceanbase.DBA_WR_ACTIVE_SESSION_HISTORY limit 1\GThe query result is as follows:
*************************** 1. row *************************** CLUSTER_ID: 10001 TENANT_ID: 1 SNAP_ID: 1 SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 SAMPLE_ID: 10 SESSION_ID: 4611686018427389188 SAMPLE_TIME: 2026-03-16 16:30:16.853022 USER_ID: 200001 SESSION_TYPE: 1 SESSION_STATE: ON CPU SQL_ID: F9C0A3AB0A89EA2048B7A9F436596C68 TRACE_ID: xx.xx.xx.xx-xx.xx.xx.xx-0-0 EVENT_NO: 0 EVENT_ID: NULL TIME_WAITED: 0 P1: 0 P2: 0 P3: 0 SQL_PLAN_LINE_ID: 1 GROUP_ID: 0 PLAN_HASH: 3290318591324336132 THREAD_ID: 111169 STMT_TYPE: 2 TX_ID: 27 BLOCKING_SESSION_ID: NULL TIME_MODEL: 0 IN_PARSE: N IN_PL_PARSE: N IN_PLAN_CACHE: N IN_SQL_OPTIMIZE: N IN_SQL_EXECUTION: N IN_PX_EXECUTION: N IN_SEQUENCE_LOAD: N IN_COMMITTING: N IN_STORAGE_READ: N IN_STORAGE_WRITE: N IN_REMOTE_DAS_EXECUTION: N IN_PLSQL_COMPILATION: N IN_PLSQL_EXECUTION: N IN_FILTER_ROWS: N IN_RPC_ENCODE: N IN_RPC_DECODE: N IN_CONNECTION_MGR: N PROGRAM: T1_RPC_REQUEST MODULE: LOCAL INNER SQL EXEC ACTION: NULL_INNER_SQL CLIENT_ID: NULL BACKTRACE: NULL PLAN_ID: 289 TM_DELTA_TIME: 37301 TM_DELTA_CPU_TIME: 36278 TM_DELTA_DB_TIME: 36295 TOP_LEVEL_SQL_ID: NULL PLSQL_ENTRY_OBJECT_ID: NULL PLSQL_ENTRY_SUBPROGRAM_ID: NULL PLSQL_ENTRY_SUBPROGRAM_NAME: NULL PLSQL_OBJECT_ID: NULL PLSQL_SUBPROGRAM_ID: NULL PLSQL_SUBPROGRAM_NAME: NULL DELTA_READ_IO_REQUESTS: 0 DELTA_READ_IO_BYTES: 0 DELTA_WRITE_IO_REQUESTS: 0 DELTA_WRITE_IO_BYTES: 0 TABLET_ID: NULL PROXY_SID: 4611686018427389188 WEIGHT: 1 1 row in set (0.093 sec)The following table describes the fields.
FieldDescriptionCLUSTER_ID The cluster ID. TENANT_ID The tenant ID. SNAP_ID The snapshot ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. SAMPLE_ID The sampling ID. SESSION_ID The ID of the sampled session. SAMPLE_TIME The sampling time. USER_ID The user ID of the sampled session. SESSION_TYPE The session type. - N: FOREGROUND indicates a foreground session, that is, a user session.
- Y: BACKGROUND indicates a background session.
SESSION_STATE The state of the session at the time of sampling. EVENT_NO == 0: "ON CPU" indicates that the session is currently not waiting and is executing SQL logic.EVENT_NO ≠ 0: "WAITING" indicates that the session is currently waiting. For details about the wait content, refer to the EVENT field.
SQL_ID The SQL ID. TRACE_ID TRACE_ID EVENT_NO The internal number of the wait event, used for associated queries with other tables. EVENT_ID The ID of the current wait event. TIME_WAITED The total wait time of the wait event, in microseconds (us). P1 The value of parameter 1 of the wait event. P2 The value of parameter 2 of the wait event. P3 The value of parameter 3 of the wait event. SQL_PLAN_LINE_ID The ID of the corresponding SQL operator at the time of sampling. The value is NULL if no corresponding operator exists. GROUP_ID The group information at the sampling point. PLAN_HASH The plan hash corresponding to the currently executed SQL command. THREAD_ID The thread ID of the currently active session. STMT_TYPE The SQL type of the currently active session. TIME_MODEL Information related to TIME MODEL. IN_PARSE Whether the current session is performing SQL parse at the time of sampling. IN_PL_PARSE Whether the current session is performing SQL PL parse at the time of sampling. IN_PLAN_CACHE Whether the current session is performing plan cache at the time of sampling. IN_SQL_OPTIMIZE Whether the current session is performing SQL optimization at the time of sampling. IN_SQL_EXECUTION Whether the current session is performing SQL execution at the time of sampling. IN_PX_EXECUTION Whether the current session is performing SQL parallel execution at the time of sampling. When the session is in this state, it must also be in the IN_SQL_EXECUTION state. IN_SEQUENCE_LOAD Whether the current session is retrieving values from an auto-increment column or a sequence at the time of sampling. IN_COMMITTING Whether the current sampling point is in the transaction commit phase. IN_STORAGE_READ Whether the current sampling point is in the storage read phase. IN_STORAGE_WRITE Whether the current sampling point is in the storage write phase. IN_REMOTE_DAS_EXECUTION Whether the current sampling point is in the DAS remote execution phase. IN_FILTER_ROWS Whether the current sampling point is in the storage pushdown execution phase. IN_RPC_ENCODE The serialization operation currently being performed by the SQL statement. IN_RPC_DECODE The deserialization operation currently being performed by the SQL statement. IN_CONNECTION_MGR The connection establishment operation currently being performed by the SQL statement. PROGRAM The name of the program currently being executed at the sampling point: - Background thread: refers to the thread name, such as
observerandWrTimer. - Foreground thread:
- A regular request is represented as
user@client_ip (thread_name). inner_sqlremote execution is represented asINNER SQL REMOTE EXEC (thread_name).- DAS remote execution is represented as
DAS REMOTE EXEC (thread_name).
- A regular request is represented as
MODULE The MODULE value recorded on the current session at the time of sampling. This value is set using the DBMS_APPLICATION_INFO.SET_MODULEpackage.ACTION The ACTION value recorded on the current session at the time of sampling. This value is set using the DBMS_APPLICATION_INFO.SET_ACTIONpackage.CLIENT_ID The CLIENT_ID value recorded on the current session at the time of sampling. This value is set using the DBMS_APPLICATION_INFO.set_identifierpackage.BACKTRACE An auxiliary debugging field used to record the code call stack when the event occurred. PLAN_ID The plan ID of the sampled SQL statement in the PLAN CACHE, used to associate the sampling point with the plan. TM_DELTA_TIME The time interval for calculating the time model, in microseconds. TM_DELTA_CPU_TIME The amount of time spent on the CPU during the past TM_DELTA_TIMEperiod.TM_DELTA_DB_TIME The amount of time spent on database calls during the past TM_DELTA_TIMEperiod.TOP_LEVEL_SQL_ID The top-level SQL ID. IN_PLSQL_COMPILATION The current PL compilation status: Y/N IN_PLSQL_EXECUTION The current PL execution status: Y/N PLSQL_ENTRY_OBJECT_ID The OBJECT ID of the top-level PL. PLSQL_ENTRY_SUBPROGRAM_ID The Sub project ID of the top-level PL. PLSQL_ENTRY_SUBPROGRAM_NAME The Sub project name of the top-level PL. PLSQL_OBJECT_ID The ID of the PL object currently being executed. PLSQL_SUBPROGRAM_ID The ID of the PL subprogram currently being executed. PLSQL_SUBPROGRAM_NAME The name of the PL subprogram currently being executed. BLOCKING_SESSION_ID If the current session is blocked, displays the ID of the session that blocked it. Currently effective only in lock conflict scenarios, showing the ID of the session holding the lock. TABLET_ID The ID of the tablet being processed by the current SQL statement. PROXY_sid The proxy session ID. TX_ID The current transaction ID. DELTA_READ_IO_REQUESTS The number of reads between two samples. DELTA_READ_IO_BYTES The cumulative size of files read between two samples. DELTA_WRITE_IO_REQUESTS The number of writes between two samples. DELTA_WRITE_IO_BYTES The cumulative size of files written between two samples. WEIGHT The number of occurrences of the same tenant and action within the time range corresponding to this WR record. For more information about the
DBA_WR_ACTIVE_SESSION_HISTORYview, see oceanbase.DBA_WR_ACTIVE_SESSION_HISTORY.Query the
GV$OB_ACTIVE_SESSION_HISTORYview for active session history.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_ACTIVE_SESSION_HISTORY limit 1\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 SAMPLE_ID: 589519 SAMPLE_TIME: 2026-03-17 15:36:38.029639 CON_ID: 1001 USER_ID: 0 SESSION_ID: 2305843009213712375 SESSION_TYPE: BACKGROUND SESSION_STATE: WAITING SQL_ID: NULL PLAN_ID: 0 TRACE_ID: NULL EVENT: remote log writer cond wait EVENT_NO: 141 EVENT_ID: 18249 P1TEXT: address P1: 139637653681328 P2TEXT: P2: 0 P3TEXT: P3: 0 WAIT_CLASS: CONCURRENCY WAIT_CLASS_ID: 104 TIME_WAITED: 99812 SQL_PLAN_LINE_ID: NULL GROUP_ID: 0 PLAN_HASH: NULL THREAD_ID: 111438 STMT_TYPE: NULL TIME_MODEL: 0 IN_PARSE: N IN_PL_PARSE: N IN_PLAN_CACHE: N IN_SQL_OPTIMIZE: N IN_SQL_EXECUTION: N IN_PX_EXECUTION: N IN_SEQUENCE_LOAD: N IN_COMMITTING: N IN_STORAGE_READ: N IN_STORAGE_WRITE: N IN_REMOTE_DAS_EXECUTION: N IN_FILTER_ROWS: N IN_RPC_ENCODE: N IN_RPC_DECODE: N IN_CONNECTION_MGR: N PROGRAM: T1001_LogService MODULE: LogRestoreService ACTION: RemoteLogWriter CLIENT_ID: NULL BACKTRACE: NULL TM_DELTA_TIME: 997367 TM_DELTA_CPU_TIME: 250 TM_DELTA_DB_TIME: 997367 TOP_LEVEL_SQL_ID: NULL IN_PLSQL_COMPILATION: N IN_PLSQL_EXECUTION: N PLSQL_ENTRY_OBJECT_ID: NULL PLSQL_ENTRY_SUBPROGRAM_ID: NULL PLSQL_ENTRY_SUBPROGRAM_NAME: NULL PLSQL_OBJECT_ID: NULL PLSQL_SUBPROGRAM_ID: NULL PLSQL_SUBPROGRAM_NAME: NULL TX_ID: NULL BLOCKING_SESSION_ID: NULL TABLET_ID: NULL PROXY_SID: 2305843009213712375 DELTA_READ_IO_REQUESTS: 0 DELTA_READ_IO_BYTES: 0 DELTA_WRITE_IO_REQUESTS: 0 DELTA_WRITE_IO_BYTES: 0 WEIGHT: 1 IS_WR_WEIGHT_SAMPLE: N 1 row in set (0.015 sec)The following table describes the fields.
FieldDescriptionSVR_IP The IP address of the server to which the sample belongs. SVR_PORT The port number of the server to which the sample belongs. SAMPLE_ID The unique local sample ID. SAMPLE_TIME The sampling time. CON_ID The tenant ID. USER_ID The user ID of the sampled session. SESSION_ID The ID of the sampled session. SESSION_TYPE The session type. Valid values: - FOREGROUND: The session is in the foreground, that is, it is a user session.
- (Not supported.) BACKGROUND: The session is in the background.
SESSION_STATE The session state. Valid values: - ON CPU: The session is not waiting and is currently executing SQL logic.
- WAITING: The session is waiting. For details about the wait event, see the EVENT column.
SQL_ID The SQL ID. PLAN_ID The plan ID of the sampled SQL statement in the PLAN CACHE, used to associate the sampling point with the plan. TRACE_ID The trace ID of the operator. EVENT The description of the wait event. EVENT_NO The internal number of the wait event, used to join queries with other tables. EVENT_ID The ID of the current wait event. P1TEXT The name of parameter 1 of the wait event. The name varies depending on the event. P1 The value of parameter 1 of the wait event. P2TEXT The name of parameter 2 of the wait event. The name varies depending on the event. P2 The value of parameter 2 of the wait event. P3TEXT The name of parameter 3 of the wait event. The name varies depending on the event. P3 The value of parameter 3 of the wait event. WAIT_CLASS The type of the wait event. WAIT_CLASS_ID The ID of the wait event type, used to join queries with other tables. TIME_WAITED The total wait time of the wait event, in microseconds (us). SQL_PLAN_LINE_ID The line number of the SQL operator in the SQL plan when the session was sampled. GROUP_ID The group information at the sampling point. PLAN_HASH The plan hash corresponding to the currently executed SQL command. THREAD_ID The thread ID of the currently active session. STMT_TYPE The SQL type of the currently active session. IN_PARSE Indicates whether the session is performing SQL parse at the time of sampling. IN_PL_PARSE Indicates whether the session is performing SQL PL parse at the time of sampling. IN_PLAN_CACHE Indicates whether the session is performing plan cache matching at the time of sampling. IN_SQL_OPTIMIZE Indicates whether the session is performing SQL parsing optimization at the time of sampling. IN_SQL_EXECUTION Indicates whether the session is performing SQL execution at the time of sampling. IN_PX_EXECUTION Indicates whether the session is performing SQL parallel execution at the time of sampling. When the session is in this state, it must also be in the IN_SQL_EXECUTION state. IN_SEQUENCE_LOAD Indicates whether the session is loading auto-increment columns or sequence values at the time of sampling. IN_COMMITTING Indicates whether the current sampling point is in the transaction commit phase. IN_STORAGE_READ Indicates whether the current sampling point is in the storage read phase. IN_STORAGE_WRITE Indicates whether the current sampling point is in the storage write phase. IN_REMOTE_DAS_EXECUTION Indicates whether the current sampling point is in the DAS remote execution phase. IN_FILTER_ROWS Indicates whether the current sampling point is in the storage pushdown execution phase. IN_RPC_ENCODE Indicates whether the current SQL statement is undergoing serialization. IN_RPC_DECODE Indicates whether the current SQL statement is undergoing deserialization. IN_CONNECTION_MGR Indicates whether the current SQL statement is establishing a connection. PROGRAM The name of the program being executed at the current sampling point. Valid values: - Background thread: The thread name, for example,
observer,WrTimer, etc. - Foreground thread:
- A regular request is
user@client_ip (thread_name). inner_sqlremote execution isINNER SQL REMOTE EXEC (thread_name).- DAS remote execution is
DAS REMOTE EXEC (thread_name).
- A regular request is
MODULE The MODULE value recorded during the session sampling. This value is set using the DBMS_APPLICATION_INFO.SET_MODULEpackage.ACTION The ACTION value recorded during the session sampling. This value is set using the DBMS_APPLICATION_INFO.SET_ACTIONpackage.CLIENT_ID The CLIENT_ID value recorded during the session sampling. This value is set using the DBMS_APPLICATION_INFO.set_identifierpackage.BACKTRACE An auxiliary debugging field that records the code call stack at the time the event occurred. The value of this field is always NULL. TM_DELTA_TIME The time interval calculated for the time model, in microseconds. TM_DELTA_CPU_TIME The amount of time spent on the CPU during the past TM_DELTA_TIMEperiod.TM_DELTA_DB_TIME The amount of time spent on database calls during the past TM_DELTA_TIMEperiod.TOP_LEVEL_SQL_ID The top-level SQL ID. IN_PLSQL_COMPILATION The current PL compilation status: Y/N. IN_PLSQL_EXECUTION The current PL execution status: Y/N. PLSQL_ENTRY_OBJECT_ID The OBJECT ID of the top-level PL. PLSQL_ENTRY_SUBPROGRAM_ID The Sub project ID of the top-level PL. PLSQL_ENTRY_SUBPROGRAM_NAME The Sub project name of the top-level PL. PLSQL_OBJECT_ID The ID of the PL object currently being executed. PLSQL_SUBPROGRAM_ID The ID of the PL subprogram currently being executed. PLSQL_SUBPROGRAM_NAME The name of the PL subprogram currently being executed. BLOCKING_SESSION_ID If the current session is blocked, displays the session ID that blocked it. Currently effective only in lock conflict scenarios, showing the ID of the session holding the lock. TABLET_ID The ID of the tablet being processed by the current SQL statement. PROXY_sid The proxy session ID. TX_ID The current transaction ID. DELTA_READ_IO_REQUESTS The number of reads between two samples. DELTA_READ_IO_BYTES The cumulative size of files read between two samples. DELTA_WRITE_IO_REQUESTS The number of writes between two samples. DELTA_WRITE_IO_BYTES The cumulative size of files written between two samples. WEIGHT The number of occurrences of the same tenant and action within the time range corresponding to this WR record. IS_WR_WEIGHT_SAMPLE Indicates whether it is an "aggregated" column for queue backlog wait events. For more information about the
GV$OB_ACTIVE_SESSION_HISTORYview, see GV$OB_ACTIVE_SESSION_HISTORY.Query the
V$OB_ACTIVE_SESSION_HISTORYview for the history of active sessions.obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_ACTIVE_SESSION_HISTORY limit 1\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 SAMPLE_ID: 611098 SAMPLE_TIME: 2026-03-17 16:25:41.380291 CON_ID: 1001 USER_ID: 0 SESSION_ID: 2305843009213712375 SESSION_TYPE: BACKGROUND SESSION_STATE: WAITING SQL_ID: NULL PLAN_ID: 0 TRACE_ID: NULL EVENT: remote log writer cond wait EVENT_NO: 141 EVENT_ID: 18249 P1TEXT: address P1: 139637653681328 P2TEXT: P2: 0 P3TEXT: P3: 0 WAIT_CLASS: CONCURRENCY WAIT_CLASS_ID: 104 TIME_WAITED: 99806 SQL_PLAN_LINE_ID: NULL GROUP_ID: 0 PLAN_HASH: NULL THREAD_ID: 111438 STMT_TYPE: NULL TIME_MODEL: 0 IN_PARSE: N IN_PL_PARSE: N IN_PLAN_CACHE: N IN_SQL_OPTIMIZE: N IN_SQL_EXECUTION: N IN_PX_EXECUTION: N IN_SEQUENCE_LOAD: N IN_COMMITTING: N IN_STORAGE_READ: N IN_STORAGE_WRITE: N IN_REMOTE_DAS_EXECUTION: N IN_FILTER_ROWS: N IN_RPC_ENCODE: N IN_RPC_DECODE: N IN_CONNECTION_MGR: N PROGRAM: T1001_LogService MODULE: LogRestoreService ACTION: RemoteLogWriter CLIENT_ID: NULL BACKTRACE: NULL TM_DELTA_TIME: 997935 TM_DELTA_CPU_TIME: 243 TM_DELTA_DB_TIME: 997935 TOP_LEVEL_SQL_ID: NULL IN_PLSQL_COMPILATION: N IN_PLSQL_EXECUTION: N PLSQL_ENTRY_OBJECT_ID: NULL PLSQL_ENTRY_SUBPROGRAM_ID: NULL PLSQL_ENTRY_SUBPROGRAM_NAME: NULL PLSQL_OBJECT_ID: NULL PLSQL_SUBPROGRAM_ID: NULL PLSQL_SUBPROGRAM_NAME: NULL TX_ID: NULL BLOCKING_SESSION_ID: NULL TABLET_ID: NULL PROXY_SID: 2305843009213712375 DELTA_READ_IO_REQUESTS: 0 DELTA_READ_IO_BYTES: 0 DELTA_WRITE_IO_REQUESTS: 0 DELTA_WRITE_IO_BYTES: 0 WEIGHT: 1 IS_WR_WEIGHT_SAMPLE: N 1 row in set (0.015 sec)The following table describes the fields.
FieldDescriptionSVR_IP The IP address of the server to which the sample belongs. SVR_PORT The port number of the server to which the sample belongs. SAMPLE_ID The unique local ID of the sample. SAMPLE_TIME The sampling time. CON_ID The tenant ID. USER_ID The user ID of the sampled session. SESSION_ID The ID of the sampled session. SESSION_TYPE The session type. Valid values: - FOREGROUND: The session is in the foreground, that is, it is a user session.
- (Not supported.) BACKGROUND: The session is in the background.
SESSION_STATE The session state. Valid values: - ON CPU: The session is not waiting and is currently executing SQL logic.
- WAITING: The session is waiting. For details about the wait event, see the EVENT column.
SQL_ID The SQL ID. PLAN_ID The plan ID of the sampled SQL statement in the PLAN CACHE, used to associate the sampling point with the plan. TRACE_ID The trace ID of the operator. EVENT The description of the wait event. EVENT_NO The internal number of the wait event, used to associate queries with other tables. EVENT_ID The ID of the current wait event. P1TEXT The name of parameter 1 of the wait event. The name varies depending on the value of the EVENT column. P1 The value of parameter 1 of the wait event. P2TEXT The name of parameter 2 of the wait event. The name varies depending on the value of the EVENT column. P2 The value of parameter 2 of the wait event. P3TEXT The name of parameter 3 of the wait event. The name varies depending on the value of the EVENT column. P3 The value of parameter 3 of the wait event. WAIT_CLASS The type of the wait event. WAIT_CLASS_ID The ID of the type of the wait event, used to associate queries with other tables. TIME_WAITED The total wait time of the wait event, in microseconds (us). SQL_PLAN_LINE_ID The line number of the SQL operator in the SQL plan when the session was sampled. GROUP_ID The group information at the sampling point. PLAN_HASH The plan hash corresponding to the currently executed SQL command. THREAD_ID The thread ID of the currently active session. STMT_TYPE The SQL type of the currently active session. IN_PARSE Indicates whether the session is performing SQL parse at the time of sampling. IN_PL_PARSE Indicates whether the session is performing SQL PL parse at the time of sampling. IN_PLAN_CACHE Indicates whether the session is performing plan cache matching at the time of sampling. IN_SQL_OPTIMIZE Indicates whether the session is performing SQL parsing optimization at the time of sampling. IN_SQL_EXECUTION Indicates whether the session is performing SQL execution at the time of sampling. IN_PX_EXECUTION Indicates whether the session is performing SQL parallel execution at the time of sampling. When the session is in this state, it must also be in the IN_SQL_EXECUTION state. IN_SEQUENCE_LOAD Indicates whether the session is fetching values from an auto-increment column or a sequence at the time of sampling. IN_COMMITTING Indicates whether the current sampling point is in the transaction commit phase. IN_STORAGE_READ Indicates whether the current sampling point is in the storage read phase. IN_STORAGE_WRITE Indicates whether the current sampling point is in the storage write phase. IN_REMOTE_DAS_EXECUTION Indicates whether the current sampling point is in the DAS remote execution phase. IN_FILTER_ROWS Indicates whether the current sampling point is in the storage pushdown execution phase. IN_RPC_ENCODE Indicates whether the current SQL statement is undergoing serialization. IN_RPC_DECODE Indicates whether the current SQL statement is undergoing deserialization. IN_CONNECTION_MGR Indicates whether the current SQL statement is establishing a connection. PROGRAM The name of the program being executed at the current sampling point. Valid values: - Background thread: The thread name, for example,
observer,WrTimer, etc. - Foreground thread:
- For regular requests:
user@client_ip (thread_name) inner_sql:INNER SQL REMOTE EXEC (thread_name)- DAS remote execution:
DAS REMOTE EXEC (thread_name)
- For regular requests:
MODULE The MODULE value recorded during sampling. This value is set by using the DBMS_APPLICATION_INFO.SET_MODULEpackage.ACTION The ACTION value recorded during sampling. This value is set by using the DBMS_APPLICATION_INFO.SET_ACTIONpackage.CLIENT_ID The CLIENT_ID value recorded during sampling. This value is set by using the DBMS_APPLICATION_INFO.set_identifierpackage.BACKTRACE An auxiliary debugging field that records the code call stack at the time the event occurred. This field is always NULL. TM_DELTA_TIME The time interval for calculating the time model, in microseconds. TM_DELTA_CPU_TIME The amount of time spent on the CPU during the past TM_DELTA_TIMEperiod.TM_DELTA_DB_TIME The amount of time spent on database calls during the past TM_DELTA_TIMEperiod.TOP_LEVEL_SQL_ID The top-level SQL ID. IN_PLSQL_COMPILATION The current PL compilation status: Y/N. IN_PLSQL_EXECUTION The current PL execution status: Y/N. PLSQL_ENTRY_OBJECT_ID The OBJECT ID of the top-level PL. PLSQL_ENTRY_SUBPROGRAM_ID The Sub project ID of the top-level PL. PLSQL_ENTRY_SUBPROGRAM_NAME The Sub project name of the top-level PL. PLSQL_OBJECT_ID The ID of the PL object currently being executed. PLSQL_SUBPROGRAM_ID The ID of the PL subprogram currently being executed. PLSQL_SUBPROGRAM_NAME The name of the PL subprogram currently being executed. BLOCKING_SESSION_ID If the current session is blocked, displays the session ID that blocked it. Currently effective only in lock conflict scenarios, showing the session ID holding the lock. TABLET_ID The ID of the tablet being processed by the current SQL statement. PROXY_sid The proxy session ID. TX_ID The current transaction ID. DELTA_READ_IO_REQUESTS The number of reads between two samples. DELTA_READ_IO_BYTES The cumulative size of files read between two samples. DELTA_WRITE_IO_REQUESTS The number of writes between two samples. DELTA_WRITE_IO_BYTES The cumulative size of files written between two samples. WEIGHT The number of occurrences of the same tenant and action within the time range corresponding to this WR record. IS_WR_WEIGHT_SAMPLE Whether it is an "aggregated" column for queue backlog wait events. For more information about the
V$OB_ACTIVE_SESSION_HISTORYview, see V$OB_ACTIVE_SESSION_HISTORY.
View historical session statistics
Query the
oceanbase.CDB_WR_STATNAMEview for the names of system statistics for all tenants.obclient [oceanbase]> SELECT * FROM oceanbase.CDB_WR_STATNAME limit 1;The query result is as follows:
+------------+-----------+---------+---------------+ | CLUSTER_ID | TENANT_ID | STAT_ID | STAT_NAME | +------------+-----------+---------+---------------+ | 4000 | 1 | 10000 | rpc packet in | +------------+-----------+---------+---------------+ 1 row in set (0.001 sec)The following table describes the fields.
FieldDescriptionCLUSTER_ID The cluster ID. TENANT_ID The tenant ID. STAT_ID The statistics ID. STAT_NAME The statistics name. For more information about the oceanbase.CDB_WR_STATNAME view, see oceanbase.CDB_WR_STATNAME.
Use the
oceanbase.DBA_WR_STATNAMEview to view the names of the system statistics for the current tenant.obclient [oceanbase]> SELECT * FROM oceanbase.DBA_WR_STATNAME limit 1;The query result is as follows:
+------------+-----------+---------+---------------+ | CLUSTER_ID | TENANT_ID | STAT_ID | STAT_NAME | +------------+-----------+---------+---------------+ | 4000 | 1 | 10000 | rpc packet in | +------------+-----------+---------+---------------+ 1 row in set (0.004 sec)The following table describes the fields.
FieldDescriptionCLUSTER_ID The cluster ID. TENANT_ID The tenant ID. STAT_ID The statistics ID. STAT_NAME The statistics name. For more information about the
DBA_WR_STATNAMEview, see oceanbase.DBA_WR_STATNAME.Query the
oceanbase.CDB_WR_SYSSTATview for detailed information about system statistics for all tenants.obclient [oceanbase]> SELECT * FROM oceanbase.CDB_WR_SYSSTAT limit 1;The query result is as follows:
+------------+-----------+---------+----------------+----------+---------+--------+ | CLUSTER_ID | TENANT_ID | SNAP_ID | SVR_IP | SVR_PORT | STAT_ID | VALUE | +------------+-----------+---------+----------------+----------+---------+--------+ | 4000 | 1 | 114 | xx.xx.xx.xx | 2882 | 10000 | 228856 | +------------+-----------+---------+----------------+----------+---------+--------+ 1 row in set (0.036 sec)The following table describes the fields.
FieldDescriptionCLUSTER_ID The cluster ID. TENANT_ID The tenant ID. SNAP_ID The snapshot ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. STAT_ID The ID of the statistic. VALUE The value of the statistic. For more information about the oceanbase.CDB_WR_SYSSTAT view, see oceanbase.CDB_WR_SYSSTAT.
Use the
oceanbase.DBA_WR_SYSSTATview to view detailed system statistics for the current tenant.obclient [oceanbase]> SELECT * FROM oceanbase.DBA_WR_SYSSTAT limit 1;The query result is as follows:
+------------+-----------+---------+----------------+----------+---------+--------+ | CLUSTER_ID | TENANT_ID | SNAP_ID | SVR_IP | SVR_PORT | STAT_ID | VALUE | +------------+-----------+---------+----------------+----------+---------+--------+ | 4000 | 1 | 114 | xx.xx.xx.xx | 2882 | 10000 | 228856 | +------------+-----------+---------+----------------+----------+---------+--------+ 1 row in set (0.026 sec)The following table describes the fields.
FieldDescriptionCLUSTER_ID The cluster ID. TENANT_ID The tenant ID. SNAP_ID The snapshot ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. STAT_ID The ID of the statistic. VALUE The value of the statistic. For more information about the
DBA_WR_SYSSTATview, see oceanbase.DBA_WR_SYSSTAT.
View time model statistics
Query the
GV$OB_SESS_TIME_MODELview for session-level time model statistics in a cluster.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_SESS_TIME_MODEL LIMIT 10;The query result is as follows:
+---------------+-----------+----------------+----------+---------+--------------------+-------+ | SID | TENANT_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE | +---------------+-----------+----------------+----------+---------+--------------------+-------+ | 3298534883328 | 1002 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 3298534883328 | 1002 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 3848290697216 | 1001 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 3848290697216 | 1001 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 3221659555 | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 3 | | 3221659555 | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 4398046511104 | 1001 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 4398046511104 | 1001 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 4947802324992 | 1004 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 4947802324992 | 1004 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | +---------------+-----------+----------------+----------+---------+--------------------+-------+ 10 rows in setThe following table describes the fields.
FieldDescriptionSID The session ID. TENANT_ID The tenant ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. STAT_ID The ID of the statistic. STAT_NAME The name of the statistic. VALUE The value of the statistic. For more information about the
GV$OB_SESS_TIME_MODELview, see GV$OB_SESS_TIME_MODEL.Query the
V$OB_SESS_TIME_MODELview for session-level time model statistics on the current node.obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_SESS_TIME_MODEL LIMIT 10;The query result is as follows:
+---------------+-----------+----------------+----------+---------+--------------------+-------+ | SID | TENANT_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE | +---------------+-----------+----------------+----------+---------+--------------------+-------+ | 3298534883328 | 1002 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 3298534883328 | 1002 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 3848290697216 | 1001 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 3848290697216 | 1001 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 4398046511104 | 1001 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 4398046511104 | 1001 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 3221667747 | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 3221667747 | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | | 4947802324992 | 1004 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 0 | | 4947802324992 | 1004 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | +---------------+-----------+----------------+----------+---------+--------------------+-------+ 10 rows in setThe following table describes the fields.
FieldDescriptionSID The session ID. TENANT_ID The tenant ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. STAT_ID The ID of the statistic. STAT_NAME The name of the statistic. VALUE The value of the statistic. For more information about the
V$OB_SESS_TIME_MODELview, see V$OB_SESS_TIME_MODEL.Query the
GV$OB_SYS_TIME_MODELview for tenant-level time model statistics in a cluster.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_SYS_TIME_MODEL;The query result is as follows:
+-----------+----------------+----------+---------+-------------------------+------------+ | TENANT_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE | +-----------+----------------+----------+---------+-------------------------+------------+ | 1002 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 6135115 | | 1002 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 5500079 | | 1002 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 3398189713 | | 1002 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 3088552955 | | 1002 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 635036 | | 1002 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 80414 | +-----------+----------------+----------+---------+-------------------------+------------+ 6 rows in setThe following table describes the fields.
FieldDescriptionTENANT_ID The tenant ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. STAT_ID The ID of the statistic. STAT_NAME The name of the statistic. VALUE The value of the statistic. For more information about the
GV$OB_SYS_TIME_MODELview, see GV$OB_SYS_TIME_MODEL.Query the tenant-level time model statistics on the current node by using the
V$OB_SYS_TIME_MODELview.obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_SYS_TIME_MODEL;The query result is as follows:
+-----------+----------------+----------+---------+-------------------------+------------+ | TENANT_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE | +-----------+----------------+----------+---------+-------------------------+------------+ | 1002 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 6227784 | | 1002 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 5586418 | | 1002 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 3399416601 | | 1002 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 3089779843 | | 1002 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 641366 | | 1002 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 80414 | +-----------+----------------+----------+---------+-------------------------+------------+ 6 rows in setThe following table describes the fields.
FieldDescriptionTENANT_ID The tenant ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. STAT_ID The ID of the statistic. STAT_NAME The name of the statistic. VALUE The value of the statistic. For more information about the
V$OB_SYS_TIME_MODELview, see V$OB_SYS_TIME_MODEL.Query the time model statistics of all tenants by using the
oceanbase.CDB_WR_SYS_TIME_MODELview.obclient [oceanbase]> SELECT * FROM oceanbase.CDB_WR_SYS_TIME_MODEL LIMIT 10;The query result is as follows:
+------------+-----------+---------+----------------+----------+---------+-------------------------+-----------+ | CLUSTER_ID | TENANT_ID | SNAP_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE | +------------+-----------+---------+----------------+----------+---------+-------------------------+-----------+ | 10001 | 1002 | 2 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 34505 | | 10001 | 1002 | 1 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 34505 | | 10001 | 1002 | 2 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 1966 | | 10001 | 1002 | 1 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 1966 | | 10001 | 1002 | 2 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 233110335 | | 10001 | 1002 | 1 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 116267272 | | 10001 | 1002 | 2 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 209738761 | | 10001 | 1002 | 1 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 104674501 | | 10001 | 1002 | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 32539 | | 10001 | 1002 | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | +------------+-----------+---------+----------------+----------+---------+-------------------------+-----------+ 10 rows in setThe following table describes the fields.
FieldDescriptionCLUSTER_ID Cluster ID TENANT_ID Tenant ID SNAP_ID Snapshot ID SVR_IP Node IP SVR_PORT Node port number STAT_ID Stat ID STAT_NAME Stat name VALUE Stat value For more information about the oceanbase.CDB_WR_SYSSTAT view, see oceanbase.CDB_WR_SYS_TIME_MODEL.
Use the
oceanbase.DBA_WR_SYS_TIME_MODELview to view WR data of time model statistics for the current tenant.obclient [oceanbase]> SELECT * FROM oceanbase.DBA_WR_SYS_TIME_MODEL LIMIT 10;The query result is as follows:
+---------+----------------+----------+---------+-------------------------+-----------+ | SNAP_ID | SVR_IP | SVR_PORT | STAT_ID | STAT_NAME | VALUE | +---------+----------------+----------+---------+-------------------------+-----------+ | 2 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 34505 | | 1 | 172.xx.xxx.xxx | 2882 | 200001 | DB time | 34505 | | 2 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 1966 | | 1 | 172.xx.xxx.xxx | 2882 | 200002 | DB CPU | 1966 | | 2 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 233110335 | | 1 | 172.xx.xxx.xxx | 2882 | 200005 | background elapsed time | 116267272 | | 2 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 209738761 | | 1 | 172.xx.xxx.xxx | 2882 | 200006 | background cpu time | 104674501 | | 1 | 172.xx.xxx.xxx | 2882 | 200010 | non idle wait time | 32539 | | 1 | 172.xx.xxx.xxx | 2882 | 200011 | idle wait time | 0 | +---------+----------------+----------+---------+-------------------------+-----------+ 10 rows in setThe following table describes the fields.
FieldDescriptionSNAP_ID Snapshot ID SVR_IP Node IP SVR_PORT Node port number STAT_ID Stat ID STAT_NAME Stat name VALUE Stat value For more information about the
DBA_WR_SYS_TIME_MODELview, see oceanbase.DBA_WR_SYS_TIME_MODEL.
View SQLSTAT data
Query the
GV$OB_SQLSTATview for basic performance statistics of SQL statements in the cluster.Each SQL statement is represented by a row (i.e., each unique value of
SQL_ID+Plan_Hashcorresponds to one row). A row containing_DELTAindicates that the values are incremental from the last WR snapshot collection to the current time.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_SQLSTAT LIMIT 1\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 TENANT_ID: 1 SQL_ID: C37DC12BB691B517FEA330D030D920E2 PLAN_ID: 0 PLAN_HASH: 10981719669113383604 PLAN_TYPE: 0 QUERY_SQL: SQL_TYPE: 0 MODULE: NULL ACTION: NULL PARSING_DB_ID: 0 PARSING_DB_NAME: PARSING_USER_ID: 0 EXECUTIONS_TOTAL: 1 EXECUTIONS_DELTA: 0 DISK_READS_TOTAL: 0 DISK_READS_DELTA: 0 BUFFER_GETS_TOTAL: 0 BUFFER_GETS_DELTA: 0 ELAPSED_TIME_TOTAL: 15885 ELAPSED_TIME_DELTA: 0 CPU_TIME_TOTAL: 0 CPU_TIME_DELTA: 0 CCWAIT_TOTAL: 0 CCWAIT_DELTA: 0 USERIO_WAIT_TOTAL: 0 USERIO_WAIT_DELTA: 0 APWAIT_TOTAL: 0 APWAIT_DELTA: 0 PHYSICAL_READ_REQUESTS_TOTAL: 0 PHYSICAL_READ_REQUESTS_DELTA: 0 PHYSICAL_READ_BYTES_TOTAL: 0 PHYSICAL_READ_BYTES_DELTA: 0 WRITE_THROTTLE_TOTAL: 0 WRITE_THROTTLE_DELTA: 0 ROWS_PROCESSED_TOTAL: 1 ROWS_PROCESSED_DELTA: 0 MEMSTORE_READ_ROWS_TOTAL: 0 MEMSTORE_READ_ROWS_DELTA: 0 MINOR_SSSTORE_READ_ROWS_TOTAL: 0 MINOR_SSSTORE_READ_ROWS_DELTA: 0 MAJOR_SSSTORE_READ_ROWS_TOTAL: 0 MAJOR_SSSTORE_READ_ROWS_DELTA: 0 RPC_TOTAL: 0 RPC_DELTA: 0 FETCHES_TOTAL: 0 FETCHES_DELTA: 0 RETRY_TOTAL: 0 RETRY_DELTA: 0 PARTITION_TOTAL: 1 PARTITION_DELTA: 0 NESTED_SQL_TOTAL: 0 NESTED_SQL_DELTA: 0 SOURCE_IP: xx.xx.xx.xx SOURCE_PORT: 2882 ROUTE_MISS_TOTAL: 0 ROUTE_MISS_DELTA: 0 FIRST_LOAD_TIME: 2026-03-16 22:00:29.029404 PLAN_CACHE_HIT_TOTAL: 0 PLAN_CACHE_HIT_DELTA: 0 MUTI_QUERY_TOTAL: 0 MUTI_QUERY_DELTA: 0 MUTI_QUERY_BATCH_TOTAL: 0 MUTI_QUERY_BATCH_DELTA: 0 FULL_TABLE_SCAN_TOTAL: 1 FULL_TABLE_SCAN_DELTA: 0 ERROR_COUNT_TOTAL: 0 ERROR_COUNT_DELTA: 0 LATEST_ACTIVE_TIME: 1970-01-01 08:00:00.000000 1 row in set (0.019 sec)The following table describes the fields.
FieldDescriptionSVR_IP The IP address of the node. SVR_PORT The port number of the node. TENANT_ID The tenant ID. SQL_ID The ID of the SQL statement. PLAN_ID The ID of the execution plan. PLAN_HASH The hash value of the execution plan. PLAN_TYPE Indicates the type of the plan for an SQL plan: 1: local plan.2: remote plan.3: distributed plan.
For a PL object cache, this column indicates the type of the PL object:1: procedure.2: function.3: package.4: anonymous block.
QUERY_SQL The full text of the SQL statement. SQL_TYPE The type of the statement. MODULE The application module when the statement was parsed for the first time. You can set this parameter by using the DBMS_APPLICATION_INFO.SET_MODULEpackage.ACTION The application action when the statement was parsed for the first time. You can set this parameter by using the DBMS_APPLICATION_INFO.SET_ACTIONpackage.PARSING_DB_ID The database ID when the statement was parsed. PARSING_DB_NAME The name of the database when the statement was parsed. PARSING_USER_ID The user ID when the statement was parsed. EXECUTIONS_TOTAL The total number of executions of the plan in the plan cache. EXECUTIONS_DELTA The increment of the total number of executions of the plan in the plan cache. DISK_READS_TOTAL The total number of disk reads. DISK_READS_DELTA The increment of the number of disk reads. BUFFER_GETS_TOTAL The total number of logical reads from the cache. BUFFER_GETS_DELTA The increment of the number of logical reads from the cache. ELAPSED_TIME_TOTAL The total amount of time consumed by the statement. For parallel execution scenarios, this value is the cumulative value of each execution thread. ELAPSED_TIME_DELTA The increment of the time consumed by the statement. CPU_TIME_TOTAL The total CPU time consumed. CPU_TIME_DELTA The increment of the total CPU time consumed. CCWAIT_TOTAL The total time consumed by concurrency wait events. CCWAIT_DELTA The increment of the total time consumed by concurrency wait events. USERIO_WAIT_TOTAL The total time consumed by I/O waits. USERIO_WAIT_DELTA The increment of the total time consumed by I/O waits. APWAIT_TOTAL The total time consumed by application wait events. APWAIT_DELTA The increment of the total time consumed by application wait events. PHYSICAL_READ_REQUESTS_TOTAL The total number of physical read requests. PHYSICAL_READ_REQUESTS_DELTA The increment of the number of physical read requests. PHYSICAL_READ_BYTES_TOTAL The total number of bytes read during physical reads. PHYSICAL_READ_BYTES_DELTA The increment of the number of bytes read during physical reads. WRITE_THROTTLE_TOTAL Total time throttled during write to MemStore WRITE_THROTTLE_DELTA Incremental total time throttled during write to MemStore ROWS_PROCESSED_TOTAL Total number of rows processed by statements ROWS_PROCESSED_DELTA Incremental total number of rows processed by statements MEMSTORE_READ_ROWS_TOTAL Total number of rows read from MemStore MEMSTORE_READ_ROWS_DELTA Incremental total number of rows read from MemStore MINOR_SSSTORE_READ_ROWS_TOTAL Total number of rows read from MINOR SSStore MINOR_SSSTORE_READ_ROWS_DELTA Incremental total number of rows read from MINOR SSStore MAJOR_SSSTORE_READ_ROWS_TOTAL Total number of rows read from MAJOR SSStore MAJOR_SSSTORE_READ_ROWS_DELTA Incremental total number of rows read from MAJOR SSStore RPC_TOTAL Total number of RPCs RPC_DELTA Incremental number of RPCs FETCHES_TOTAL Total number of result set fetches FETCHES_DELTA Incremental number of result set fetches RETRY_TOTAL Total number of SQL retries RETRY_DELTA Incremental number of SQL retries PARTITION_TOTAL Total number of partitions scanned in SQL execution PARTITION_DELTA Incremental number of partitions scanned in SQL execution NESTED_SQL_TOTAL Total nested SQL executions. Increases by 1 for each additional executed sub-SQL NESTED_SQL_DELTA Incremental nested SQL executions SOURCE_IP Request source IP address SOURCE_PORT Request source port number ROUTE_MISS_TOTAL Total number of times the requested partition was not hit since OBServer startup ROUTE_MISS_DELTA Number of times the requested partition was not hit since the last WR snapshot collection FIRST_LOAD_TIME Plan generation time PLAN_CACHE_hit_TOTAL Total number of times the Plan Cache was hit since OBServer startup PLAN_CACHE_HIT_DELTA Number of times the Plan Cache was hit since the last WR snapshot collection MUTI_QUERY_TOTAL Number of times this SQL has been located in a multi-query since the plan was generated MUTI_QUERY_DELTA Number of times this SQL has been located in a multi-query since the last WR snapshot collection MUTI_QUERY_BATCH_TOTAL Number of times this SQL batch has been executed since the plan was generated MUTI_QUERY_BATCH_DELTA Number of times this SQL batch has been executed since the last WR snapshot collection FULL_TABLE_SCAN_TOTAL Number of full table scans performed by this SQL since the plan was generated FULL_TABLE_SCAN_DELTA Number of full table scans performed by this SQL since the last WR snapshot collection ERROR_COUNT_TOTAL Number of errors reported by this SQL since the plan was generated ERROR_COUNT_DELTA Number of errors reported by this SQL since the last WR snapshot collection LATEST_ACTIVE_TIME TIMESTAMP(6). The last active time of the plan corresponding to the SQL ID + Plan Hash on a node.For more information about the
GV$OB_SQLSTATview, see GV$OB_SQLSTAT.Query the
V$OB_SQLSTATview for basic performance statistics of SQL statements on the current node.Each SQL statement is represented as one row (that is, each unique value of
SQL_ID+Plan_Hashcorresponds to one row). A row containing_DELTAindicates the incremental statistics from the last WR snapshot collection to the current time.obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_SQLSTAT LIMIT 1\GThe query result is as follows:
*************************** 1. row *************************** SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 TENANT_ID: 1 SQL_ID: C37DC12BB691B517FEA330D030D920E2 PLAN_ID: 0 PLAN_HASH: 10981719669113383604 PLAN_TYPE: 0 QUERY_SQL: SQL_TYPE: 0 MODULE: NULL ACTION: NULL PARSING_DB_ID: 0 PARSING_DB_NAME: PARSING_USER_ID: 0 EXECUTIONS_TOTAL: 1 EXECUTIONS_DELTA: 0 DISK_READS_TOTAL: 0 DISK_READS_DELTA: 0 BUFFER_GETS_TOTAL: 0 BUFFER_GETS_DELTA: 0 ELAPSED_TIME_TOTAL: 15885 ELAPSED_TIME_DELTA: 0 CPU_TIME_TOTAL: 0 CPU_TIME_DELTA: 0 CCWAIT_TOTAL: 0 CCWAIT_DELTA: 0 USERIO_WAIT_TOTAL: 0 USERIO_WAIT_DELTA: 0 APWAIT_TOTAL: 0 APWAIT_DELTA: 0 PHYSICAL_READ_REQUESTS_TOTAL: 0 PHYSICAL_READ_REQUESTS_DELTA: 0 PHYSICAL_READ_BYTES_TOTAL: 0 PHYSICAL_READ_BYTES_DELTA: 0 WRITE_THROTTLE_TOTAL: 0 WRITE_THROTTLE_DELTA: 0 ROWS_PROCESSED_TOTAL: 1 ROWS_PROCESSED_DELTA: 0 MEMSTORE_READ_ROWS_TOTAL: 0 MEMSTORE_READ_ROWS_DELTA: 0 MINOR_SSSTORE_READ_ROWS_TOTAL: 0 MINOR_SSSTORE_READ_ROWS_DELTA: 0 MAJOR_SSSTORE_READ_ROWS_TOTAL: 0 MAJOR_SSSTORE_READ_ROWS_DELTA: 0 RPC_TOTAL: 0 RPC_DELTA: 0 FETCHES_TOTAL: 0 FETCHES_DELTA: 0 RETRY_TOTAL: 0 RETRY_DELTA: 0 PARTITION_TOTAL: 1 PARTITION_DELTA: 0 NESTED_SQL_TOTAL: 0 NESTED_SQL_DELTA: 0 SOURCE_IP: xx.xx.xx.xx SOURCE_PORT: 2882 ROUTE_MISS_TOTAL: 0 ROUTE_MISS_DELTA: 0 FIRST_LOAD_TIME: 2026-03-16 22:00:29.029404 PLAN_CACHE_HIT_TOTAL: 0 PLAN_CACHE_HIT_DELTA: 0 MUTI_QUERY_TOTAL: 0 MUTI_QUERY_DELTA: 0 MUTI_QUERY_BATCH_TOTAL: 0 MUTI_QUERY_BATCH_DELTA: 0 FULL_TABLE_SCAN_TOTAL: 1 FULL_TABLE_SCAN_DELTA: 0 ERROR_COUNT_TOTAL: 0 ERROR_COUNT_DELTA: 0 LATEST_ACTIVE_TIME: 1970-01-01 08:00:00.000000 1 row in set (0.014 sec)The following table describes the fields.
FieldDescriptionSVR_IP The IP address of the node. SVR_PORT The port number of the node. TENANT_ID The tenant ID. SQL_ID The ID of the SQL statement. PLAN_ID The ID of the execution plan. PLAN_HASH The hash value of the execution plan. PLAN_TYPE For an SQL plan cache entry, this column specifies the plan type: 1: a local plan.2: a remote plan.3: a distributed plan.
For a PL object cache entry, this column specifies the PL object type:1: a procedure.2: a function.3: a package.4: an anonymous block.
QUERY_SQL The full text of the SQL statement. SQL_TYPE The statement type. MODULE The application module when the statement was parsed for the first time. This parameter is set by using the DBMS_APPLICATION_INFO.SET_MODULEpackage.ACTION The application action when the statement was parsed for the first time. This parameter is set by using the DBMS_APPLICATION_INFO.SET_ACTIONpackage.PARSING_DB_ID The database ID when the statement was parsed. PARSING_DB_NAME The name of the database when the statement was parsed. PARSING_USER_ID The user ID when the statement was parsed. EXECUTIONS_TOTAL The total number of executions of the plan in the plan cache. EXECUTIONS_DELTA The increment of the total number of executions of the plan in the plan cache. DISK_READS_TOTAL The total number of disk reads. DISK_READS_DELTA The increment of the number of disk reads. BUFFER_GETS_TOTAL The total number of logical reads from the cache. BUFFER_GETS_DELTA The increment of the number of logical reads from the cache. ELAPSED_TIME_TOTAL The total amount of time consumed by the statement. In a parallel execution scenario, this value is the cumulative value of each execution thread. ELAPSED_TIME_DELTA The increment of the time consumed by the statement. CPU_TIME_TOTAL The total CPU time consumed. CPU_TIME_DELTA The increment of the total CPU time consumed. CCWAIT_TOTAL The total time consumed by concurrency-waiting events. CCWAIT_DELTA The increment of the total time consumed by concurrency-waiting events. USERIO_WAIT_TOTAL The total time consumed by I/O-waiting events. USERIO_WAIT_DELTA The increment of the total time consumed by I/O-waiting events. APWAIT_TOTAL The total time consumed by application-waiting events. APWAIT_DELTA The increment of the total time consumed by application-waiting events. PHYSICAL_READ_REQUESTS_TOTAL The total number of physical read requests. PHYSICAL_READ_REQUESTS_DELTA The increment of the number of physical read requests. PHYSICAL_READ_BYTES_TOTAL The total number of bytes read during physical reads. PHYSICAL_READ_BYTES_DELTA The increment of the number of bytes read during physical reads. WRITE_THROTTLE_TOTAL The total time throttled when writing to MemStore. WRITE_THROTTLE_DELTA The increment of the total time throttled when writing to MemStore. ROWS_PROCESSED_TOTAL The total number of rows processed by the statement. ROWS_PROCESSED_DELTA The increment of the total number of rows processed by the statement. MEMSTORE_READ_ROWS_TOTAL Total rows read from the MemStore MEMSTORE_READ_ROWS_DELTA Incremental total rows read from the MemStore MINOR_SSSTORE_READ_ROWS_TOTAL Total rows read from the MINOR SSStore MINOR_SSSTORE_READ_ROWS_DELTA Incremental total rows read from the MINOR SSStore MAJOR_SSSTORE_READ_ROWS_TOTAL Total rows read from the MAJOR SSStore MAJOR_SSSTORE_READ_ROWS_DELTA Incremental total rows read from the MAJOR SSStore RPC_TOTAL Total number of RPCs RPC_DELTA Incremental number of RPCs FETCHES_TOTAL Total number of result set fetches FETCHES_DELTA Incremental number of result set fetches RETRY_TOTAL Total number of SQL retries RETRY_DELTA Incremental number of SQL retries PARTITION_TOTAL Total number of partitions scanned in SQL execution PARTITION_DELTA Incremental number of partitions scanned in SQL execution NESTED_SQL_TOTAL Total number of nested SQL executions. Increases by 1 for each additional executed sub-SQL NESTED_SQL_DELTA Incremental number of nested SQL executions SOURCE_IP Request source IP SOURCE_PORT Request source port number ROUTE_MISS_TOTAL Total number of times the requested partition was not hit since OBServer startup ROUTE_MISS_DELTA Number of times the requested partition was not hit since the last WR snapshot collection FIRST_LOAD_TIME Plan generation time PLAN_CACHE_hit_TOTAL Total number of times the Plan Cache was hit since OBServer startup PLAN_CACHE_HIT_DELTA Number of times the Plan Cache was hit since the last WR snapshot collection MUTI_QUERY_TOTAL Number of times this SQL has been located in a multi-query since the plan was generated MUTI_QUERY_DELTA Number of times this SQL has been located in a multi-query since the last WR snapshot collection MUTI_QUERY_BATCH_TOTAL Number of times this SQL batch has been executed since the plan was generated MUTI_QUERY_BATCH_DELTA Number of times this SQL batch has been executed since the last WR snapshot collection FULL_TABLE_SCAN_TOTAL Number of full-table scans performed by this SQL since the plan was generated FULL_TABLE_SCAN_DELTA Number of full-table scans performed by this SQL since the last WR snapshot collection ERROR_COUNT_TOTAL Number of errors reported by this SQL since the plan was generated ERROR_COUNT_DELTA Number of errors reported by this SQL since the last WR snapshot collection LATEST_ACTIVE_TIME TIMESTAMP(6). The last active time of the plan corresponding to the SQL ID + Plan Hash on a node.For more information about the
V$OB_SQLSTATview, see V$OB_SQLSTAT.Query the
oceanbase.CDB_WR_SQLSTATview for basic performance statistics of all SQL statements executed by all tenants.Each SQL statement is represented as one row (i.e., each unique value of
SQL_ID+Plan_Hashcorresponds to one row). A row containing_DELTAindicates the incremental statistics from the last WR snapshot collection to the current time.obclient [oceanbase]> SELECT * FROM oceanbase.CDB_WR_SQLSTAT LIMIT 1\GThe query result is as follows:
*************************** 1. row *************************** TENANT_ID: 1 SNAP_ID: 1 SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 SQL_ID: 02AAEF3D6A4A939843FE958984B6EA51 PLAN_HASH: 8470076267874576774 PLAN_TYPE: 1 MODULE: NULL ACTION: NULL PARSING_DB_ID: 201001 PARSING_DB_NAME: oceanbase PARSING_USER_ID: 200001 EXECUTIONS_TOTAL: 345 EXECUTIONS_DELTA: 345 DISK_READS_TOTAL: 0 DISK_READS_DELTA: 0 BUFFER_GETS_TOTAL: 0 BUFFER_GETS_DELTA: 0 ELAPSED_TIME_TOTAL: 36311 ELAPSED_TIME_DELTA: 36311 CPU_TIME_TOTAL: 0 CPU_TIME_DELTA: 0 CCWAIT_TOTAL: 0 CCWAIT_DELTA: 0 USERIO_WAIT_TOTAL: 0 USERIO_WAIT_DELTA: 0 APWAIT_TOTAL: 0 APWAIT_DELTA: 0 PHYSICAL_READ_REQUESTS_TOTAL: 0 PHYSICAL_READ_REQUESTS_DELTA: 0 PHYSICAL_READ_BYTES_TOTAL: 0 PHYSICAL_READ_BYTES_DELTA: 0 WRITE_THROTTLE_TOTAL: 0 WRITE_THROTTLE_DELTA: 0 ROWS_PROCESSED_TOTAL: 344 ROWS_PROCESSED_DELTA: 344 MEMSTORE_READ_ROWS_TOTAL: 0 MEMSTORE_READ_ROWS_DELTA: 0 MINOR_SSSTORE_READ_ROWS_TOTAL: 0 MINOR_SSSTORE_READ_ROWS_DELTA: 0 MAJOR_SSSTORE_READ_ROWS_TOTAL: 0 MAJOR_SSSTORE_READ_ROWS_DELTA: 0 RPC_TOTAL: 0 RPC_DELTA: 0 FETCHES_TOTAL: 0 FETCHES_DELTA: 0 RETRY_TOTAL: 0 RETRY_DELTA: 0 PARTITION_TOTAL: 345 PARTITION_DELTA: 345 NESTED_SQL_TOTAL: 0 NESTED_SQL_DELTA: 0 SOURCE_IP: xx.xx.xx.xx SOURCE_PORT: 2882 ROUTE_MISS_TOTAL: 0 ROUTE_MISS_DELTA: 0 FIRST_LOAD_TIME: 2026-03-16 16:30:26.782836 PLAN_CACHE_HIT_TOTAL: 343 PLAN_CACHE_HIT_DELTA: 343 MUTI_QUERY_TOTAL: 0 MUTI_QUERY_DELTA: 0 MUTI_QUERY_BATCH_TOTAL: 0 MUTI_QUERY_BATCH_DELTA: 0 FULL_TABLE_SCAN_TOTAL: 0 FULL_TABLE_SCAN_DELTA: 0 ERROR_COUNT_TOTAL: 0 ERROR_COUNT_DELTA: 0 SAMPLE_TIME: 2026-03-16 16:40:15.000000 LATEST_ACTIVE_TIME: 2026-03-16 16:40:15.526231 1 row in set (0.026 sec)The following table describes the fields.
FieldDescriptionTENANT_ID The tenant ID. SNAP_ID The snapshot ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. SQL_ID The ID of the SQL statement. PLAN_HASH The hash value of the execution plan. PLAN_ID The ID of the execution plan. PLAN_TYPE For cached SQL plans, this column indicates the plan type: 1: a local plan.2: a remote plan.3: a distributed plan.
For cached PL objects, this column indicates the PL object type:1: a procedure.2: a function.3: a package.4: an anonymous block.
MODULE The application module when the statement was first parsed. This can be set using the DBMS_APPLICATION_INFO.SET_MODULEpackage.ACTION The application action when the statement was first parsed. This can be set using the DBMS_APPLICATION_INFO.SET_ACTIONpackage.PARSING_DB_ID The database ID during statement parsing. PARSING_DB_NAME The database name during statement parsing. PARSING_USER_ID The user ID during statement parsing. EXECUTIONS_TOTAL The total number of executions for this plan in the plan cache. EXECUTIONS_DELTA The increment in the total number of executions for this plan in the plan cache. DISK_READS_TOTAL The total number of disk reads. DISK_READS_DELTA The increment in the number of disk reads. BUFFER_GETS_TOTAL The total number of logical reads from the cache. BUFFER_GETS_DELTA The increment in the number of logical reads from the cache. ELAPSED_TIME_TOTAL The total time consumed by the statement. For parallel execution scenarios, this value is the cumulative time for each execution thread. ELAPSED_TIME_DELTA The increment in the time consumed by the statement. CPU_TIME_TOTAL The total CPU time consumed. CPU_TIME_DELTA The increment in the total CPU time consumed. CCWAIT_TOTAL The total time spent on concurrency-waiting events. CCWAIT_DELTA The increment in the total time spent on concurrency-waiting events. USERIO_WAIT_TOTAL The total time spent on I/O waits. USERIO_WAIT_DELTA The increment in the total time spent on I/O waits. APWAIT_TOTAL The total time spent on application-waiting events. APWAIT_DELTA The increment in the total time spent on application-waiting events. PHYSICAL_READ_REQUESTS_TOTAL The total number of physical read requests. PHYSICAL_READ_REQUESTS_DELTA The increment in the number of physical read requests. PHYSICAL_READ_BYTES_TOTAL The total number of bytes read physically. PHYSICAL_READ_BYTES_DELTA The increment in the number of bytes read physically. WRITE_THROTTLE_TOTAL The total time throttled when writing to MemStore. WRITE_THROTTLE_DELTA The increment in the total time throttled when writing to MemStore. ROWS_PROCESSED_TOTAL The total number of rows processed by the statement. ROWS_PROCESSED_DELTA The increment in the total number of rows processed by the statement. MEMSTORE_READ_ROWS_TOTAL The total number of rows read from MemStore. MEMSTORE_READ_ROWS_DELTA Increment of the total number of rows read from the MemStore MINOR_SSSTORE_READ_ROWS_TOTAL Total number of rows read from the MINOR SSStore MINOR_SSSTORE_READ_ROWS_DELTA Increment of the total number of rows read from the MINOR SSStore MAJOR_SSSTORE_READ_ROWS_TOTAL Total number of rows read from the MAJOR SSStore MAJOR_SSSTORE_READ_ROWS_DELTA Increment of the total number of rows read from the MAJOR SSStore RPC_TOTAL Total number of RPCs RPC_DELTA Increment of the number of RPCs FETCHES_TOTAL Total number of result set fetches FETCHES_DELTA Increment of the number of result set fetches RETRY_TOTAL Total number of SQL retries RETRY_DELTA Increment of the number of SQL retries PARTITION_TOTAL Total number of partitions scanned in SQL execution PARTITION_DELTA Increment of the number of partitions scanned in SQL execution NESTED_SQL_TOTAL Total number of nested SQL executions. Increases by 1 for each additional executed sub-SQL NESTED_SQL_DELTA Increment of nested SQL executions SOURCE_IP Source IP address of the request SOURCE_PORT Port number of the request source ROUTE_MISS_TOTAL Total number of times the requested partition was not hit since the OBServer started ROUTE_MISS_DELTA Number of times the requested partition was not hit since the last WR snapshot collection FIRST_LOAD_TIME Planned generation time PLAN_CACHE_hit_TOTAL Total number of times that the plan cache was hit since the OBServer started PLAN_CACHE_HIT_DELTA Number of times that the plan cache was hit since the last WR snapshot collection MUTI_QUERY_TOTAL Number of times this SQL has been located in a multi-query since the plan was generated MUTI_QUERY_DELTA Number of times this SQL has been located in a multi-query since the last WR snapshot collection MUTI_QUERY_BATCH_TOTAL Number of times this SQL batch has been executed since the plan was generated MUTI_QUERY_BATCH_DELTA Number of times this SQL batch has been executed since the last WR snapshot collection FULL_TABLE_SCAN_TOTAL Number of full-table scans performed by this SQL since the plan was generated FULL_TABLE_SCAN_DELTA Number of full-table scans performed by this SQL since the last WR snapshot collection ERROR_COUNT_TOTAL Number of errors reported by this SQL since the plan was generated ERROR_COUNT_DELTA Number of errors reported by this SQL since the last WR snapshot collection SAMPLE_TIME Time when the SQLSTAT snapshot was persisted to disk. The SQLSTAT data may be persisted multiple times within an interval between two WR snapshots. LATEST_ACTIVE_TIME Last active time of the plan corresponding to the SQL ID + Plan Hash on a specific node For more information about the
oceanbase.CDB_WR_SQLSTATview, see oceanbase.CDB_WR_SQLSTAT.Use the
oceanbase.DBA_WR_SQLSTATview to view basic performance statistics of SQL statements executed in the current tenant.In the table, columns with
_DELTAindicate the increment of statistical values from the time of the last WR snapshot collection to the current time.obclient [SYS]> SELECT * FROM SYS.DBA_WR_SQLSTAT WHERE ROWNUM = 1\GThe query result is as follows:
*************************** 1. row *************************** SNAP_ID: 1 SVR_IP: xx.xx.xx.xx SVR_PORT: 2882 SQL_ID: 01058E374A5EF26873BA4D99C4A74582 PLAN_HASH: 5547575357486659143 PLAN_TYPE: 0 MODULE: NULL ACTION: NULL PARSING_DB_ID: 0 PARSING_DB_NAME: NULL PARSING_USER_ID: 0 EXECUTIONS_TOTAL: 1 EXECUTIONS_DELTA: 1 DISK_READS_TOTAL: 0 DISK_READS_DELTA: 0 BUFFER_GETS_TOTAL: 0 BUFFER_GETS_DELTA: 0 ELAPSED_TIME_TOTAL: 1613 ELAPSED_TIME_DELTA: 1613 CPU_TIME_TOTAL: 0 CPU_TIME_DELTA: 0 CCWAIT_TOTAL: 0 CCWAIT_DELTA: 0 USERIO_WAIT_TOTAL: 0 USERIO_WAIT_DELTA: 0 APWAIT_TOTAL: 0 APWAIT_DELTA: 0 PHYSICAL_READ_REQUESTS_TOTAL: 0 PHYSICAL_READ_REQUESTS_DELTA: 0 PHYSICAL_READ_BYTES_TOTAL: 0 PHYSICAL_READ_BYTES_DELTA: 0 WRITE_THROTTLE_TOTAL: 0 WRITE_THROTTLE_DELTA: 0 ROWS_PROCESSED_TOTAL: 0 ROWS_PROCESSED_DELTA: 0 MEMSTORE_READ_ROWS_TOTAL: 0 MEMSTORE_READ_ROWS_DELTA: 0 MINOR_SSSTORE_READ_ROWS_TOTAL: 0 MINOR_SSSTORE_READ_ROWS_DELTA: 0 MAJOR_SSSTORE_READ_ROWS_TOTAL: 0 MAJOR_SSSTORE_READ_ROWS_DELTA: 0 RPC_TOTAL: 0 RPC_DELTA: 0 FETCHES_TOTAL: 0 FETCHES_DELTA: 0 RETRY_TOTAL: 0 RETRY_DELTA: 0 PARTITION_TOTAL: 1 PARTITION_DELTA: 1 NESTED_SQL_TOTAL: 0 NESTED_SQL_DELTA: 0 SOURCE_IP: xx.xx.xx.xx SOURCE_PORT: 2882 ROUTE_MISS_TOTAL: 0 ROUTE_MISS_DELTA: 0 FIRST_LOAD_TIME: 16-MAR-26 04.40.15.465600 PM PLAN_CACHE_HIT_TOTAL: 0 PLAN_CACHE_HIT_DELTA: 0 MUTI_QUERY_TOTAL: 0 MUTI_QUERY_DELTA: 0 MUTI_QUERY_BATCH_TOTAL: 0 MUTI_QUERY_BATCH_DELTA: 0 FULL_TABLE_SCAN_TOTAL: 0 FULL_TABLE_SCAN_DELTA: 0 ERROR_COUNT_TOTAL: 0 ERROR_COUNT_DELTA: 0 SAMPLE_TIME: 16-MAR-26 04.40.15.000000 PM LATEST_ACTIVE_TIME: 16-MAR-26 04.40.15.500910 PM 1 row in set (0.041 sec)The following table describes the fields.
FieldDescriptionSNAP_ID The snapshot ID. SVR_IP The IP address of the node. SVR_PORT The port number of the node. SQL_ID The ID of the SQL statement. PLAN_HASH The hash value of the execution plan. PLAN_ID The ID of the execution plan. PLAN_TYPE For cached SQL plans, this column indicates the plan type: 1: a local plan.2: a remote plan.3: a distributed plan.
For cached PL objects, this column indicates the PL object type:1: a procedure.2: a function.3: a package.4: an anonymous block.
MODULE The application module when the statement was first parsed. Set by using the DBMS_APPLICATION_INFO.SET_MODULEpackage.ACTION The application action when the statement was first parsed. Set by using the DBMS_APPLICATION_INFO.SET_ACTIONpackage.PARSING_DB_ID The database ID when the statement was parsed. PARSING_DB_NAME The name of the database when the statement was parsed. PARSING_USER_ID The user ID when the statement was parsed. EXECUTIONS_TOTAL The total number of executions of the plan in the plan cache. EXECUTIONS_DELTA The increment of the total number of executions of the plan in the plan cache. DISK_READS_TOTAL The total number of disk reads. DISK_READS_DELTA The increment of the number of disk reads. BUFFER_GETS_TOTAL The total number of logical reads from the cache. BUFFER_GETS_DELTA The increment of the number of logical reads from the cache. ELAPSED_TIME_TOTAL The total time consumed by the statement. For parallel execution scenarios, this value is the cumulative value of each execution thread. ELAPSED_TIME_DELTA The increment of the time consumed by the statement. CPU_TIME_TOTAL The total CPU time consumed. CPU_TIME_DELTA The increment of the total CPU time consumed. CCWAIT_TOTAL The total time consumed by concurrency wait events. CCWAIT_DELTA The increment of the total time consumed by concurrency wait events. USERIO_WAIT_TOTAL The total time consumed by I/O waits. USERIO_WAIT_DELTA The increment of the total time consumed by I/O waits. APWAIT_TOTAL The total time consumed by application wait events. APWAIT_DELTA The increment of the total time consumed by application wait events. PHYSICAL_READ_REQUESTS_TOTAL The total number of physical read requests. PHYSICAL_READ_REQUESTS_DELTA The increment of the number of physical read requests. PHYSICAL_READ_BYTES_TOTAL The total number of bytes read during physical reads. PHYSICAL_READ_BYTES_DELTA The increment of the number of bytes read during physical reads. WRITE_THROTTLE_TOTAL The total time throttled when writing to MemStore. WRITE_THROTTLE_DELTA The increment of the total time throttled when writing to MemStore. ROWS_PROCESSED_TOTAL The total number of rows processed by the statement. ROWS_PROCESSED_DELTA The increment of the total number of rows processed by the statement. MEMSTORE_READ_ROWS_TOTAL The total number of rows read from MemStore. MEMSTORE_READ_ROWS_DELTA The increment of the total number of rows read from MemStore. MINOR_SSSTORE_READ_ROWS_TOTAL The total number of rows read from the minor SSStore. MINOR_SSSTORE_READ_ROWS_DELTA The increment of the total number of rows read from the minor SSStore. MAJOR_SSSTORE_READ_ROWS_TOTAL Total rows read from the major SSStore MAJOR_SSSTORE_READ_ROWS_DELTA Incremental total rows read from the major SSStore RPC_TOTAL Total number of RPCs RPC_DELTA Incremental number of RPCs FETCHES_TOTAL Total number of result set fetches FETCHES_DELTA Incremental number of result set fetches RETRY_TOTAL Total number of SQL retries RETRY_DELTA Incremental number of SQL retries PARTITION_TOTAL Total number of partitions scanned in SQL execution PARTITION_DELTA Incremental number of partitions scanned in SQL execution NESTED_SQL_TOTAL Total number of nested SQL executions. Increases by 1 for each additional executed sub-SQL NESTED_SQL_DELTA Incremental number of nested SQL executions SOURCE_IP VARCHAR2(46) SOURCE_PORT Port number of the request source ROUTE_MISS_TOTAL Total number of times the requested partition was not hit since OBServer started ROUTE_MISS_DELTA Number of times the requested partition was not hit since the last WR snapshot collection FIRST_LOAD_TIME Planned generation time PLAN_CACHE_HIT_TOTAL Total number of times that a plan cache hit occurred since OBServer started PLAN_CACHE_HIT_DELTA Number of times that a plan cache hit occurred since the last WR snapshot collection MUTI_QUERY_TOTAL Number of times this SQL has been located in a multi-query since the plan was generated MUTI_QUERY_DELTA Number of times this SQL has been located in a multi-query since the last WR snapshot collection MUTI_QUERY_BATCH_TOTAL Number of times this SQL batch has been executed since the plan was generated MUTI_QUERY_BATCH_DELTA Number of times this SQL batch has been executed since the last WR snapshot collection FULL_TABLE_SCAN_TOTAL Number of full table scans performed by this SQL since the plan was generated FULL_TABLE_SCAN_DELTA Number of full table scans performed by this SQL since the last WR snapshot collection ERROR_COUNT_TOTAL Number of errors reported by this SQL since the plan was generated ERROR_COUNT_DELTA Number of errors reported by this SQL since the last WR snapshot collection SAMPLE_TIME Time when the SQLSTAT snapshot was persisted to disk. An SQLSTAT snapshot may be persisted multiple times within an interval between two WR snapshots. LATEST_ACTIVE_TIME Last active time of the plan corresponding to the SQL ID + Plan Hash on a node For more information about the
DBA_WR_SQLSTATview, see oceanbase.DBA_WR_SQLSTAT.
View OBServer resource group information
Query the
GV$OB_RES_MGR_SYSSTATview for statistics of all resource groups on all OBServer nodes.obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_RES_MGR_SYSSTAT LIMIT 10;The query result is as follows:
+--------+----------+----------------+----------+------------+-----------------------+-------+------------+------------+---------+ | CON_ID | GROUP_ID | SVR_IP | SVR_PORT | STATISTIC# | NAME | CLASS | VALUE | VALUE_TYPE | STAT_ID | +--------+----------+----------------+----------+------------+-----------------------+-------+------------+------------+---------+ | 1 | 0 | xx.xx.xx.xx | 2882 | 0 | rpc packet in | 1 | 12995014 | ADD_VALUE | 10000 | | 1 | 0 | xx.xx.xx.xx | 2882 | 1 | rpc packet in bytes | 1 | 3080600714 | ADD_VALUE | 10001 | | 1 | 0 | xx.xx.xx.xx | 2882 | 2 | rpc packet out | 1 | 7975192 | ADD_VALUE | 10002 | | 1 | 0 | xx.xx.xx.xx | 2882 | 3 | rpc packet out bytes | 1 | 2401633337 | ADD_VALUE | 10003 | | 1 | 0 | xx.xx.xx.xx | 2882 | 4 | rpc deliver fail | 1 | 0 | ADD_VALUE | 10004 | | 1 | 0 | xx.xx.xx.xx | 2882 | 5 | rpc net delay | 1 | 23735015 | ADD_VALUE | 10005 | | 1 | 0 | xx.xx.xx.xx | 2882 | 6 | rpc net frame delay | 1 | 240711 | ADD_VALUE | 10006 | | 1 | 0 | xx.xx.xx.xx | 2882 | 7 | mysql packet in | 1 | 66 | ADD_VALUE | 10007 | | 1 | 0 | xx.xx.xx.xx | 2882 | 8 | mysql packet in bytes | 1 | 13725 | ADD_VALUE | 10008 | | 1 | 0 | xx.xx.xx.xx | 2882 | 9 | mysql packet out | 1 | 86 | ADD_VALUE | 10009 | +--------+----------+----------------+----------+------------+-----------------------+-------+------------+------------+---------+ 10 rows in set (0.026 sec)The following table describes the fields.
FieldDescriptionCON_ID Tenant ID GROUP_ID Consumer Group ID SVR_IP Node IP SVR_PORT Node PORT STATISTIC# Statistics number NAME Statistics name CLASS Statistics category VALUE Statistics value VALUE_TYPE Value type: cumulative or assignment type STAT_ID Statistics ID For more information about the
GV$OB_RES_MGR_SYSSTATview, see GV$OB_RES_MGR_SYSSTAT.Query the
V$OB_RES_MGR_SYSSTATview for statistics of the current resource group on the current OBServer node.obclient [oceanbase]> SELECT * FROM oceanbase.V$OB_RES_MGR_SYSSTAT LIMIT 10;The query result is as follows:
+--------+----------+----------------+----------+------------+-----------------------+-------+------------+------------+---------+ | CON_ID | GROUP_ID | SVR_IP | SVR_PORT | STATISTIC# | NAME | CLASS | VALUE | VALUE_TYPE | STAT_ID | +--------+----------+----------------+----------+------------+-----------------------+-------+------------+------------+---------+ | 1 | 0 | xx.xx.xx.xx | 2882 | 0 | rpc packet in | 1 | 13010269 | ADD_VALUE | 10000 | | 1 | 0 | xx.xx.xx.xx | 2882 | 1 | rpc packet in bytes | 1 | 3084188226 | ADD_VALUE | 10001 | | 1 | 0 | xx.xx.xx.xx | 2882 | 2 | rpc packet out | 1 | 7984551 | ADD_VALUE | 10002 | | 1 | 0 | xx.xx.xx.xx | 2882 | 3 | rpc packet out bytes | 1 | 2404425894 | ADD_VALUE | 10003 | | 1 | 0 | xx.xx.xx.xx | 2882 | 4 | rpc deliver fail | 1 | 0 | ADD_VALUE | 10004 | | 1 | 0 | xx.xx.xx.xx | 2882 | 5 | rpc net delay | 1 | 23766006 | ADD_VALUE | 10005 | | 1 | 0 | xx.xx.xx.xx | 2882 | 6 | rpc net frame delay | 1 | 241049 | ADD_VALUE | 10006 | | 1 | 0 | xx.xx.xx.xx | 2882 | 7 | mysql packet in | 1 | 69 | ADD_VALUE | 10007 | | 1 | 0 | xx.xx.xx.xx | 2882 | 8 | mysql packet in bytes | 1 | 13871 | ADD_VALUE | 10008 | | 1 | 0 | xx.xx.xx.xx | 2882 | 9 | mysql packet out | 1 | 142 | ADD_VALUE | 10009 | +--------+----------+----------------+----------+------------+-----------------------+-------+------------+------------+---------+ 10 rows in set (0.007 sec)The following table describes the fields.
FieldDescriptionCON_ID Tenant ID GROUP_ID Consumer Group ID SVR_IP Node IP SVR_PORT Node PORT STATISTIC# Statistics number NAME Statistics name CLASS Statistics category VALUE Statistics value VALUE_TYPE Value type: cumulative or assignment type STAT_ID Statistics ID For more information about the
V$OB_RES_MGR_SYSSTATview, see V$OB_RES_MGR_SYSSTAT.