网站建设经验王者荣耀恺和,沈阳人流价格,wordpress如何添加注册登录,网站域名邮箱怎么注册海量数据插入的各种方案试验#xff0c;大家来分析下
前提 源表#xff1a;一千万条以上记录#xff0c;54个字段.exp导出文件2.8G以上。 目的表#xff1a;无索引#xff0c;空表 试验#xff1a;A.本地插入。B.跨库插入 初始化
SQL select count…海量数据插入的各种方案试验大家来分析下
前提 源表一千万条以上记录54个字段.exp导出文件2.8G以上。 目的表无索引空表 试验A.本地插入。B.跨库插入 初始化
SQL select count(*) from A; COUNT(*) -------------------- 11387512 已用时间: 00: 00: 47.08
SQL create table test as select * from A where 10; --无索引 表已创建。 已用时间: 00: 00: 00.02
SQL alter table test move tablespace mydata; 表已更改。 已用时间: 00: 00: 00.00 默认表空间太小。
A.本地插入 1。直接insert into
SQL insert into test select * from A;
已创建11387512行。
已用时间: 00: 07: 22.02 2。nologing SQL insert into test NOLOGGING select * from A;
已创建11387512行。
已用时间: 00: 07: 18.01 3。append参数 SQL insert /* append*/into test nologging select * from A;
已创建11387512行。
已用时间: 00: 07: 29.04 4。copy命令 爆慢等了一个小时以上把进程关了。当时看见进程在“锁”中不知为何我菜不懂
B.跨库插入 1。直接insert into
SQL insert into test select * from Aora1;
已创建11840772行。
已用时间: 00: 15: 29.09 2。nologing
SQL insert into test nologing select * from Aora1 (nologing和nologging有区别吗)
已创建11840772行。
已用时间: 00: 14: 15.01 3。append参数
SQL insert /* append*/into test nologing select * from Aora1;
已创建11840772行。
已用时间: 00: 14: 17.01 另外有人说是nologing,有人说是nologging昏了再做了次 SQL insert /* append*/into test nologging select * from Aora1;
已创建11840772行。
已用时间: 00: 14: 12.05 4。copy命令
set copycommit 1;
set arraysize 5000;
copy from scott/tigerora1 -
insert test -
using -
select * from A; 耗时两小时昏了。 5。imp导入
更爆慢耗时5小时没等出结果直接取消了浪费了一个下午半个早上。不过当时imp时test表是有索引的没有删除也是远程imp,还要考虑网络问题。