Reputation: 1915
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
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