Note
This view is available starting with V4.2.0.
Purpose
The DBA_OB_TENANT_EVENT_HISTORY view displays the operation records of the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TIMESTAMP | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | The execution time, 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 | Additional information. |
| SVR_IP | VARCHAR2(46) | YES | The IP address of the OBServer node where the action was executed. |
| SVR_PORT | NUMBER(38) | YES | The port number of the OBServer node where the action was executed. |
| TRACE_ID | VARCHAR2(64) | YES | The Trace ID of the action. |
| COST_TIME | NUMBER(38) | YES | The time consumed by the action. |
| RET_CODE | NUMBER(38) | YES | The error code of the action. 0 indicates that the action was successful. |
| ERROR_MSG | VARCHAR2(512) | YES | The error message returned when the action failed. |
Example of typical tenant events
The typical tenant event module includes: TENANT ROLE CHANGE (tenant role change) and SERVICE NAME (service name).
The NAME and VALUE values of the events vary depending on the module operations performed by the user.
TENANT ROLE CHANGE
The TENANT ROLE CHANGE module contains the following three operations: FAILOVER TO PRIMARY, SWITCHOVER TO PRIMARY, and SWITCHOVER TO STANDBY.
FAILOVER TO PRIMARY operation
When a user initiates a
FAILOVER TO PRIMARYoperation, the following important events are recorded in the tenant event log table.FAILOVER TO PRIMARY START
This event records the specific time when the
ALTER SYSTEM ACTIVATE STANDBYcommand is executed and the relevant tenant information.Attribute Value NAME1: STMT_STR VALUE1: The text of the command entered by the user. NAME2: TENANT_INFO VALUE2: The status or information of the tenant at the time the command was initiated. FAILOVER TO PRIMARY END
This event records the exact time when the
ALTER SYSTEM ACTIVATE STANDBYcommand is completed, including the relevant information of the tenant, the final status of the log stream, and the time spent on key steps.Attribute Value NAME1: STMT_STR VALUE1: The text of the command entered by the user. NAME2: TENANT_INFO VALUE2: The status or information of the tenant at the end of the command. NAME3: FAILOVER_SCN VALUE3: The synchronization point after the tenant fails over. NAME4: COST_DETAIL VALUE4: The time spent on each stage during command execution, in microseconds. NAME5: ALL_LS VALUE5: The status of all log streams when the tenant modifies the ACCESS MODE.
SWITCHOVER TO PRIMARY operation
When a user initiates a
SWITCHOVER TO PRIMARYoperation, the following important events are recorded in the tenant event log table.SWITCHOVER TO PRIMARY START
This event records the specific time when the
ALTER SYSTEM SWITCHOVER TO PRIMARYcommand is executed and the relevant tenant information.Attribute Value NAME1: STMT_STR VALUE1: The text of the command entered by the user. NAME2: TENANT_INFO VALUE2: The status or information of the tenant at the time the command was initiated. WAIT LOG SYNC
This event records the information about log synchronization for the tenant. When a user executes the
ALTER SYSTEM SWITCHOVER TO PRIMARYcommand, the involved tenant must wait until all the latest log records are synchronized from the current primary tenant to ensure data consistency and integrity.Attribute Value NAME1: IS_SYS_LS_SYNCED VALUE1: Indicates whether the system log stream is synchronized. NAME2: IS_ALL_LS_SYNCED VALUE2: Indicates whether all log streams are synchronized. NAME3: NON_SYNC_INFO VALUE3: If any log streams are not synchronized, the system displays the number of such log streams and provides information about the five slowest-synchronizing log streams. SWITCHOVER_TO_PRIMARY_END
This event records the exact time when the
ALTER SYSTEM SWITCHOVER TO PRIMARYcommand is completed, including the relevant information of the tenant, the final status of the log stream, and the time spent on key steps.Attribute Value NAME1: STMT_STR VALUE1: The text of the command entered by the user. NAME2: TENANT_INFO VALUE2: The status or information of the tenant at the end of the command. NAME3: SWITCHOVER_SCN VALUE3: The synchronization point after the tenant is switched to the primary tenant. NAME4: COST_DETAIL VALUE4: The time spent on each stage during command execution, in microseconds. NAME5: ALL_LS VALUE5: The status of all log streams when the tenant modifies the ACCESS MODE.
SWITCHOVER TO STANDBY operation
When a user initiates a
SWITCHOVER TO STANDBYoperation, the following important events are recorded in the tenant event log table.SWITCHOVER TO STANDBY START
This event records the specific time when the
ALTER SYSTEM SWITCHOVER TO STANDBYcommand is executed and the relevant tenant information.Attribute Value NAME1: STMT_STR VALUE1: The text of the command entered by the user. NAME2: TENANT_INFO VALUE2: The status or information of the tenant at the time the command was initiated. SWITCHOVER TO STANDBY END
This event records the exact time when the
ALTER SYSTEM SWITCHOVER TO STANDBYcommand is completed, including the relevant information of the tenant, the final status of the log stream, and the time spent on key steps.Attribute Value NAME1: STMT_STR VALUE1: The text of the command entered by the user. NAME2: TENANT_INFO VALUE2: The status or information of the tenant at the end of the command. NAME3: SWITCHOVER_SCN VALUE3: The synchronization point after the tenant is switched to the standby tenant. NAME4: COST_DETAIL VALUE4: The time spent on each stage during command execution, in microseconds. NAME5: ALL_LS VALUE5: The status of all log streams when the tenant modifies the ACCESS MODE.
SERVICE NAME
The SERVICE NAME module contains the CREATE SERVICE, DELETE SERVICE, START SERVICE, and STOP SERVICE operations.
You can use TRACE_ID to query these operations. For example, you can find the event of creating a service and trace the broadcast triggered by the event based on the TRACE_ID of the event.
CREATE SERVICE
When a user tenant initiates a service creation, the following event is recorded.
BROADCAST SERVICE NAME
This event records the content of the broadcast, the list of OBServer nodes that receive the broadcast, and the list of OBServer nodes that successfully receive the broadcast. When you execute the
ALTER SYSTEM CREATE SERVICEcommand, the OBServer node that initiates the command broadcasts the current service name of the tenant to all OBServer nodes where the units of the tenant are located.Attribute Attribute Value NAME1: EPOCH VALUE1: the version of the current service name information of the tenant for the current broadcast NAME2: TARGET_SERVICE_NAME_ID VALUE2: the service_name_idof the event that triggers the current broadcastNAME3: SERVICE_NAME_LIST VALUE3: the current service name information of the tenant NAME4: SERVICE_NAME_COMMAND_TYPE VALUE4: the operation type that triggers the current broadcast NAME5: TARGET_SERVERS_LIST VALUE5: the OBServer nodes that receive the broadcast, which are all non-permanently offline nodes where the units of the tenant are located NAME6: SUCCESS_SERVERS_LIST VALUE6: the OBServer nodes that successfully receive the broadcast CREATE SERVICE
This event records the name of the service to be created and the detailed information of the service after it is created. This event is generated after the execution of the
ALTER SYSTEM CREATE SERVICEcommand initiated by the user.Attribute Attribute Value NAME1: SERVICE_NAME_STRING VALUE1: the name of the new service to be created NAME2: CREATED_SERVICE_NAME VALUE2: the service name information after the service is created
DELETE SERVICE
When a user tenant initiates a service deletion, the following event is recorded.
DELETE SERVICE
This event records the information at the time when the command is initiated. This event is generated after the execution of the
ALTER SYSTEM DELETE SERVICEcommand initiated by the user.Attribute Attribute Value NAME1: DELETED_SERVICE_NAME VALUE1: the service name information to be deleted
START SERVICE
When a user tenant initiates a service start, the following event is recorded.
BROADCAST SERVICE NAME
This event records the content of the broadcast, the list of OBServer nodes that receive the broadcast, and the list of OBServer nodes that successfully receive the broadcast. When you execute the
ALTER SYSTEM SERVICE NAMEcommand, the OBServer node that initiates the command broadcasts the current service name of the tenant to all OBServer nodes where the units of the tenant are located.Attribute Attribute Value NAME1: EPOCH VALUE1: the version of the current service name information of the tenant for the current broadcast NAME2: TARGET_SERVICE_NAME_ID VALUE2: the service _name _idof the event that triggers the current broadcastNAME3: SERVICE_NAME_LIST VALUE3: the current service_nameof the tenantNAME4: SERVICE_NAME_COMMAND_TYPE VALUE4: the operation type that triggers the current broadcast NAME5: TARGET_SERVERS_LIST VALUE5: the OBServer nodes that receive the broadcast, which are all non-permanently offline nodes where the units of the tenant are located NAME6: SUCCESS_SERVERS_LIST VALUE6: the OBServer nodes that successfully receive the broadcast START SERVICE
This event records the information at the time when the command is initiated and the time when the command is completed. This event is generated after the execution of the
ALTER SYSTEM START SERVICEcommand initiated by the user.Attribute Attribute Value NAME1: SERVICE_NAME_BEFORE VALUE1: the service name information before the service is started NAME2: SERVICE_NAME_AFTER VALUE2: the service name information after the service is started
STOP SERVICE
When a user tenant initiates a service stop, the following event is recorded.
KILL CONNECTIONS OF SERVICE NAME
Each OBServer node terminates the connections established through the service name that is being stopped and generates a record in the tenant event view. If no connections are established through the service name that is being stopped on an OBServer node, the event is not recorded in the table.
Attribute Attribute Value NAME1: SERVICE_NAME VALUE1: the service name information of the service to be stopped NAME2: KILLED_CONNECTIONS_COUNT VALUE2: the number of connections that are terminated NAME3: KILLED_CONNECTIONS_LIST VALUE3: the IDs of the connections that are terminated BROADCAST SERVICE NAME
This event records the content of the broadcast, the list of OBServer nodes that receive the broadcast, and the list of OBServer nodes that successfully receive the broadcast. When you execute the
ALTER SYSTEM STOP SERVICEcommand, the OBServer node that initiates the command broadcasts the current service name of the tenant to all OBServer nodes where the units of the tenant are located.Attribute Attribute Value NAME1: EPOCH VALUE1: the version of the current service name information of the tenant for the current broadcast NAME2: TARGET_SERVICE_NAME _ID VALUE2: the service _name _idof the event that triggers the current broadcastNAME3: SERVICE_NAME_LIST VALUE3: the current service_nameof the tenantNAME4: SERVICE_NAME_COMMAND_TYPE VALUE4: the operation type that triggers the current broadcast NAME5: TARGET_SERVERS_LIST VALUE5: the OBServer nodes that receive the broadcast, which are all non-permanently offline nodes where the units of the tenant are located NAME6: SUCCESS_SERVERS_LIST VALUE6: the OBServer nodes that successfully receive the broadcast STOP SERVICE
This event records the information at the time when the command is initiated and the time when the command is completed. This event is generated after the execution of the
ALTER SYSTEM STOP SERVICEcommand initiated by the user.Attribute Attribute value NAME1: SERVICE_NAME_BEFORE VALUE1: Information about the service name before the service is stopped. NAME2: SERVICE_NAME_AFTER VALUE2: Information about the service name after the service is stopped.
Sample query
Query the history operation records of the current tenant and display the first record.
obclient [SYS]> 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