Default: y
Specifies how Export and Import manage the initial extent for table data.
The default, COMPRESS=y, causes Export to flag table data for consolidation into one initial extent upon import. If extent sizes are large (for example, because of the PCTINCREASE parameter), the allocated space will be larger than the space required to hold the data.
If you specify COMPRESS=n, Export uses the current storage parameters, including the values of initial extent size and next extent size. The values of the parameters may be the values specified in the CREATE TABLE or ALTER TABLE statements or the values modified by the database system. For example, the NEXT extent size value may be modified if the table grows and if the PCTINCREASE parameter is nonzero.
Note:
Although the actual consolidation is performed upon import, you can specify the COMPRESS parameter only when you export, not when you import. The Export utility, not the Import utility, generates the data definitions, including the storage parameter definitions. Therefore, if you specify COMPRESS=y when you export, you can import the data in consolidated form only.
Note:
Neither LOB data nor subpartition data is compressed. Rather, values of initial extent size and next extent size at the time of export are used.
--===============================
COMPRESS=n很好理解,表导出去时extent是什么样的导入时还是原来的样子;COMPRESS=y貌似oracle主要是应对PCTINCREASE导致的extent越来越大的问题;下面测试了一下LMT下autoallocate的情况倒是觉得可以理解。
根据测试COMPRESS=y时说明oracle导入表时会根据segment的大小重新分配extent,COMPRESS=n时extent不做调整。
C:>sqlplus test/test
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 9月 16 21:09:37 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning option
SQL> create table tt tablespace users as select * from dba_objects;
表已创建。
SQL> insert into tt select * from tt;
已创建16963行。
SQL> commit;
提交完成。
SQL> select extent_id,blocks from dba_extents where owner='TEST' and segment_name='TT';
EXTENT_ID BLOCKS
---------- ----------
0 8
1 8
2 8
3 8
4 8
5 8
6 8
7 8
8 8
9 8
10 8
EXTENT_ID BLOCKS
---------- ----------
11 8
12 8
13 8
14 8
15 8
16 128
17 128
18 128
已选择19行。
--==============================
C:>exp test/test file=c:temptt_compress_y.dmp tables=tt compress=y
Export: Release 11.2.0.1.0 - Production on 星期日 9月 16 21:11:35 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning option
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即将导出指定的表通过常规路径...
. . 正在导出表 TT导出了 33926 行
成功终止导出, 没有出现警告。
C:>exp test/test file=c:temptt_compress_n.dmp tables=tt compress=n
Export: Release 11.2.0.1.0 - Production on 星期日 9月 16 21:11:50 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning option
已导出 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集
即将导出指定的表通过常规路径...
. . 正在导出表 TT导出了 33926 行
成功终止导出, 没有出现警告。
C:>
--==============================
SQL> rename tt to tt1;
表已重命名。
SQL>
--===============================
C:>imp test/test file=c:temptt_compress_y.dmp full=y
Import: Release 11.2.0.1.0 - Production on 星期日 9月 16 21:14:20 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning option
经由常规路径由 EXPORT:V11.02.00 创建的导出文件
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
. 正在将 TEST 的对象导入到 TEST
. 正在将 TEST 的对象导入到 TEST
. . 正在导入表 "TT"导入了 33926 行
成功终止导入, 没有出现警告。
C:>
--===================================
SQL> select extent_id,blocks from dba_extents where owner='TEST' and segment_name='TT';
EXTENT_ID BLOCKS
---------- ----------
0 128
1 128
2 128
3 128
SQL> rename tt to tt2;
表已重命名。
SQL>
--====================================
C:>imp test/test file=c:temptt_compress_n.dmp full=y
Import: Release 11.2.0.1.0 - Production on 星期日 9月 16 21:15:36 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning option
经由常规路径由 EXPORT:V11.02.00 创建的导出文件
已经完成 ZHS16GBK 字符集和 AL16UTF16 NCHAR 字符集中的导入
. 正在将 TEST 的对象导入到 TEST
. 正在将 TEST 的对象导入到 TEST
. . 正在导入表 "TT"导入了 33926 行
成功终止导入, 没有出现警告。
C:>
--=================================SQL> select extent_id,blocks from dba_extents where owner='TEST' and segment_name='TT';
EXTENT_ID BLOCKS
---------- ----------
0 8
1 8
2 8
3 8
4 8
5 8
6 8
7 8
8 8
9 8
10 8
EXTENT_ID BLOCKS
---------- ----------
11 8
12 8
13 8
14 8
15 8
16 128
17 128
18 128
已选择19行。
SQL>
oracle视频教程请关注:http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html