user3752281
user3752281

Reputation: 1915

PLSQL that creates a Job and a Schedule

In Oracle DB how do I extract the PLSQL that creates a Job and a Schedule from existing objects?

I am using SQL Developer but any other method is welcome.

Upvotes: 1

Views: 206

Answers (1)

Frank Schmitt
Frank Schmitt

Reputation: 30765

To get the DDL statement for a job, you can use DBMS_METADATA.GET_DDL with the PROCOBJ object type:

select dbms_metadata.get_ddl('PROCOBJ', job_name) 
from user_scheduler_jobs;

UPDATE

The same approach works for schedules:

select dbms_metadata.get_ddl('PROCOBJ', schedule_name) 
from user_scheduler_schedules;  

Upvotes: 2

Related Questions