ORA-01422:和ORA-06512:接受sql profile - tunning advisor

时间:2018-05-15 07:06:46

标签: oracle

我在接受SQL配置文件时遇到以下错误。我重复了调优顾问,我仍然收到错误。

begin
    dbms_sqltune.accept_sql_profile
    ( task_name => 'task_0123456', task_owner => 'TEST', replace => TRUE );
end;

ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 16446
ORA-06512: at "SYS.PRVT_SQLPROF_INFRA", line 31
ORA-06512: at "SYS.DBMS_SQLTUNE", line 7544
ORA-06512: at "SYS.DBMS_SQLTUNE", line 7568
ORA-06512: at line 2

以下是步骤:

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

EXEC DBMS_SQLTUNE.execute_tuning_task(task_name => 'task_0123456')
/
select dbms_sqltune.report_tuning_task('task_0123456') from dual
/

这是报告

1- SQL Profile Finding (see explain plans section below)
--------------------------------------------------------
  A potentially better execution plan was found for this statement.

  Recommendation (estimated benefit: 99.52%)
  ------------------------------------------
  - Consider accepting the recommended SQL profile.
    execute dbms_sqltune.accept_sql_profile(task_name =>
            'task_0123456', task_owner => 'TEST', replace => TRUE);

知道错误背后的原因吗?

0 个答案:

没有答案