Time for action – enabling advanced compression

Perform the following steps in order to enable advanced compression:

  1. Check for the current settings of the remote destinations and options of compression as follows:
    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
  2. Enable compression by modifying the remote destination parameter as follows:
    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
  3. Perform a large number of DML transactions for testing purposes as follows:
    SQL> conn packt/packt
    Connected.
    SQL> insert into oracle select * from oracle;
    41943040 rows created.
    SQL> commit;
    Commit complete.
    SQL>
  4. Redo the size for the session of 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
  5. Advanced compression uses the mechanism of the 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.

What just happened?

We've just revised advanced compression with its brief introduction and also tested how compression of redo works in a Data Guard environment using a step-by-step approach.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.220.83