Do it in a single shot (SQL).
See below:
TamilPHP Code:set time on timing on
spool upd_my_table_2.log
drop index scott.my_table_m3 ;
--- 1 option
alter table scott.my_table parallel 8;
alter index scott.my_table_p1 parallel 8;
alter table scott.tamil_temp_con_addr parallel 8;
alter index scott.tamil_temp_con_addr_idx parallel 8;
commit;
alter session enable parallel dml ;
alter session enable parallel query ;
update /*+ parallel(a,8) */ scott.my_table a
set a.pr_addr_id = ( select addr_per_id
from scott.tamil_temp_con_addr c
where c.accnt_id = a.row_id)
where exists ( select null
from scott.tamil_temp_con_addr c
where c.accnt_id = a.row_id) ;
commit;
alter session disable parallel dml ;
alter session disable parallel query ;
alter table scott.my_table noparallel ;
alter index scott.my_table_p1 noparallel ;
spool off




Reply With Quote