oracle数据库 append,oracle中insert,copy,insert append执行对比
oracle中insert,copy,insert append執(zhí)行對(duì)比
還是由于遷移數(shù)據(jù)庫(kù),測(cè)試了insert,copy,insert append的執(zhí)行速度。
環(huán)境:oracle9i向oracle11g遷移,linux系統(tǒng)。
表已建立,只允許插入數(shù)據(jù),而不能使用create .. select 或 copy .. create。
1. 建立dblink,供insert,insert append使用。
2. 登錄11g數(shù)據(jù)庫(kù)。并set timing on
3. 建立視圖查看redo size
create redo_size as
select value?? www.2cto.com
from v$mystat, v$statname
where v$mystat.statistic# = v$statname.statistic#
and v$statname.name = 'redo size';
4. insert into dblink_test_tab select * from tran_rec_03@dblink_test;
insert /*+ APPEND */ into dblink_test_tab select * from tran_rec_03@dblink_test;
copy from ispay/ispay@crmtest insert dblink_test_tab using select * from tran_rec_03;
在執(zhí)行以上所有語(yǔ)句前與后執(zhí)行select * from redo_size;
5. 得到的結(jié)果如下:
redo_size 用時(shí)
insert 177821968 4'25"
insert append 3590412 3'15"
copy 124438620 4'20"
數(shù)據(jù)量:495665
www.2cto.com
結(jié)論:
insert 需要的時(shí)間最多,redo量最大。
insert append 需要的時(shí)間最短,redo量最小。
copy則不需要dblink。
總結(jié)
以上是生活随笔為你收集整理的oracle数据库 append,oracle中insert,copy,insert append执行对比的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 打什么针可以减肥不反弹
- 下一篇: 前台提交数据到php mysql,建立一