Note
This view is introduced since OceanBase Database V4.2.0.
Purpose
The DBA_OB_TENANT_EVENT_HISTORY view displays the historical operation records of the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TIMESTAMP | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | The time when the operation was executed, in microseconds. |
| MODULE | VARCHAR2(256) | NO | The name of the module. |
| EVENT | VARCHAR2(256) | NO | The name of the event. |
| NAME1 | VARCHAR2(256) | YES | The name of the first attribute. |
| VALUE1 | CLOB | YES | The value of the first attribute. |
| NAME2 | VARCHAR2(256) | YES | The name of the second attribute. |
| VALUE2 | CLOB | YES | The value of the second attribute. |
| NAME3 | VARCHAR2(256) | YES | The name of the third attribute. |
| VALUE3 | CLOB | YES | The value of the third attribute. |
| NAME4 | VARCHAR2(256) | YES | The name of the fourth attribute. |
| VALUE4 | CLOB | YES | The value of the fourth attribute. |
| NAME5 | VARCHAR2(256) | YES | The name of the fifth attribute. |
| VALUE5 | CLOB | YES | The value of the fifth attribute. |
| NAME6 | VARCHAR2(256) | YES | The name of the sixth attribute. |
| VALUE6 | CLOB | YES | The value of the sixth attribute. |
| EXTRA_INFO | CLOB | YES | The additional information. |
| SVR_IP | VARCHAR2(46) | YES | The IP address of the OBServer node on which the operation was executed. |
| SVR_PORT | NUMBER(38) | YES | The port number of the OBServer node on which the operation was executed. |
| TRACE_ID | VARCHAR2(64) | YES | The trace ID of the operation. |
| COST_TIME | NUMBER(38) | YES | The time taken to execute the operation. |
| RET_CODE | NUMBER(38) | YES | The error code for the operation. The value 0 indicates that the operation was successfully executed. |
| ERROR_MSG | VARCHAR2(512) | YES | The error message. |
Sample query
obclient [oceanbase]> SELECT * FROM SYS.DBA_OB_TENANT_EVENT_HISTORY WHERE ROWNUM = 1\G
The query result is as follows:
*************************** 1. row ***************************
TIMESTAMP: 2023-12-14 14:33:20.321725
MODULE: TENANT ROLE CHANGE
EVENT: SWITCHOVER TO STANDBY END
NAME1: STMT_STR
VALUE1: ALTER SYSTEM SWITCHOVER TO STANDBY TENANT backup_mysql_tenant
NAME2: TENANT_INFO
VALUE2: {tenant_id:1002, tenant_role:"STANDBY", switchover_status:"NORMAL", switchover_epoch:1702535600271677, sync_scn:1702535620070597000, replayable_scn:1702535620070597000, readable_scn:1702535620070597000, recovery_until_scn:4611686018427387903, log_mode:"ARCHIVELOG", max_ls_id:1003}
NAME3: SWITCHOVER_SCN
VALUE3: 1702535620070597000
NAME4: COST_DETAIL
VALUE4: WAIT_LOG_END: 100190, CHANGE_ACCESS_MODE: 47261, OTHERS: 136839
NAME5: ALL_LS
VALUE5: NORMAL: 1, 1001, 1002, 1003
NAME6: NULL
VALUE6:
EXTRA_INFO: NULL
SVR_IP: 100.xx.xx.xx
SVR_PORT: 13324
TRACE_ID: Y340C64586BD4-00060C724AEB962B-0-0
COST_TIME: 284290
RET_CODE: 0
ERROR_MSG: NULL
1 row in set