Posts

Showing posts with the label Automatic SQL Tuning in Oracle Database

Automatic SQL Tuning in Oracle Database

This article is about automatic Sql Tunning in Oracle database, it is available from 10g version. First step is to create the tunning task. To do that we need to know sql_id of the query, a begin snapshot and end snapshot in which this query was executed: SQL> DECLARE l_sql_tune_task_id VARCHAR2(100); BEGIN l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task ( 2 3 begin_snap => 27409 , end_snap => 27451 , sql_id => '6ay80wrrk0a5w' , scope => DBMS_SQLTUNE.scope_comprehensive, time_limit => 560, task_name => '6ay80wrrk0a5w_AWR_tuning_task', description => 'Tuning task for statement 6ay80wrrk0a5w in AWR.'); DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id); END; / 4 5 6 7 8 9 10 11 12 ...