Get the DDL of job in dbms_jobs
- Find the job id and owner of the job
col log_user for a10
col schema_user for a10
select job,log_user,schema_user from dba_jobs;
JOB LOG_USER SCHEMA_USE
---------- ---------- ----------
1 HR HR
2. Alter the session of Current schema with sys dba role.
alter session set current_schema=HR;
3. Get the DDL of the DBMS_JOBS
Note: Put the job number got from first query in user_export procedure, in my example its ONE, so i used One.
set serveroutput on
DECLARE
callstr VARCHAR2(500);
BEGIN
dbms_job.user_export(1, callstr);
dbms_output.put_line(callstr);
END;