{"id":4157,"date":"2021-04-29T07:54:48","date_gmt":"2021-04-29T07:54:48","guid":{"rendered":"https:\/\/swiv.com.br\/enabling-rman-backup-compression\/"},"modified":"2026-05-27T20:02:32","modified_gmt":"2026-05-27T19:02:32","slug":"enabling-rman-backup-compression","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/04\/29\/enabling-rman-backup-compression\/","title":{"rendered":"Enabling RMAN Backup Compression"},"content":{"rendered":"\n<p>Neste artigo vamos explorar algumas maneiras de utilizar a compress\u00e3o no momento do backup do RMAN.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">RMAN Persistent Settings<\/h2>\n\n\n<p>O pr\u00f3prio RMAN possui algumas configura\u00e7\u00f5es persistentes que nos permitem configurar de forma antecipada este tipo de recurso. O par\u00e2metro &#8220;COMPRESSION ALGORITHM&#8221; foi utilizado <a rel=\"\\&quot;noreferrer noopener\" noopener=\"\" href=\"https:\/\/swiv.com.br\/comparing-compressed-rman-backups\/\" target=\"\\&quot;_blank\\&quot;\">NESTE <\/a>artigo, e \u00e9 respons\u00e1vel por definirmos o m\u00e9todo de compress\u00e3o do RMAN. Segue abaixo um exemplo de seu uso:<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCONFIGURE COMPRESSION ALGORITHM &#039;&#x5B;BASIC|HIGH|MEDIUM|LOW]&#039;\n<\/pre><\/div>\n\n\n<p>Exemplo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@oel8 ~]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Wed Apr 28 04:55:12 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle and\/or its affiliates.  All rights reserved.\n \nconnected to target database: RMANDB (DBID=3825250984)\n \nRMAN&gt; CONFIGURE COMPRESSION ALGORITHM &#039;MEDIUM&#039;;\n \nnew RMAN configuration parameters:\nCONFIGURE COMPRESSION ALGORITHM &#039;MEDIUM&#039; AS OF RELEASE &#039;DEFAULT&#039; OPTIMIZE FOR LOAD TRUE;\nnew RMAN configuration parameters are successfully stored\n \nRMAN&gt; BACKUP AS COMPRESSED BACKUPSET DATABASE TAG &#039;COMPRESSAO_MEDIUM&#039;;\n \nStarting backup at 2021-04-28:04:55:55\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=98 device type=DISK\nchannel ORA_DISK_1: starting compressed full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00001 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\ninput datafile file number=00003 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\ninput datafile file number=00004 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\ninput datafile file number=00005 name=\/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\nchannel ORA_DISK_1: starting piece 1 at 2021-04-28:04:55:55\nchannel ORA_DISK_1: finished piece 1 at 2021-04-28:04:56:20\npiece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_28\/o1_mf_nnndf_COMPRESSAO_MEDIUM_j8l58ct2_.bkp tag=COMPRESSAO_MEDIUM comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:25\nFinished backup at 2021-04-28:04:56:20\n \nStarting Control File and SPFILE Autobackup at 2021-04-28:04:56:20\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_28\/o1_mf_s_1071032181_j8l595hc_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-04-28:04:56:22\n \nRMAN&gt; LIST BACKUPSET TAG &#039;COMPRESSAO_MEDIUM&#039;;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n220     Full    361.20M    DISK        00:00:15     2021-04-28:04:56:10\n        BP Key: 220   Status: AVAILABLE  Compressed: YES  Tag: COMPRESSAO_MEDIUM\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_28\/o1_mf_nnndf_COMPRESSAO_MEDIUM_j8l58ct2_.bkp\n  List of Datafiles in backup set 220\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  1       Full 2366768    2021-04-28:04:55:55              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\n  3       Full 2366768    2021-04-28:04:55:55              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\n  4       Full 2366768    2021-04-28:04:55:55              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\n  5       Full 2366768    2021-04-28:04:55:55              NO    \/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\n  7       Full 2366768    2021-04-28:04:55:55              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n<\/pre><\/div>\n\n\n<p>No par\u00e2metro &#8220;DEVICE TYPE&#8221; tamb\u00e9m conseguimos definir se teremos compress\u00e3o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCONFIGURE DEVICE TYPE &#x5B;DISK | SBT] BACKUP TYPE TO COMPRESSED BACKUPSET\n<\/pre><\/div>\n\n\n<p>Exemplo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET;\n \nold RMAN configuration parameters:\nCONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;\nnew RMAN configuration parameters:\nCONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;\nnew RMAN configuration parameters are successfully stored\nreleased channel: ORA_DISK_1\n \nRMAN&gt; BACKUP TABLESPACE USERS;\n \nStarting backup at 2021-04-28:05:03:11\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=98 device type=DISK\nchannel ORA_DISK_1: starting compressed full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\nchannel ORA_DISK_1: starting piece 1 at 2021-04-28:05:03:11\nchannel ORA_DISK_1: finished piece 1 at 2021-04-28:05:03:12\npiece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_28\/o1_mf_nnndf_TAG20210428T050311_j8l5ozmf_.bkp tag=TAG20210428T050311 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 2021-04-28:05:03:12\n \nStarting Control File and SPFILE Autobackup at 2021-04-28:05:03:12\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_28\/o1_mf_s_1071032592_j8l5p15c_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-04-28:05:03:13\n \nRMAN&gt; LIST BACKUP OF TABLESPACE USERS;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n224     Full    2.28M      DISK        00:00:00     2021-04-28:05:03:11\n        BP Key: 224   Status: AVAILABLE  Compressed: YES  Tag: TAG20210428T050311\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_28\/o1_mf_nnndf_TAG20210428T050311_j8l5ozmf_.bkp\n  List of Datafiles in backup set 224\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  7       Full 2367286    2021-04-28:05:03:11              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">RMAN Session<\/h2>\n\n\n\n<p>A compress\u00e3o tamb\u00e9m pode ser definida na sess\u00e3o do RMAN, conforme modelo abaixo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSET COMPRESSION ALGORITHM &#039;&#x5B;BASIC|HIGH|MEDIUM|LOW]&#039;;\n<\/pre><\/div>\n\n\n<p>Para simular este cen\u00e1rio, deixarei os par\u00e2metros persistentes sem a op\u00e7\u00e3o de compress\u00e3o:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; CONFIGURE COMPRESSION ALGORITHM CLEAR;\n \nRMAN configuration parameters are successfully reset to default value\n \nRMAN&gt; CONFIGURE DEVICE TYPE DISK CLEAR;\n \nold RMAN configuration parameters:\nCONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 1;\nRMAN configuration parameters are successfully reset to default value\nreleased channel: ORA_DISK_1\n \nRMAN&gt; SHOW COMPRESSION ALGORITHM;\n \nRMAN configuration parameters for database with db_unique_name RMANDB are:\nCONFIGURE COMPRESSION ALGORITHM &#039;BASIC&#039; AS OF RELEASE &#039;DEFAULT&#039; OPTIMIZE FOR LOAD TRUE ; # default\n \nRMAN&gt; SHOW DEVICE TYPE;\n \nRMAN configuration parameters for database with db_unique_name RMANDB are:\nCONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default\n<\/pre><\/div>\n\n\n<p>Podemos notar no exemplo abaixo que apesar de definirmos a n\u00edvel de sess\u00e3o o algoritmo de compress\u00e3o, o backup em si n\u00e3o \u00e9 realizado com este recurso:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; SET COMPRESSION ALGORITHM &#039;HIGH&#039;;\n \nexecuting command: SET compression\n \nRMAN&gt; SHOW COMPRESSION ALGORITHM\n2&gt; ;\n \nRMAN configuration parameters for database with db_unique_name RMANDB are:\nCONFIGURE COMPRESSION ALGORITHM &#039;HIGH&#039; AS OF RELEASE &#039;DEFAULT&#039; OPTIMIZE FOR LOAD TRUE ; # default\n \nRMAN&gt; BACKUP TABLESPACE USERS;\n \nStarting backup at 2021-04-29:04:35:54\nusing channel ORA_DISK_1\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\nchannel ORA_DISK_1: starting piece 1 at 2021-04-29:04:35:54\nchannel ORA_DISK_1: finished piece 1 at 2021-04-29:04:35:58\npiece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_29\/o1_mf_nnndf_TAG20210429T043554_j8nrgv69_.bkp tag=TAG20210429T043554 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:04\nFinished backup at 2021-04-29:04:35:58\n \nStarting Control File and SPFILE Autobackup at 2021-04-29:04:35:58\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_29\/o1_mf_s_1071117358_j8nrgyn7_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-04-29:04:35:59\n \nRMAN&gt; LIST BACKUP OF TABLESPACE USERS;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n240     Full    13.25M     DISK        00:00:01     2021-04-29:04:35:55\n        BP Key: 240   Status: AVAILABLE  Compressed: NO  Tag: TAG20210429T043554\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_29\/o1_mf_nnndf_TAG20210429T043554_j8nrgv69_.bkp\n  List of Datafiles in backup set 240\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  7       Full 2501534    2021-04-29:04:35:54              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>Para que ele considere a compress\u00e3o, podemos utilizar a sintaxe &#8220;AS COMPRESSED&#8221; conforme abaixo:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMAN&gt; BACKUP AS COMPRESSED BACKUPSET DATABASE TAG &#039;BSS&#039;;\n \nStarting backup at 2021-04-29:04:39:43\nusing channel ORA_DISK_1\nchannel ORA_DISK_1: starting compressed full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00001 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\ninput datafile file number=00003 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\ninput datafile file number=00004 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\ninput datafile file number=00005 name=\/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\ninput datafile file number=00007 name=\/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\nchannel ORA_DISK_1: starting piece 1 at 2021-04-29:04:39:43\nchannel ORA_DISK_1: finished piece 1 at 2021-04-29:04:41:59\npiece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_29\/o1_mf_nnndf_BSS_j8nrp002_.bkp tag=BSS comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:02:16\nFinished backup at 2021-04-29:04:41:59\n \nStarting Control File and SPFILE Autobackup at 2021-04-29:04:41:59\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_29\/o1_mf_s_1071117719_j8nrt7kk_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-04-29:04:42:00\n \nRMAN&gt; LIST BACKUPSET TAG &#039;BSS&#039;;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n242     Full    294.20M    DISK        00:02:12     2021-04-29:04:41:55\n        BP Key: 242   Status: AVAILABLE  Compressed: YES  Tag: BSS\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_29\/o1_mf_nnndf_BSS_j8nrp002_.bkp\n  List of Datafiles in backup set 242\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  1       Full 2501670    2021-04-29:04:39:43              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\n  3       Full 2501670    2021-04-29:04:39:43              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\n  4       Full 2501670    2021-04-29:04:39:43              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\n  5       Full 2501670    2021-04-29:04:39:43              NO    \/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\n  7       Full 2501670    2021-04-29:04:39:43              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n<\/pre><\/div>\n\n\n<p>Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laborat\u00f3rio pessoal para fins de aprendizado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neste artigo vamos explorar algumas maneiras de utilizar a compress\u00e3o no momento do backup do RMAN. RMAN Persistent Settings O pr\u00f3prio RMAN possui algumas configura\u00e7\u00f5es persistentes que nos permitem configurar de forma antecipada este tipo de recurso. O par\u00e2metro &#8220;COMPRESSION ALGORITHM&#8221; foi utilizado NESTE artigo, e \u00e9 respons\u00e1vel por definirmos o m\u00e9todo de compress\u00e3o do [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4157","post","type-post","status-publish","format-standard","hentry","category-backup-recovery"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=4157"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4157\/revisions"}],"predecessor-version":[{"id":9156,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4157\/revisions\/9156"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=4157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=4157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=4157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}