insert?????????????
???????????? ???????[ 2013/7/8 11:31:21 ] ????????
????????????????????????????в?????????????????????????????????????ù??????????????????????????????????insert???Щ???顣
???????????insert????????????????????????????????????????????insert??????????????????
????1.
????insert into tab1 select * from tab2;
????commit;
?????????????insert????????tab2???е?????insert??tab1???С???????飬????????????1С?????ɡ?????÷?????????arch?????????????鵵????????????????????????????arch???????
????2.
????alter table tab1 nologging;
????insert /*+ append */ into tab1 select * from tab2;
????commit;
????alter table tab1 logging;
?????÷???????ò???arch?????????????????????????????????飬????????????45????????ɡ???????????÷??????????????з??????????ж??????????????????????????enqueue??????????????????dataguard????(?????????database???force logging???????μ?????)!!
????3.
????insert into tab1 select /*+ parallel */ * from tab2;
????commit;
????????select?????????????????????????????parallel??hint?????????????????????????????????????????parallel_max_servers??????????????????????v$px_session????????ps -ef |grep ora_p????
????4.
????alter session enable parallel dml;
????insert /*+ parallel */ into tab1 select * from tab2;
????commit;
????????2??????????insert????δ???????2???Ч?????(??????????2??)???в????????????????
????5.
????insert into tab1 select * from tab2 partition (p1);
????insert into tab1 select * from tab2 partition (p2);
????insert into tab1 select * from tab2 partition (p3);
????insert into tab1 select * from tab2 partition (p4);
????????????????????tab1???ж??????????insert?????????????????????????????????insert 2.6???м??????????8????????8???????????÷???2?????????????????40?????????????????8??????8???????????????enqueue??????????????????40????×8;????????÷???5????????????????110??????????????????????????У??????????????????110???????
????6.
????DECLARE
????TYPE dtarray IS TABLE OF VARCHAR2(20) INDEX BY BINARY_INTEGER;
????v_col1 dtarray;
????v_col2 dtarray;
????v_col3 dtarray;
????BEGIN
????SELECT col1?? col2?? col3 BULK COLLECT
????INTO v_col1?? v_col2?? v_col3
????FROM tab2;
????FORALL i IN 1 .. v_col1.COUNT
????insert into tab1 WHERE tab1.col1 = v_col1;
????END;
????????????(bulk binding)?????????????????????????sql????????PL/SQL ??SQL????(engines)?У??????????????????л?(context switches)?????bulk binding????????????????plsql???洫??sql???棬??????????????л??????????Ч????÷????????????????????????????
????7.
????sqlplus -s user/pwd< runlog.txt
????set copycommit 2;
????set arraysize 5000;
????copy from user/pwd@sid -
????to user/pwd@sid -
????insert tab1 using select * from tab2;
????exit
????EOF
??????copy????????в????????insert???into???????÷????????????????copycommit??arrarysize????????commit?????????????????10000??commit??Ρ?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11