eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« Oracle impdp的ignore及 fromuser / touser 功能 | Blog首页 | 想到达明天 现在就要启程 - 假期就要开始喽 »

工作记录: 2亿记录的导入及索引创建
modb.pro

昨天做了这样一个工作,将一个2.2亿记录的分区导入一台 2 CPU (2 cores per cpu)的主机:
model name      : Intel(R) Xeon(R) CPU            5130  @ 2.00GHz

这个过程大约用了15个小时的时间,非常漫长:
229052056 rows imported
4951.14user 669.39system 15:30:02elapsed 10%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (21112major+649765minor)pagefaults 0swaps
然后在一个VARCHAR2(21)的字段上创建了一个单键值非唯一的索引,耗时1小时30分钟,创建索引时用了nologging选项,并行度为4.

以下记录一下创建这个索引消耗的临时表空间等信息.
最终创建的索引,大小大约为1.5G:
SQL> select segment_name,bytes/1024/1024 MB from user_segments where segment_name='IDX_DEST_MDN';

SEGMENT_NAME            MB
--------------- ----------
IDX_DEST_MDN        1555.5
创建中使用的临时表空间大约8G左右:

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-



历史上的今天...
    >> 2018-09-29文章:
    >> 2017-09-29文章:
    >> 2011-09-29文章:
    >> 2010-09-29文章:
    >> 2007-09-29文章:
    >> 2006-09-29文章:
    >> 2005-09-29文章:

By eygle on 2009-09-29 19:59 | Comments (0) | Case | 2414 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com