Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4049120
  • 博文数量: 536
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(536)

文章存档

2024年(3)

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(252)

2006年(73)

分类: Oracle

2011-10-18 11:07:45

HYBRID COLUMNAR COMPRESSION [HCC] is only for EXADATA.

Online Archival Compression Syntax:
CREATE TABLE emp (
  emp_id NUMBER
, first_name VARCHAR2(128)
, last_name VARCHAR2(128)
) COMPRESS FOR ARCHIVE [ LOW | HIGH ];


Warehouse Compression Syntax:
CREATE TABLE emp (
  emp_id NUMBER
, first_name VARCHAR2(128)
, last_name VARCHAR2(128)
) COMPRESS FOR QUERY [ LOW | HIGH ];


自己的测试:
  1. SQL> create table stab(a int, b varchar2(20)) compress for query high;

  2. Table created.

  3. SQL> select owner,table_name,tablespace_name,compression,compress_for from all_tables where owner='GAN' and table_name='STAB';

  4. OWNER TABLE_NAME TABLESPACE_NAME COMPRESS COMPRESS_FOR
  5. ------------------------------ ------------------------------ ------------------------------ -------- ------------
  6. GAN STAB GANTS ENABLED QUERY HIGH

  7. SQL> insert into stab values(1, '1111111');

  8. 1 row created.

  9. SQL> c/1/2
  10.   1* insert into stab values(2, '1111111')
  11. SQL> /

  12. 1 row created.

  13. SQL> commit;

  14. Commit complete.

  15. SQL> select owner,table_name,tablespace_name,compression,compress_for from all_tables where owner='GAN' and table_name='STAB';

  16. OWNER TABLE_NAME TABLESPACE_NAME COMPRESS COMPRESS_FOR
  17. ------------------------------ ------------------------------ ------------------------------ -------- ------------
  18. GAN STAB GANTS ENABLED QUERY HIGH

  19. SQL> l
  20.   1* select dbms_rowid.rowid_relative_fno(rowid) fno, dbms_rowid.rowid_block_number(rowid) blk, dbms_rowid.rowid_row_number(rowid) rnum, newtab.* from stab newtab
  21. SQL> /

  22.        FNO BLK RNUM A B
  23. ---------- ---------- ---------- ---------- --------------------
  24.          5 189 0 1 1111111
  25.          5 189 1 2 1111111
  26. SQL> l
  27.   1* select dbms_rowid.rowid_relative_fno(rowid) fno, dbms_rowid.rowid_block_number(rowid) blk, dbms_rowid.rowid_row_number(rowid) rnum, newtab.* from stab newtab
  28. SQL> /

  29.        FNO BLK RNUM A B
  30. ---------- ---------- ---------- ---------- --------------------
  31.          5 189 0 1 1111111
  32.          5 189 1 2 1111111

  33. SQL> alter table stab move compress for archive high;

  34. Table altered.

  35. SQL> select owner,table_name,tablespace_name,compression,compress_for from all_tables where owner='GAN' and table_name='STAB';

  36. OWNER TABLE_NAME TABLESPACE_NAME COMPRESS COMPRESS_FOR
  37. ------------------------------ ------------------------------ ------------------------------ -------- ------------
  38. GAN STAB GANTS ENABLED ARCHIVE HIGH

  39. SQL> select dbms_rowid.rowid_relative_fno(rowid) fno, dbms_rowid.rowid_block_number(rowid) blk, dbms_rowid.rowid_row_number(rowid) rnum, newtab.* from stab newtab;

  40.        FNO BLK RNUM A B
  41. ---------- ---------- ---------- ---------- --------------------
  42.          5 227 0 1 1111111
  43.          5 227 1 2 1111111


阅读(1290) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~