About Me

Saturday, 22 October 2011

ORACLE TABLE COMPRESSION

Oracle compress data by removing non unique values in a data-block. Any duplicate occurrence of a value in a block is replaced by a symbol entry in  “symbol table” in the data block.for example deptno=20 is repeated 7 times in a data block, it will be stored only once and rest 6 times a symbol entry will be stored in symbol table.

SQL>select bytes/1024/1024 "Size" from user_segments where segment_name='EMP';

Size
----------
18

SQL> alter table emp move compress;


Table altered.

SQL> select bytes/1024/1024 "Size" from user_segments
2 where segment_name='EMP';

Size
----------
6

since you have compressed the table and hence row id's of the rows are changed ,its recommended that you rebuild the indexes of the compressed tables.





No comments:

Post a Comment