Oracle 参数 OPTIMIZER_USE_SQL_QUARANTINE 官方解释,作用,如何配置最优化建议
本站中文解释
OPTIMIZER_USE_SQL_QUARANTINE参数指定在运行时是否启用SQL隔离能力。
SQL隔离能力提供一种更精细的控制,以更具体的细节来优化运行SQL语句。特别是,它可以避免某些不好的行为,如传递硬编码值(而不是变量)给优化器,优化器以不理想的方式运行SQL时。
SQL隔离功能可以通过将OPTIMIZER_USE_SQL_QUARANTINE参数设置为TRUE来启用,它可以通过将其设置为FALSE来禁用。它是Oracle Database 11g中引入的新参数,默认值为FALSE。
如果需要启用此参数,可以使用以下语句:
ALTER SESSION SET OPTIMIZER_USE_SQL_QUARANTINE = TRUE;
要禁用它,可以使用以下语句:
ALTER SESSION SET OPTIMIZER_USE_SQL_QUARANTINE = FALSE;
官方英文解释
OPTIMIZER_USE_SQL_QUARANTINE
determines whether the optimizer considers SQL Quarantine configurations when choosing an execution plan for a SQL statement.
Property | Description |
---|---|
Parameter type |
Boolean |
Default value |
|
Modifiable |
|
Modifiable in a PDB |
Yes |
Range of values |
|
Basic |
No |
Oracle RAC |
Different instances can use different values. |
Values:
-
true
The optimizer considers SQL Quarantine configurations when choosing an execution plan for a SQL statement. The statement will be terminated if it would otherwise use a quarantined execution plan.
-
false
The optimizer ignores SQL Quarantine configurations when choosing an execution plan for a SQL statement. It may use any execution plan, regardless of its quarantine status.
Note:
This parameter is available starting with Oracle Database 21c.
See Also:
-
“DBA_SQL_QUARANTINE”
-
“OPTIMIZER_CAPTURE_SQL_QUARANTINE”
-
Oracle Database SQL Tuning
Guide for more information about SQL Quarantine