About Me.

My self Adinarayana working as Implementation Application DBA with advanced technologies like RAC/PCP,OID/SSO,DMZ,Exadata and Fusion Middleware i.e Demantra,Application Server,SOA,FMW,BPEL and UPK. Created this blog to share the useful information related to DBA and Application DBA Your comments and suggestions are most welcome. Disclaimer: Please note all the views and opinions expressed in this site are my own. It's not recommend to use the fixes/suggestions provided in this site directly in production instance, please test them before implementing.

Monday, July 22, 2013

SQL Advisor

1.Creating Task Name:
---------------------

 SQL> SET SERVEROUTPUT ON
declare
stmt_task VARCHAR2(100);
begin
stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id => 'dfaw5z40nt5ww',time_limit  => 3600);
DBMS_OUTPUT.put_line('task_id: ' || stmt_task );
end;
/SQL>   2    3    4    5    6    7
task_id: TASK_7019

PL/SQL procedure successfully completed.


2.Tuning the Task:
------------------

SQL> EXEC DBMS_SQLTUNE.EXECUTE_TUNING_TASK(task_name => 'TASK_174021');

PL/SQL procedure successfully completed.


3.Generating the sql tuned report:
----------------------------------

SET linesize 200
SET LONG 999999999
SET pages 1000
SET longchunksize 20000
SELECT dbms_sqltune.report_tuning_task('TASK_174021', 'TEXT', 'ALL') FROM dual;

No comments:

Post a Comment