Which options do you have to move scheduler jobs (DBMS_SCHEDULER) to a different Oracle Database?
Data Pump
In Data Pump, scheduler jobs are referred to as PROCOBJ. You can get just the scheduler jobs using:
expdp ... include=procobj
impdp ... include=procobj
If you need just a subset of the scheduler jobs (works for impdp as well):
expdp ... include=procobj:" IN ('JOB1', 'JOB2')"
Data Pump and SQLFILE
If you have a Data Pump dump file, you can extract the DDL of the scheduler jobs using the sqlfile option:
impdp ... include=procobj \
sqlfile=my_scheduler_jobs.sql
The DDL is written to a text file specified by sqlfile. This allows you to review the job defintions and, optionally, change them. Then, you execute the commands.
DBMS_METADATA
If you need to export just a few jobs, it might be easier to simply get the defintions using the metadata API:
select
dbms_metadata.get_ddl('PROCOBJ','<name>','<owner>')
from
dual;
SYS Jobs
In older releases of Oracle Database, you could not get the definition of a job owned by SYS. A simple workaround is to copy the job into another schema and then generate the DDL:
exec dbms_scheduler.copy_job('SYS.MY_JOB','APPUSER.MY_JOB');
select
dbms_metadata.get_ddl('PROCOBJ','MY_JOB','APPUSER')
from
dual;
Appendix
Credits
Thanks to my colleague, Klaus Gronau. He has done more migrations than I’ll ever do and he maintains a remarkable set of notes. From his notes, he dug out many good pointers.