Are you looking for a method to stop automatic SQL quarantine without disabling the entire SQL Quarantine feature ? Welcome to Oracle 21c …
Posted by FatDBA on September 23, 2022
Hi All,
Recently I was working on a 21c database for a POC where at one point I want to disable automatic creation of SQL Quarantine, but without disabling the entire statement Quarantine feature. This 21.3.0.0.0 Database had got the resource manager enabled, and one of the SQL was taking long time to complete, longer than the allowed directive limits on IO & CPU TIME, and as expected the SQL was killed with message “ORA-00040: active time limit exceeded – call aborted” and the SQL plan was quarantined. I wanted to stop or disable the auto creation of SQL Quarantines for the SQL in question, after RM terminates the SQL.
If you want to read more about SQL Quarantine, please click this link to my earlier post with a demo about it.
I remember in 19c there wasn’t any way to achieve that and can only regulate behavior using two of the underscore parameters _quarantine_enabled or _optimizer_quarantine_sql. Oracle 21c has introduced two two new parameters to control the behavior of SQL Quarantine, and that specially solves this issue.
First one is optimizer_capture_sql_quarantine, if set to FALSE, would disable the automatic creation of SQL Quarantine configurations after RM termination of a SQL query execution. This is FALSE by default.
The second parameter is optimizer_use_sql_quarantine, if set to FALSE would disable the use of existing SQL Quarantine configurations in a database. This parameter determines whether the optimizer considers SQL Quarantine configurations when choosing an execution plan for a SQL statement. This is TRUE by default, thereby allowing users to manually create and use SQL Quarantine configurations.
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
-- Default Setting
SQL> show parameter OPTIMIZER_CAPTURE_SQL_QUARANTINE
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
optimizer_capture_sql_quarantine boolean FALSE
SQL>
SQL>
-- Default Setting
SQL> sho parameter OPTIMIZER_USE_SQL_QUARANTINE
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
optimizer_use_sql_quarantine boolean TRUE
SQL>
SQL>
Hope It Helped!
Prashant Dixit
Leave a Reply