3

I've got a lot of similar oracle jobs I need to create, and I'd like to do it programatically.

Where does the Oracle store the job library (schema/table)?

(yes, I know I might be running with scissors)

1
  • Are you conflating two ideas. The programmatic addition of jobs and the tables Oracle uses to store what to run. I think you want to programmatically add job via insert, instead of calling the package. Is that so? Otherwise this is really two questions: how do I add and where do they go. right?
    – Mark Brady
    Oct 27, 2008 at 18:27

2 Answers 2

8

For DBMS_JOBS you can use...

dbms_job.submit(
JOB       OUT BINARY_INTEGER,
WHAT      IN  VARCHAR2,
NEXT_DATE IN  DATE           DEFAULT SYSDATE,
INTERVAL  IN  VARCHAR2       DEFAULT 'NULL',
NO_PARSE  IN  BOOLEAN        DEFAULT FALSE,
INSTANCE  IN  BINARY_INTEGER DEFAULT 0,
FORCE     IN  BOOLEAN        DEFAULT FALSE);

For the newer DBMS_SCHEDULER jobs you can use...

dbms_scheduler.create_job(
job_name            IN VARCHAR2,
job_type            IN VARCHAR2,
job_action          IN VARCHAR2,
number_of_arguments IN PLS_INTEGER DEFAULT 0,
start_date          IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
repeat_interval     IN VARCHAR2    DEFAULT NULL,
end_date            IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
job_class           IN VARCHAR2    DEFAULT 'DEFAULT_JOB_CLASS',
enabled             IN BOOLEAN     DEFAULT FALSE,
auto_drop           IN BOOLEAN     DEFAULT TRUE,
comments            IN VARCHAR2    DEFAULT NULL);

I haven't found a way to add a Grid Control job using SQL. I may ask that as a separate question if the answer doesn't show up here.

0

Views: USER_JOBS, DBA_JOBS or ALL_JOBS

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.