Perform the following steps in order to enable advanced compression:
SQL> select parameter,value from v$option where parameter='Advanced Compression'; PARAMETER VALUE ------------------------- ----- Advanced Compression TRUE SQL> select dest_id,compression,db_unique_name from v$archive_dest where dest_id=2; DEST_ID COMPRESSION DB_UNIQUE_NAME ---------- --------------- ------------------------------ 2 DISABLE INDIA_UN
SQL> alter system set LOG_ARCHIVE_DEST_2='service=INDIA LGWR ASYNC COMPRESSION=ENABLE VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=INDIA_UN'; System altered. SQL> select dest_id,compression,db_unique_name from v$archive_dest where dest_id=2; DEST_ID COMPRESSION DB_UNIQUE_NAME ---------- --------------- ------------------------------ 2 ENABLE INDIA_UN
SQL> conn packt/packt Connected. SQL> insert into oracle select * from oracle; 41943040 rows created. SQL> commit; Commit complete. SQL>
Packt
as follows:SQL> ; 1 select v$session.sid, username, value redo_size 2 from v$sesstat, v$statname, v$session 3 where v$sesstat.STATISTIC# = v$statname.STATISTIC# 4 and v$session.sid = v$sesstat.sid 5 and name = 'redo size' 6 and value > 0 7 and username is not null 8* order by value SQL> / SID USERNAME REDO_SIZE ---------- ------------------------------ ---------- 48 packt 2125379564
zlib
engine at level 1 as gzip
. So you can verify it using the gzip
command as follows:[oracle@oracle-primary 2012_11_08]$ gzip -1 o1_mf_1_753_89q187xv_.arc [oracle@oracle-primary 2012_11_08]$ ls -ltr o1_mf_1_749_89q13d2* -rw-r----- 1 oracle oinstall 8209301 Nov 8 15:37 o1_mf_1_749_89q13d2z_.arc.gz [oracle@oracle-primary 2012_11_08]$ gzip --list o1_ mf_1_749_89q13d2z_.arc.gz compressed uncompressed ratio uncompressed_name 8209301 101288960 91.9% o1_mf_1_749_89q13d2z_.arc [oracle@oracle-primary 2012_11_08]$
In the previous output, after enabling compression, nine percent of the actual data has been compressed and transported to the standby database. Note that the compression ratio may vary.