1.使用marge快速插入;
MERGE /*+ append */
INTO A d
USING (select * B where ...) f
ON (d.account_no = f.account_no)
WHEN MATCHED THEN
update set acc_date = f.acc_date,...
WHEN NOT MATCHED THEN
insert values ( f.account_no,f.acc_date..)
/
commit;
2.向表中插入两条记录
SQL> INSERT ALL
2 INTO toms values(1)
3 into toms values(2)
4 select * from dual;
已创建2行。
SQL> commit;
3.在插入时不记录日志记录的快速方法
INSERT的时候可通过APPEND选项不产生归档日志。
alter table aa nologging
alter table aa logging
insert /*+append*/ into ...nologing
select * from ...
insert /*+ append, parallel */ into ods_list_t nologging
select * from ods_list;
但这样不行:整个表可以插入,但要某一个字段则不能加入nologging
insert /*+ append, parallel */ into ods_list_t(a,b) nologging
select a,b from ods_list;
但可以这样:
insert /*+ append, parallel */ into ods_list_t nologging(a,b)
select a,b from ods_list;
create table ods_list_t nologging as select * from ods_list;
insert /*+ append, parallel */ into ods_list_t nologging
select * from ods_list;
insert /*+ Append parallel(tablename,number) */ into ods_list_t nologging
select * from ods_list;
tablename: 表名
number: 并行度
4、
使用批量拷贝方法
set arraysize 20
set copycommit 5000
copy from append table_name1
using select * from table_name2;