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

本文详细介绍了数据库中的数据压缩技术,包括压缩发生的场景如直接路径的SQL*Loader、CTAS及并发插入等,以及如何通过ALTER TABLE和MOVE语句对现有数据进行压缩。此外还讨论了压缩对不同类型数据的支持限制、压缩的性能考量以及压缩更适合的应用场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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系统它更适应于数据仓库。数据的组织为只读或者修改不那么频繁的数据

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值