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 ];
自己的测试:
- sql> create table stab(a int, b varchar2(20)) compress for query high;
-
-
table created.
-
-
sql> select owner,table_name,tablespace_name,compression,compress_for from all_tables where owner='gan' and table_name='stab';
-
-
owner table_name tablespace_name compress compress_for
-
------------------------------ ------------------------------ ------------------------------ -------- ------------
-
gan stab gants enabled query high
-
-
sql> insert into stab values(1, '1111111');
-
-
1 row created.
-
-
sql> c/1/2
-
1* insert into stab values(2, '1111111')
-
sql> /
-
-
1 row created.
-
-
sql> commit;
-
-
commit complete.
-
-
sql> select owner,table_name,tablespace_name,compression,compress_for from all_tables where owner='gan' and table_name='stab';
-
-
owner table_name tablespace_name compress compress_for
-
------------------------------ ------------------------------ ------------------------------ -------- ------------
-
gan stab gants enabled query high
-
-
sql> l
-
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
-
sql> /
-
-
fno blk rnum a b
-
---------- ---------- ---------- ---------- --------------------
-
5 189 0 1 1111111
-
5 189 1 2 1111111
-
sql> l
-
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
-
sql> /
-
-
fno blk rnum a b
-
---------- ---------- ---------- ---------- --------------------
-
5 189 0 1 1111111
-
5 189 1 2 1111111
-
-
sql> alter table stab move compress for archive high;
-
-
table altered.
-
-
sql> select owner,table_name,tablespace_name,compression,compress_for from all_tables where owner='gan' and table_name='stab';
-
-
owner table_name tablespace_name compress compress_for
-
------------------------------ ------------------------------ ------------------------------ -------- ------------
-
gan stab gants enabled archive high
-
-
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;
-
-
fno blk rnum a b
-
---------- ---------- ---------- ---------- --------------------
-
5 227 0 1 1111111
-
5 227 1 2 1111111
阅读(1266) | 评论(0) | 转发(0) |