设为首页 加入收藏

TOP

oracle表压缩技术(六)
2015-11-21 01:57:02 来源: 作者: 【 】 浏览:3
Tags:oracle 压缩 技术
f the data, then the compression level for the older data can be changed to archive compression to free disk space.

If a table is partitioned, then the DBMS_REDEFINITION package can change the compression level of the table. This package performs online redefinition of a table by creating a temporary copy of the table that holds the table data while it is being redefined. The table being redefined remains available for queries and DML statements during the redefinition. The amount of free space for online table redefinition depends on the relative compression level of the existing table and the new table. Ensure you have enough hard disk space on your system before using the DBMS_REDEFINITION package.

If a table is not partitioned, then you can use the ALTER TABLE...MOVE...COMPRESS FOR... statement to change the compression level. The ALTER TABLE...MOVE statement does not permit DML statements against the table while the command is running.

To change the compression level for a partition, use the ALTER TABLE...MODIFY PARTITION statement. To change the compression level for a tablespace, use the ALTER TABLESPACE statement.

##对于非分区表我们只能通过ALTER TABLE...MOVE...COMPRESS FOR命令来改变表的压缩等级,在变更的过程中不允许对表进行DML操作(如果表很大的话,就会长时间的影响应用)。如果是分区表我们可以通过上面的方式来做,也可以通过使用DBMS_REDEFINITION包来改变表的压缩等级,使用在线重定义的时候会为目标表建一个临时备份来保存表中的数据,在线重定义过程中目标是一直可以访问和dml的。

See Also:

"Moving a Table to a New Segment or Tablespace" for additional information about the ALTER TABLE command

Oracle Database PL/SQL Packages and Types Reference for additional information about the DBMS_REDEFINITION package

Adding and Dropping Columns in Compressed Tables

The following restrictions apply when adding columns to compressed tables:

##向压缩表中添加列的时候有如下限制:

Basic compression—You cannot specify a default value for an added column.##对于basic压缩方式你不能为添加的列指定默认值

OLTP compression—If a default value is specified for an added column, then the column must be NOT NULL. Added nullable columns with default values are not supported.##

The following restrictions apply when dropping columns in compressed tables:

##从压缩表中删除列时有如下限制:

Basic compression—Dropping a column is not supported.##对于basic压缩来说不支持列删除

OLTP compression—DROP COLUMN is supported, but internally the database sets the column UNUSED to avoid long-running decompression and recompression operations.##对于oltp压缩也是不支持列删除,但是我们可以把列设置为UNUSED的,避免解压缩和重新压缩操作队它的影响。

Exporting and Importing Hybrid Columnar Compression Tables

Hybrid Columnar Compression tables can be imported using the impdp command of the Data Pump Import utility. By default, the impdp command preserves the table properties, and the imported table is a Hybrid Columnar Compression table. On tablespaces not supporting Hybrid Columnar Compression, the impdp command fails with an error. The tables can also be exported using the expdp command.

You can import the Hybrid Columnar Compression table as an uncompressed table using the TRANSFORM:SEGMENT_ATTRIBUTES=n option clause of the impdp command.

An uncompressed or OLTP-compressed table can be converted to Hybrid Columnar Compression format during import. To convert a non-Hybrid Columnar Compression table to a Hybrid Columnar Compression table, do the following:

Specify default compression for the tablespace using the ALTER TABLESPACE ... SET DEFAULT COMPRESS command.

Override the SEGMENT_ATTRIBUTES option of the imported table during import.

See Also:

Oracle Database Utilities for additional infor

首页 上一页 3 4 5 6 7 下一页 尾页 6/7/7
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇oracle游标、临时表使用练习 下一篇oracle查询优化

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: