DECLARE
task_id NUMBER;
task_name VARCHAR2(30);
BEGIN
task_name := ‘My Task’;
DBMS_ADVISOR.DELETE_TASK(task_name);
END;
/
Database Error
ORA-04021: timeout occurred while waiting to lock object ORA-06512: at “SYS.PRVT_ADVISOR”, line 3941 ORA-06512: at “SYS.DBMS_ADVISOR”, line 305 ORA-06512: at line 1

Reset the task in order to delete it.
DECLARE
task_id NUMBER;
task_name VARCHAR2(30);
BEGIN
task_name := ‘My Task’;

DBMS_ADVISOR.RESET_TASK(‘task_name’);
END;
/

DECLARE
task_id NUMBER;
task_name VARCHAR2(30);
BEGIN
task_name := ‘My Task’;
DBMS_ADVISOR.DELETE_TASK(task_name);
END;
/
PL/SQL procedure successfully completed.

Advertisements