昨天做了这样一个工作,将一个2.2亿记录的分区导入一台 2 CPU (2 cores per cpu)的主机:
model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
这个过程大约用了15个小时的时间,非常漫长:
以下记录一下创建这个索引消耗的临时表空间等信息.
最终创建的索引,大小大约为1.5G:
创建中使用的表空间临时段信息如下:
-The End-
model name : Intel(R) Xeon(R) CPU 5130 @ 2.00GHz
这个过程大约用了15个小时的时间,非常漫长:
229052056 rows imported然后在一个VARCHAR2(21)的字段上创建了一个单键值非唯一的索引,耗时1小时30分钟,创建索引时用了nologging选项,并行度为4.
4951.14user 669.39system 15:30:02elapsed 10%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (21112major+649765minor)pagefaults 0swaps
以下记录一下创建这个索引消耗的临时表空间等信息.
最终创建的索引,大小大约为1.5G:
SQL> select segment_name,bytes/1024/1024 MB from user_segments where segment_name='IDX_DEST_MDN';创建中使用的临时表空间大约8G左右:
SEGMENT_NAME MB
--------------- ----------
IDX_DEST_MDN 1555.5
SQL> SELECT
2 b.tablespace tablespace_name
3 , a.username username
4 , a.sid sid
5 , a.serial# serial_id
6 , b.contents contents
7 , b.segtype segtype
8 , b.extents extents
9 , b.blocks blocks
10 , (b.blocks * c.value) bytes
11 FROM
12 v$session a
13 , v$sort_usage b
14 , (select value from v$parameter
15 where name = 'db_block_size') c
16 WHERE
17 a.saddr = b.session_addr
18 /
Tablespace Name Username SID Serial# Contents Segment Type Extents Blocks Bytes
--------------- --------------- ------ --------- --------- ------------ -------- ------------ ----------------
TEMP SMS 152 34899 TEMPORARY SORT 1,747 223,616 1,831,862,272
SMS 146 37002 TEMPORARY SORT 1,768 226,304 1,853,882,368
SMS 142 86 TEMPORARY SORT 1,755 224,640 1,840,250,880
SMS 137 28754 TEMPORARY SORT 1,778 227,584 1,864,368,128
SMS 134 42 TEMPORARY SORT 16 2,048 16,777,216
*************** -------- ------------ ----------------
sum 7,064 904,192 7,407,140,864
创建中使用的表空间临时段信息如下:
SQL> select segment_name,segment_type,bytes/1024/1024 MB,blocks from user_segments where segment_type='TEMPORARY';工作信息,记录供参考。
SEGMENT_NAME SEGMENT_TYPE MB Blocks
------------------------------ -------------------- ---------- ------------
12.261516 TEMPORARY 1280 163,840
8.25484 TEMPORARY 1280 163,840
6.2459148 TEMPORARY 1313 168,064
12.261772 TEMPORARY 1344 172,032
---------- ------------
sum 5217 667,776
-The End-
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




