参考文档:How to Capture DDL for Scheduler Jobs KB151090
expdp 导出job
方式1 :
expdp \'/ as sysdba\' directory=DUMP dumpfile=job.dmp schemas=XX include=JOB
impdp \'/ as sysdba\' directory=DUMP dumpfile=job.dmp sqlfile=job.sql
方式2: 只适用于dbms_schedule,不适用dbms_job ,参考KB151090
Please note: The DBMS_METADATA package cannot be used to capture the DDL of jobs scheduled using DBMS_JOB. We can use the following workaround to capture the DDL of jobs scheduled using DBMS_JOB.
SELECT dbms_metadata.get_ddl('PROCOBJ','YOURJOBNAME', 'YOURJOBOWNER') from dual;
方式3:使用类似重建的方法:
spool on
select 'exec dbms_job.isubmit(job=>'||job||',what=>'''||what||''',next_date=>'''||next_date||''',interval=>'''||interval||''',no_parse=>TRUE);' from dba_jobs;
spool off
-- 附PP





END