version 19:16
We have a number of jobs we want to change the job creator but keep the owner. Got bit pretty badly when a creator had left, their username got dropped and jobs stopped working so having a once off cleanup. Heres an example.
JOB_CREATOR= DBA_USER1
JOB_OWNER= APP_USER1
JOB= JOB1
So we want to
1. get the DDL of this job,
2. Drop existing job
3. Then Run create as a generic DBA user = DBA_JOB_OWNER (which will never be dropped)but keep JOB_OWNER = APP_USER1
We get the DDL of a job by
select dbms_metadata.get_ddl('PROCOBJ','JOB1','APP_USER1') from dual;
But this does NOT include the job owner in the DDL, just the job_name.
BEGIN
dbms_scheduler.create_job('"JOB1"',
..
END;
Is there a way to add the owner during get_ddl? I guess Im playing with replace strings otherwise