{"id":3636,"date":"2021-04-09T09:00:19","date_gmt":"2021-04-09T09:00:19","guid":{"rendered":"https:\/\/swiv.com.br\/managing-rman-expired-backup-files\/"},"modified":"2026-05-27T20:02:33","modified_gmt":"2026-05-27T19:02:33","slug":"managing-rman-expired-backup-files","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/04\/09\/managing-rman-expired-backup-files\/","title":{"rendered":"Managing RMAN expired backup files"},"content":{"rendered":"\n<p>Arquivos de backup expirados, no conceito Oracle RMAN, s\u00e3o aqueles arquivos marcados como dispon\u00edveis pelo reposit\u00f3rio do RMAN, mas que atualmente n\u00e3o est\u00e3o, geralmente por terem sido deletados ou movidos para outro local ou nome, via sistema operacional ou ferramenta de terceiros.<\/p>\n\n\n\n<p>Para confirmarmos se temos algum expired backup em nosso ambiente:<\/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 BACKUP]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Fri Apr 9 05:50:45 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; LIST EXPIRED BACKUPSET;\n \nusing target database control file instead of recovery catalog\nspecification does not match any backup in the repository\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>Para simular este comportamento, vou coletar os backups da tablespace USERS:<\/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; 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------- ---- -- ---------- ----------- ------------ -------------------\n154     Full    1.23G      DISK        00:00:58     2021-04-09:04:32:03\n        BP Key: 154   Status: AVAILABLE  Compressed: NO  Tag: DB_FULL_BS\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_DB_FULL_BS_j700oxtx_.bkp\n  List of Datafiles in backup set 154\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  7       Full 2260904    2021-04-09:04:31:05              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n156     Full    2.16M      DISK        00:00:00     2021-04-09:04:34:09\n        BP Key: 156   Status: AVAILABLE  Compressed: NO  Tag: USERS_BS\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vk1w_.bkp\n  List of Datafiles in backup set 156\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  7       Full 2261773    2021-04-09:04:34:09              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n158     Full    2.16M      DISK        00:00:00     2021-04-09:04:34:16\n        BP Key: 158   Status: AVAILABLE  Compressed: NO  Tag: USERS_BS\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vrh3_.bkp\n  List of Datafiles in backup set 158\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  7       Full 2261805    2021-04-09:04:34:16              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n<\/pre><\/div>\n\n\n<p>Vou renomear um dos backupsets listados acima:<\/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; host &#039;mv \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vrh3_.bkp \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/BSS.bkp&#039;;    \nhost command complete\n<\/pre><\/div>\n\n\n<p>Ao consultar novamente se h\u00e1 arquivos expirados, percebemos que o RMAN ainda n\u00e3o reporta o evento:<\/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; LIST EXPIRED BACKUPSET;\n \nspecification does not match any backup in the repository\n<\/pre><\/div>\n\n\n<p>Isso ocorre pois o RMAN precisa realizar uma compara\u00e7\u00e3o entre as informa\u00e7\u00f5es que est\u00e3o em seu reposit\u00f3rio e os arquivos (fisicamente falando). Podemos disparar o comando CROSSCHECK para possibilitar esse trabalho por parte do RMAN:<\/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; CROSSCHECK BACKUPSET;\n \nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=36 device type=DISK\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_DB_FULL_BS_j700oxtx_.bkp RECID=154 STAMP=1069389069\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389141_j700r62m_.bkp RECID=155 STAMP=1069389142\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vk1w_.bkp RECID=156 STAMP=1069389249\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389250_j700vlmc_.bkp RECID=157 STAMP=1069389250\ncrosschecked backup piece: found to be &#039;EXPIRED&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vrh3_.bkp RECID=158 STAMP=1069389256\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389257_j700vt63_.bkp RECID=159 STAMP=1069389258\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389599_j7016hx3_.bkp RECID=160 STAMP=1069389599\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_annnn_ARC_BS_j701d662_.bkp RECID=161 STAMP=1069389782\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389785_j701d9kj_.bkp RECID=162 STAMP=1069389785\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069390192_j701s0pz_.bkp RECID=163 STAMP=1069390192\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_annnn_TAG20210409T051721_j703dkjz_.bkp RECID=164 STAMP=1069391841\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069391842_j703dm1l_.bkp RECID=165 STAMP=1069391843\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/BACKUP\/78vrr850_1_1 RECID=166 STAMP=1069392032\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069392033_j703llbt_.bkp RECID=167 STAMP=1069392034\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/BACKUP\/7avrr85l_1_1 RECID=168 STAMP=1069392053\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069392054_j703m70y_.bkp RECID=169 STAMP=1069392055\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069392227_j703rmm7_.bkp RECID=170 STAMP=1069392227\nCrosschecked 17 objects\n<\/pre><\/div>\n\n\n<p>A partir desse ponto, o RMAN identifica e reporta o arquivo expirado:<\/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; LIST EXPIRED BACKUPSET;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n158     Full    2.16M      DISK        00:00:00     2021-04-09:04:34:16\n        BP Key: 158   Status: EXPIRED  Compressed: NO  Tag: USERS_BS\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vrh3_.bkp\n  List of Datafiles in backup set 158\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  7       Full 2261805    2021-04-09:04:34:16              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n<\/pre><\/div>\n\n\n<p>Voltando o nome do backupset para o original:<\/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; host &#039;mv \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/BSS.bkp \/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vrh3_.bkp&#039;;\n \nhost command complete\n<\/pre><\/div>\n\n\n<p>Realizando o crosscheck:<\/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; CROSSCHECK BACKUPSET;\n \nusing channel ORA_DISK_1\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_DB_FULL_BS_j700oxtx_.bkp RECID=154 STAMP=1069389069\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389141_j700r62m_.bkp RECID=155 STAMP=1069389142\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vk1w_.bkp RECID=156 STAMP=1069389249\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389250_j700vlmc_.bkp RECID=157 STAMP=1069389250\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_nnndf_USERS_BS_j700vrh3_.bkp RECID=158 STAMP=1069389256\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389257_j700vt63_.bkp RECID=159 STAMP=1069389258\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389599_j7016hx3_.bkp RECID=160 STAMP=1069389599\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_annnn_ARC_BS_j701d662_.bkp RECID=161 STAMP=1069389782\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069389785_j701d9kj_.bkp RECID=162 STAMP=1069389785\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069390192_j701s0pz_.bkp RECID=163 STAMP=1069390192\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_04_09\/o1_mf_annnn_TAG20210409T051721_j703dkjz_.bkp RECID=164 STAMP=1069391841\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069391842_j703dm1l_.bkp RECID=165 STAMP=1069391843\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/BACKUP\/78vrr850_1_1 RECID=166 STAMP=1069392032\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069392033_j703llbt_.bkp RECID=167 STAMP=1069392034\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/BACKUP\/7avrr85l_1_1 RECID=168 STAMP=1069392053\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069392054_j703m70y_.bkp RECID=169 STAMP=1069392055\ncrosschecked backup piece: found to be &#039;AVAILABLE&#039;\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_04_09\/o1_mf_s_1069392227_j703rmm7_.bkp RECID=170 STAMP=1069392227\nCrosschecked 17 objects\n<\/pre><\/div>\n\n\n<p>Vemos que n\u00e3o temos mais backupset definido como expirado:<\/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; LIST EXPIRED BACKUPSET;\n \nspecification does not match any backup in the repository\n \nRMAN&gt;\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>Arquivos de backup expirados, no conceito Oracle RMAN, s\u00e3o aqueles arquivos marcados como dispon\u00edveis pelo reposit\u00f3rio do RMAN, mas que atualmente n\u00e3o est\u00e3o, geralmente por terem sido deletados ou movidos para outro local ou nome, via sistema operacional ou ferramenta de terceiros. Para confirmarmos se temos algum expired backup em nosso ambiente: Para simular este [&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-3636","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\/3636","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=3636"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3636\/revisions"}],"predecessor-version":[{"id":9182,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3636\/revisions\/9182"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=3636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=3636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=3636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}