ITPub博客

首页 > 数据库 > Oracle > 11gR1 11gR2 compress 与compress for oltp

11gR1 11gR2 compress 与compress for oltp

原创 Oracle 作者:shiable 时间:2016-08-03 11:42:38 0 删除 编辑
话说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博客 ” ,链接:https://blog.itpub.net/28551528/viewspace-2122899/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-04-16

  • 博文量
    15
  • 访问量
    19036