Rem use_advisor.sql
-- create a valid workload
-- Create the task and link to the workload


DECLARE
  task_desc VARCHAR2(100);
  task_id NUMBER;
  task_name VARCHAR2(30);
  workload_name VARCHAR2(30);
  workload_desc VARCHAR2(100);
BEGIN
  task_name := 'TASK_OBE1';
  task_desc := 'Task for Advisor ';
  workload_name := 'Work_import_sqlcache';
  workload_desc := 'Workload from SQL Cache';


-- create the task
  dbms_advisor.create_task (DBMS_ADVISOR.SQLACCESS_ADVISOR, task_id, task_name, task_desc,
    DBMS_ADVISOR.SQLACCESS_WAREHOUSE);


-- create the workload
  dbms_advisor.create_sqlwkld(workload_name, workload_desc , NULL);


-- now link the two together
dbms_advisor.add_sqlwkld_ref( task_name, workload_name) ;
END;
/
