ITPub博客

首页 > Linux操作系统 > Linux操作系统 > SQL Tuning Advisor

SQL Tuning Advisor

原创 Linux操作系统 作者:Damon__Li 时间:2012-06-13 15:36:47 0 删除 编辑

使用SQL Tuning Advisor必须保证优化器是CBO模式,用户被赋予advisor权限

1、创建优化任务

       DBMS_SQLTUNE.create_tuning_task(

                                                   sql_text=>'' 调整的SQL,

                                                    bind_list=>'' 绑定变量,

                                                     user_name=>'' 调整用户,

                                                     scope=>'' tuning scope(limited/comprehensive),

                                                      time_limit=>'',

                                                       task_name=>'' 任务名称,

                                                        description=>);

2、执行任务

      DBMS_SQLTUNE.execute_tuning_task(task_name=>'');

3、查看优化任务情况

        dba_advisor_tasks、user_advisor_tasks

4、查看优化结果

      需要设置如下:set long 999999

                                   set LONGCHUNKSIZE 999999   

                                   set serveroutput on size 999999

                                   set linesize 200

       select DBMS_SQLTUNE.report_tuning_task('task_name') from dual;                               

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25725504/viewspace-732694/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-04-25

  • 博文量
    25
  • 访问量
    61270