表空间名 总空间M 剩余空间M 使用率%
------------------------------ ---------- ------------- ----------
USERS 600 498 17 没有加载前表空间的空间状态
sqlldr userid=ls/ls control=leo_test2.ctl data=leo_test.data log=leo_test2.log direct=true parallel=true 并行直接加载10万行数据
LS@LEO> select count(*) from leo_test_sqlload2;
COUNT(*)
----------
100000 (8M)
表空间名 总空间M 剩余空间M 使用率%
------------------------------ ---------- ------------- ----------
USERS 600 490 18.33 10万行记录加载后使用了8M空间
SQL*Loader: Release 10.2.0.1.0 - Production on Thu Aug 9 07:25:00 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: leo_test2.ctl 控制文件
Data File: leo_test.data 数据文件,10万行数据,9个字段
Bad File: leo_test.bad 坏文件
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Continuation: none specified
Path used: Direct - with parallel option. sqlload采用并行+直接加载方式,既有并行,又有直接加载,双重功效,效率更高
Table LEO_TEST_SQLLOAD2, loaded from every logical record.
Insert option in effect for this table: APPEND 采用追加的方式加载,新数据不覆盖旧数据,而是结尾累加
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype 列信息
------------------------------ ---------- ----- ---- ---- ---------------------
START_TIME FIRST * | DATE YYYY-MM-DD HH24:MI:SS
END_TIME NEXT * | DATE YYYY-MM-DD HH24:MI:SS
PROTOCOL NEXT * | CHARACTER
PRIVATE_IP NEXT * | CHARACTER
PRIVATE_PORT NEXT * | CHARACTER
SRC_IP NEXT * | CHARACTER
SRC_PORT NEXT * | CHARACTER
DEST_IP NEXT * | CHARACTER
DEST_PORT NEXT * | CHARACTER
Table LEO_TEST_SQLLOAD2:
100000 Rows successfully loaded. 10万行记录成功加载,占用8M磁盘空间
0 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Date cache:
Max Size: 1000
Entries : 65
Hits : 199935
Misses : 0
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 100000
Total logical records rejected: 0
Total logical records discarded: 0
Total stream buffers loaded by SQL*Loader main thread: 26
Total stream buffers loaded by SQL*Loader load thread: 17
Run began on Thu Aug 09 07:25:00 2012
Run ended on Thu Aug 09 07:25:13 2012
Elapsed time was: 00:00:12.77 耗时00:00:12.77 比 直接加载3秒.53节约了93%时间
CPU time was: 00:00:00.98
小结:从时间成本上我们就可看出,并行直接加载效率要远远的高出串行直接加载,在海量数据的环境中使用并行和直接加载的技术,对提高效率和性能那是如虎添翼(并行并不一定比串行好,主要看业务类型其次看资源情况),我们应该思考“理解技术如何为业务服务”,这要比单纯学技术更加重要,谢谢!!!
