DBMS_PARALLEL_EXECUTE 1 thread always PROCESSING
Hi, guys!
It is simple example:
exec DBMS_PARALLEL_EXECUTE.DROP_TASK('TASK_TEST');
DECLARE
l_sql_stmt VARCHAR2(2000);
l_chunk_stmt VARCHAR2(2000);
BEGIN
DBMS_PARALLEL_EXECUTE.CREATE_TASK('TASK_TEST');
l_chunk_stmt := 'select (level - 1) * 5e4 + 1 start_id, level * 5e4 end_id from dual connect by rownum <= 2000';
DBMS_PARALLEL_EXECUTE.create_chunks_by_sql(task_name => 'TASK_TEST',
sql_stmt => l_chunk_stmt,
by_rowid => FALSE);
l_sql_stmt := '
declare
x integer;
begin
select 1 into x from dual where :start_id <> :end_id;
dbms_lock.sleep(x); -- sleep 1 sec
end;';
DBMS_PARALLEL_EXECUTE.RUN_TASK('TASK_TEST', l_sql_stmt, DBMS_SQL.NATIVE /*, parallel_level => 2*/);
END;
/
0