你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle (11gR2)中的表压缩

[日期:2012-06-20] 来源:Linux社区  作者:pingley [字体:大 中 小]

2、oltp 方式压缩的表,支持删除表中的列,但是Oracle内部是把删除的列用unused方式来处理的,从而避免大量的解压缩与压缩操作,不过这导致了不能释放该列占有的存储空间。

SQL> alter table employees move compress for oltp;

Table altered.

SQL> alter table employees drop column salary;

Table altered.

SQL> select * from user_unused_col_tabs

  2  where table_name = 'EMPLOYEES';

TABLE_NAME        COUNT

------------ ----------

EMPLOYEES             1

3、如果你不指定使用basic compression 方式压缩的表的pct_free 参数将会被自动的设置为0。

4、压缩理论上将会增加CPU的负载,但是实际的情况可能不是这样的,因为CPU处理的I/O 操作减少了。如果I/O 操作不能抵消CPU负载的提高,确保你的系统中有足够CPU资源。

5、压缩表不能超过255个列。

6、压缩表不支持在线段压缩。

7、可以往basic compression 方式的压缩表中添加列,但是不能指定默认值。

SQL> alter table employees move compress basic;

Table altered.

SQL> alter table employees add (salary number(7) default 0);

alter table employees add (salary number(7) default 0)

                           *

ERROR at line 1:

ORA-39726: unsupported add/drop column operation on compressed tables

SQL> alter table employees add (salary number(7));

Table altered.

8、可以往oltp compression 方式的压缩表中添加列,如果指定默认值,该列必须是not null 约束的。

SQL> alter table employees add (income number(7) default 0);

alter table employees add (income number(7) default 0)

                           *

ERROR at line 1:

ORA-39726: unsupported add/drop column operation on compressed tables

SQL> alter table employees add (income number(7) default 0 not null);

Table altered.

9、这里所说的表的压缩方式,不适合与LOBs

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

linux
相关资讯       Oracle高级培训 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款