Run procedure in background

Running Background PL/SQL,  parallel procedure execution

Запустить  процедуры одновременно в фоновом режиме можно с помощь задания DBMS_SCHEDULER.RUN_JOB с параметром FALSE. Количество зависит от параметра  job_queue_processes.

DBMS_SCHEDULER.RUN_JOB (
   job_name                IN VARCHAR2,
   use_current_session     IN BOOLEAN DEFAULT TRUE);
begin
sys.dbms_scheduler.create_job(job_name => 'JOB_RAD_PKG_TOTAL',
job_type => 'PLSQL_BLOCK',
job_action => 'begin
dbms_scheduler.run_job(''JOB_RAD_PKG_TOTAL_1'', false);
dbms_scheduler.run_job(''JOB_RAD_PKG_TOTAL_2'', false);
end;',
repeat_interval => 'Freq=DAILY;Interval=1;ByHour=06,08;ByMinute=00',
enabled => true);
end;

begin
sys.dbms_scheduler.create_job(job_name => 'JOB_RAD_PKG_TOTAL_1',
job_type => 'PLSQL_BLOCK',
job_action => 'begin
for lnks in (select db_link from dba_db_links order by db_link asc) loop
RAD_PKG_TOTAL.P_START_ONE(lnks.db_link);
end loop;
end;');
end;

begin
sys.dbms_scheduler.create_job(job_name => 'JOB_RAD_PKG_TOTAL_2',
job_type => 'PLSQL_BLOCK',
job_action => 'begin
for lnks in (select db_link from dba_db_links order by db_link desc) loop
RAD_PKG_TOTAL.P_START_ONE(lnks.db_link);
end loop;
end;');
end;