Using Table Compression【每日一译】--20121125

来源:互联网 发布:算法4 epub 编辑:程序博客网 时间:2024/05/16 17:43
Compression occurs while data is being bulk inserted or bulk loaded. These operations

include:

压缩在数据在整批插入或者导入时发生。这些操作包括:

■ Direct path SQL*Loader
■ CREATE TABLE and AS SELECT statements

■ Parallel INSERT (or serial INSERT with an APPEND hint) statements

#直接路径的SQL*LOADER

#CTAS

#并发手入(或者串行插入使用APPEND提示符)语句

Existing data in the database can also be compressed by moving it into compressed
form through ALTER TABLE and MOVE statements. This operation takes an exclusive
lock on the table, and therefore prevents any updates and loads until it completes. If
this is not acceptable, then Oracle's online redefinition utility (DBMS_REDEFINITION

PL/SQL package) can be used.

已经存在数据库的数据也可以被压缩通过MOVE使它变成压缩从通过ALTER TABLE 或者是

MOVE语句。这个操作将产生一个独占有操作在表上,所以它会阻止任何的更新和导入直到它

完成为止。如果这个是不可接受的,那么ORACLE在线定义工具(DBMS_REDEFINITION

PL/SQL PACKAGE)可以被使用。

Data compression works for all datatypes except for all variants of LOBs and
datatypes derived from LOBs, such as VARRAYs stored out of line or the XML datatype

stored in a CLOB.

数据压缩操作对于所有的数据类型可用除了LOBS类型的变种和从LOBS上采集的数据类型,比如

不在线的数组存储或者是存储在CLOB的XML数据类型。

Table compression is done as part of bulk loading data into the database. The overhead
associated with compression is most visible at that time. This is the primary trade-off

that needs to be taken into account when considering compression.

表压缩作为批量导入数据到数据库的一部份。它的与压缩相关的性能消耗是压缩时候是可见的

。这个是当考虑压缩时需要主要权衡考虑的。

Compressed tables or partitions can be modified the same as other Oracle tables or
partitions. For example, data can be modified using INSERT, UPATE, and DELETE
statements. However, data modified without using bulk insertion or bulk loading
techniques is not compressed. Deleting compressed data is as fast as deleting
uncompressed data. Inserting new data is also as fast, because data is not compressed
in the case of conventional INSERT; it is compressed only doing bulk load. Updating
compressed data can be slower in some cases. For these reasons, compression is more
suitable for data warehousing applications than OLTP applications. Data should be
organized such that read only or infrequently changing portions of the data (for

example, historical data) is kept compressed.

压缩的表或者分区可以被修改与ORACLE的其它表或者分区是相同的。比如,数据可以被修改使用

INSERT,UPDATE,DELETE语句。但是,数据修改在没有使用整托插入或者整托导入技术是不被压缩的。

删除压缩数据与删除未压缩的数据一样的快。插入新的数据也一样很快,因为数据在传统的插入中是不被

压缩的。原因是压缩比起OLTP系统它更适应于数据仓库。数据的组织为只读或者修改不那么频繁的数据

(比如历史表)它是保持压缩的。


原创粉丝点击