Manage Runaway SQL Statements on Autonomous AI Database
Specifies how you configure Autonomous AI Database to terminate SQL statements automatically based on their query runtime or their IO usage.
You can set runtime run-away rules for query run time and IO usage in Database
Actions or using the PL/SQL package CS_RESOURCE_MANAGER.
Follow these steps to use Database Actions to set runtime usage rules:
When a SQL statement in the specified consumer group runs more than the specified runtime limit or does more IO than the specified amount, then the SQL statement will be terminated.
Click Load Default Values to load the default values; then click Save Changes to apply the populated values.
You can also use the procedure CS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE to set these rules.
Note:
The example shown below can only be used to update default predefined plans that come with Autonomous Database, that is,DWCS_PLAN and OLTP_PLAN. You cannot use UPDATE_PLAN_DIRECTIVE to update the settings for custom plans. To update a custom user-defined plan attributes, use the UPDATE_PLAN_DIRECTIVE_ADV procedure. See UPDATE_PLAN_DIRECTIVE_ADV Procedure for details.
For example, to set a runtime limit of 120 seconds and an IO limit of 1000MB for the HIGH consumer group run the following command when connected to the database as the ADMIN user:
BEGIN
CS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE(consumer_group => 'HIGH', io_megabytes_limit => 1000, elapsed_time_limit => 120);
END;
/
To reset the values and lift the limits, you can set the values to null:
BEGIN
CS_RESOURCE_MANAGER.UPDATE_PLAN_DIRECTIVE(consumer_group => 'HIGH', io_megabytes_limit => null, elapsed_time_limit => null);
END;
/
See CS_RESOURCE_MANAGER Package for more information.