Link to home
Start Free TrialLog in
Avatar of Rao_S
Rao_S

asked on

Schedule a Packaged Proc in Oracle.

How do i schedule a packed proc to run every moday at 8am.
For example, I would execute as follows in toad:
execute SCHEMA1.SPKG_PACKAGE1.SP_PROC1;
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>> repeat_interval      => 'FREQ=DAILY;BYHOUR=8',

sdstuber beat me and is correct.  Mine was daily.
actually I have a syntax error in my start_date


 start_date        => trunc(next_day(sysdate,'Mon'))+8/24,
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rao_S

ASKER

Thanks a lot!
I changed the repeat_interval as above using 'set_attribute'.
And also ran the following select to make sure everything was fine:
select owner, job_name, job_class, job_action, start_date, repeat_interval, enabled FROM dba_scheduler_jobs;
also note,  since your process is just a procedure

you could use

job_type         => 'STORED_PROCEDURE',
job_action       => 'SCHEMA1.SPKG_PACKAGE1.SP_PROC1'

no real advantage one way or the other, but this one might be more intuitive
Avatar of Rao_S

ASKER

When I changed the  job_type it becane 'enabled' FALSE.
I tried
BEGIN
DBMS_SCHEDULER.set_attribute (
    name       => 'ERRORS_PURGE_ROUTINE',
    attribute   => 'enabled',
    value        => TRUE);
END;
I get the following error:
ORA-27469: ENABLED is not a valid job attribute
ORA-06512: at "SYS.DBMS_ISCHED", line 2792
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1895
ORA-06512: at line 2