Rem
Rem  Makes all deferred tran jobs, by deleting any existing jobs and recreating 
Rem  them all, by looking at dba_repschema
Rem
Rem  Roger Raj     June 98

--accept masterSiteGlobalName prompt 'Enter Master Site Global Name: '
connect repadmin/repadmin@&&1
set term off
set head off
set echo off
set lines 500
set feedback off
set verify off
spool LOGS/drjobs.sql

SELECT 'execute dbms_job.remove('||job||');' 
FROM dba_jobs
WHERE upper(what) like '%DBMS_DEFER_SYS.PUSH%';

spool off

@LOGS/drjobs.sql

spool LOGS/crjobs.sql

SELECT 'execute dbms_defer_sys.schedule_push(' || ''''||dblink ||''''||
','||''''||'sysdate+ (30/(24*60*60))' || ''''||
',sysdate + (30/(24*60*60)),parallelism=>1);'
FROM dba_repschema A ,global_name B
WHERE A.dblink != B.global_name;

spool off

--spool LOGS/crjobs.log

@LOGS/crjobs.sql



set term on
set head on
set echo on
set lines 500
set feedback on
set verify on
--spool off


prompt  'Jobs Created for the Master Site: &1'
exit;
