1
resposta

Erro ao executar DBMS_ADVISOR.QUICK_TUNE

Ao tentar executar isso:

DECLARE
  task_name VARCHAR2(30);
BEGIN
  task_name := 'My Task';

  DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR, task_name, 'select * from tt_grid_det');
END;
/

Deu erro: Error report - ORA-13600: error encountered in Advisor ORA-13635: The value provided for parameter _PA_LIST_BUCKET_MIN_FREQ cannot be converted to a number. ORA-06512: at "SYS.PRVT_ACCESS_ADVISOR", line 1809 ORA-06512: at "SYS.WRI$_ADV_SQLACCESS_ADV", line 180 ORA-06512: at "SYS.PRVT_ADVISOR", line 3678 ORA-06512: at "SYS.DBMS_ADVISOR", line 711 ORA-06512: at line 6

  1. 00000 - "error encountered in Advisor\n%s"

*Cause: An error occurred in the Advisor. This message will be followed by a second message giving more details about the nature of the error. *Action: See the Advisor documentation for an explanation of the second error message.

1 resposta

Olá Rodolfo, tudo bem?

Peço desculpas pela demora no retorno, não entendi muito bem a lógica da sua query, pois para utilizar o SQL Access Advisor você não precisa realizar a declaração de uma variável como na utilização do SQL Tunning Advisor, pois será utilizada uma variável interna, como a DBMS_ADVISOR.SQLACCESS_ADVISOR, em seguida você precisa passar o nome da tarefa entre aspas simples e por último o comando que você quer otimizar, dessa forma:

Execute DBMS_ADVISOR.QUICK_TUNE(DBMS_ADVISOR.SQLACCESS_ADVISOR, 'task_name', 'select * from tt_grid_det');

Então tem algum motivo específico para você estar utilizando o SQL Access Advisor dentro de um bloco de PLSQL?

Aguardo o seu retorno!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software