Note
This variable was introduced in OceanBase Database V4.2.4.
Description
enable_sql_plan_monitor specifies whether to record SQL statements of the current session to SQL plan monitor.
Limitations
Query the variable
In the
systenant or a user tenant, you can execute theSHOW VARIABLESstatement to query the variable at the session level or query theSYS.TENANT_VIRTUAL_SESSION_VARIABLEview (in Oracle mode) orinformation_schema.SESSION_VARIABLESview (in MySQL mode) for the variable at the session level.Modify the variable
In the
systenant or a user tenant, you can directly change the value of the variable at the session level for the current tenant.
Attributes
| Attribute | Description |
|---|---|
| Type | Boolean |
| Default value | False |
| Value range | False: SQL statements executed in the current session are recorded to the SQL plan monitor when any of the following conditions is met:
Ture: All SQL statements executed in the current session are recorded to the SQL plan monitor by default. |
| Effective scope | Session |
| Plan generation affected | Yes |
| Modifiable | Yes. You can use the SET statement to modify the variable. |
Examples
Specify to record all SQL statements of the current session to the SQL plan monitor.
obclient> SET enable_sql_plan_monitor =Ture;