Friday, January 4, 2019
Recreate Lob table or big table in PARALLEL
Source table : APP_USER.APP_TABLE1
Target table : APP_USER.APP_TABLE2
Step 1: create a sequence Myuser.T_SQ [ Just to log a timing]
Step 2: create a procedure
CREATE OR REPLACE PROCEDURE Myuser.my_proc as
v_seq number;
Begin
execute immediate 'Alter session set parallel_force_local=TRUE';
execute immediate 'Alter session enable parallel dml';
select Myuser.T_SQ.nextval into v_seq from dual;
insert into Myuser.job_time (t_id,t_name,t_type,t_time) values(v_seq,'APP_TABLE1','START',sysdate);
commit;
INSERT /*+ APPEND PARALLEL(A,60) */ into APP_USER.APP_TABLE2 A
select /*+ PARALLEL(B,60) */ * from APP_USER.APP_TABLE1 B ;
commit;
insert into Myuser.job_time (t_id,t_name,t_type,t_time) values(v_seq,'APP_TABLE1','END',sysdate);
commit;
End;
/
Step 3: Execute procedure
Tuesday, January 1, 2019
Subscribe to:
Posts (Atom)