11gR1 11gR2 compress 与compress for oltp

话说comoress for oltp 在11g才支持,在不同版本之间做表压缩时,发现oltp 在11gR2版本才可以正常执行。
在实际测试过程中,发现compress  在11gR1 和11gR2不同小版本之间还存在一些差异

11gR1 在compress后, COMPRESS_FOR属性为 DIRECT LOAD ONLY

点击(此处)折叠或打开

  1. 11gR1,不支持compress for oltp,
  2. SQL> create table xjmon.test nologging as select * from dba_tables ;

  3. Table created.

  4. SQL> select
  5.   2 c.COMPRESSION,c.COMPRESS_FOR
  6.   3 from dba_tables c
  7.   4 where c.TABLE_NAME = 'TEST'
  8.   5 and c.OWNER = 'XJMON';

  9. COMPRESS COMPRESS_FOR
  10. -------- ------------------
  11. DISABLED

  12. SQL>
  13. SQL> ALTER table xjmon.test move compress nologging;

  14. Table altered.

  15. SQL> select
  16.   2 c.COMPRESSION,c.COMPRESS_FOR
  17.   3 from dba_tables c
  18.   4 where c.TABLE_NAME = 'TEST'
  19.   5 and c.OWNER = 'XJMON';

  20. COMPRESS COMPRESS_FOR
  21. -------- ------------------
  22. ENABLED DIRECT LOAD ONLY

  23. SQL>
  24. SQL> ALTER table xjmon.test move nocompress nologging;

  25. Table altered.

  26. SQL> ALTER table xjmon.test move compress for oltp nologging;
  27. ALTER table xjmon.test move compress for oltp nologging
  28.                                          *
  29. ERROR at line 1:
  30. ORA-14464: Compression Type not specified
11gR2 在compress后, COMPRESS_FOR属性为BASIC,并且支持compress for oltp

点击(此处)折叠或打开

  1. SQL> create table xjmon.test nologging as select * from dba_tables;

  2. Table created.

  3. Elapsed: 00:00:01.02
  4. SQL> select
  5.   2 c.COMPRESSION,c.COMPRESS_FOR
  6.   3 from dba_tables c
  7.   4 where c.TABLE_NAME = 'TEST'
  8.   5 and c.OWNER = 'XJMON';

  9. COMPRESS COMPRESS_FOR
  10. -------- ------------
  11. DISABLED

  12. Elapsed: 00:00:00.01
  13. SQL>
  14. SQL> alter table xjmon.test move compress nologging ;

  15. Table altered.

  16. Elapsed: 00:00:00.32
  17. SQL> select
  18.   2 c.COMPRESSION,c.COMPRESS_FOR
  19.   3 from dba_tables c
  20.   4 where c.TABLE_NAME = 'TEST'
  21.   5 and c.OWNER = 'XJMON';

  22. COMPRESS COMPRESS_FOR
  23. -------- ------------
  24. ENABLED BASIC

  25. Elapsed: 00:00:00.01
  26. SQL>
  27. SQL> alter table xjmon.test move compress for oltp nologging ;

  28. Table altered.

  29. Elapsed: 00:00:00.23
  30. SQL> select
  31.   2 c.COMPRESSION,c.COMPRESS_FOR
  32.   3 from dba_tables c
  33.   4 where c.TABLE_NAME = 'TEST'
  34.   5 and c.OWNER = 'XJMON';

  35. COMPRESS COMPRESS_FOR
  36. -------- ------------
  37. ENABLED OLTP

  38. Elapsed: 00:00:00.00
接下来,会实际测试oltp和basic 两种不同的压缩方式insert 及insert append 方式的压缩比例及插入效率的影响。


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28551528/viewspace-2122899/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28551528/viewspace-2122899/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值