为什么SQL_PROFILE没有显示建议?

时间:2014-01-31 17:10:30

标签: sql performance oracle oracle11g profiling

我正在尝试从sqlplus运行sql tuning advisor。我按照以下步骤创建

使用SQL_ID创建调优任务:

DECLARE
  l_sql_tune_task_id  VARCHAR2(100);
BEGIN
  l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
                          sql_id      => '19v5guvsgcd1v',
                          scope       => DBMS_SQLTUNE.scope_comprehensive,
                          time_limit  => 60,
                          task_name   => '19v5guvsgcd1v_tuning_task',
                          description => 'Tuning task for statement 19v5guvsgcd1v.');
  DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
/

执行调整:

EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => '19v5guvsgcd1v_tuning_task');

检查报告:

SET PAGESIZE 10000
SET LINESIZE 20000
SELECT DBMS_SQLTUNE.report_tuning_task('19v5guvsgcd1v_tuning_task') AS recommendations FROM dual;
SET PAGESIZE 24

当我运行创建调优任务块并执行调整任务时,它们已成功完成,但当我尝试查看建议时,我看到空白报告。但是当我从SQL Developer运行sql tuning advisor(sql tuning advisor Icon)时,它提出了2条建议。但是当我在Sqlplus中运行时,为什么我无法看到它。

1 个答案:

答案 0 :(得分:3)

添加SET LONG

   SQL> set long 2000000000