The SET_OPT_TRACE_PARAMETER procedure is used to modify the parameters of full-link tracing for the optimizer in the current session.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
DBMS_XPLAN.SET_OPT_TRACE_PARAMETER(
sql_id IN VARCHAR2 DEFAULT '',
identifier IN VARCHAR2 DEFAULT DEFAULT_INENTIFIER,
level IN INT DEFAULT DEFAULT_LEVEL
);
Parameters
| Parameter | Description |
|---|---|
| sql_id | Specifies the SQL statement to be traced. For example, if you want to trace only specific SQL statements within a PL/SQL function during a test, you can set the sql_id parameter. Once set, only the specified SQL statements will be traced; otherwise, all SQL statements will be traced. |
| identifier | Specifies the suffix of the trace file, making it easier for users to locate their trace files. |
| level | Specifies the tracing level:
Notice: level is a database keyword. In an Oracle tenant, it must be enclosed in double quotation marks (""). In a MySQL tenant, it must be enclosed in backticks (`). |
Examples
Set the level and the suffix of the trace log file.
obclient> CALL DBMS_XPLAN.SET_OPT_TRACE_PARAMETER(identifier=>'trace_test', "level"=>2);
Query OK, 0 rows affected
