【筆記】sql tuning advidor

yellowlee發表於2010-01-31

declare

    l_task_id     varchar2(20);

   l_sql         varchar2(2000);

begin

   l_sql := 'select * from test.t_test_resumable where wner = ''SYS''';

   dbms_sqltune.drop_tuning_task ('FOLIO_COUNT');

   l_task_id := dbms_sqltune.create_tuning_task (

      sql_text  => l_sql,

      user_name  => 'TEST',

      scope      => 'COMPREHENSIVE',

      time_limit => 120,

      task_name  => 'FOLIO_COUNT'

   );

   dbms_sqltune.execute_tuning_task ('FOLIO_COUNT');

end;

/
insert into test.t_test_resumable select * from test.t_test_resumable ;

select count(*) from test.t_test_resumable;

select * from test.t_test_resumable where wner = 'SYS';
select dbms_sqltune.report_tuning_task ('FOLIO_COUNT') from dual;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/16179598/viewspace-626489/,如需轉載,請註明出處,否則將追究法律責任。

相關文章