How To Get A Job DDL

Let’s see an example of how to get the Data Definition Language (DDL)  or create job script (with Oracle Scheduler) from a one already existing.

Note; DDL to get a job scheduler, pass as the first parameter the string “PROCOBJ”.

 

 SBL*/\/\/> SELECT DBMS_METADATA.GET_DDL ('PROCOBJ','LOCKSTATS_2624674') FROM DUAL;

DBMS_METADATA.GET_DDL('PROCOBJ','LOCKSTATS_2624674')
________________________________________________________________________________

BEGIN
dbms_scheduler.create_job('"LOCKSTATS_2624674"',
job_type=>'PLSQL_BLOCK', job_action=>
'
begin
dbms_stats.lock_table_stats(ownname=> ''SIEBEL'', tabname=> ''S_ACT_EMP'' );
dbms_stats.lock_table_stats(ownname=> ''SIEBEL'', tabname=> ''S_EVT_MAIL'' );
end;'
, number_of_arguments=>0,
start_date=>TO_TIMESTAMP_TZ('20-JUN-2012 08.00.35,983830000 PM UTC','DD-MON-RRRR
HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=>
NULL
, end_date=>NULL,
job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>FALSE,comments=>
NULL
);
COMMIT;
END;

 

HTH – Antonio NAVARRO

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s