Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
29 views1 page

14 SQL Tuning Advisor

The document outlines the process of using the SQL tuning advisor for a specific SQL statement identified by the SQL ID '87s8z2zzpsg88'. It includes steps to create a tuning task, execute it, retrieve the tuning report, list existing tuning tasks, and drop a tuning task. The recommendations from the advisor may include creating indexes or accepting a SQL profile to enhance query performance.

Uploaded by

Mushtaq Niazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

14 SQL Tuning Advisor

The document outlines the process of using the SQL tuning advisor for a specific SQL statement identified by the SQL ID '87s8z2zzpsg88'. It includes steps to create a tuning task, execute it, retrieve the tuning report, list existing tuning tasks, and drop a tuning task. The recommendations from the advisor may include creating indexes or accepting a SQL profile to enhance query performance.

Uploaded by

Mushtaq Niazi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

When we run SQL tuning advisor against a SQL statement or sql_id,

it provides tuning recommendations that can be done that query to improve


performance.
It might give suggestion to create few indexes or accepting a SQL profile.

Suppose the sql id is – 87s8z2zzpsg88

1. Create Tuning Task

DECLARE
l_sql_tune_task_id VARCHAR2(100);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
sql_id => '87s8z2zzpsg88',
scope => DBMS_SQLTUNE.scope_comprehensive,
time_limit => 500,
task_name => '87s8z2zzpsg88_tuning_task11',
description => 'Tuning task1 for statement 87s8z2zzpsg88');
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
/

2. Execute Tuning task:

EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '87s8z2zzpsg88_tuning_task11');

3. Get the Tuning advisor report.

select dbms_sqltune.report_tuning_task('87s8z2zzpsg88_tuning_task11') from dual;

4. Get list of tuning task present in database:

SELECT TASK_NAME, STATUS FROM DBA_ADVISOR_LOG

5. Drop a tuning task:

execute dbms_sqltune.drop_tuning_task('87s8z2zzpsg88_tuning_task11');

You might also like