{"id":4395,"date":"2021-05-06T08:38:53","date_gmt":"2021-05-06T08:38:53","guid":{"rendered":"https:\/\/swiv.com.br\/creating-and-managing-rman-archival-database-backups\/"},"modified":"2026-05-27T20:02:32","modified_gmt":"2026-05-27T19:02:32","slug":"creating-and-managing-rman-archival-database-backups","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/05\/06\/creating-and-managing-rman-archival-database-backups\/","title":{"rendered":"Creating and Managing RMAN Archival Database Backups"},"content":{"rendered":"\n<p>Archival Backups s\u00e3o as exce\u00e7\u00f5es das pol\u00edticas de reten\u00e7\u00e3o do banco de dados, permitindo que os dados sejam preservados por um per\u00edodo muito maior do que definido via regra de reten\u00e7\u00e3o. Pode acontecer que a media usada para estes backups n\u00e3o fiquem dispon\u00edveis (exemplo de fitas que s\u00e3o armazenadas fora do datacenter), al\u00e9m do detalhe que este tipo de backup n\u00e3o pode ser feito na FRA (Fast Recovery Area). Um exemplo de uso deste recurso \u00e9 realizar um backup de cada fechamento trimestral, ou realizar um backup antes e ap\u00f3s um upgrade ou migra\u00e7\u00e3o importantes, etc. Neste artigo vamos explorar alguns cen\u00e1rios pr\u00e1ticos deste recurso.<\/p>\n\n\n\n<p>Em rela\u00e7\u00e3o \u00e0 sintaxe, a base de tudo \u00e9 o 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=\"\">\nBACKUP ... KEEP {UNTIL TIME &#x5B;=] &#039;date_string&#039; | FOREVER} | NOKEEP &#x5B;RESTORE POINT alias];\n<\/pre><\/div>\n\n\n<p>Podemos realizar este archival backup com o banco online ou offline (montado). Na segunda op\u00e7\u00e3o, n\u00e3o ser\u00e1 necess\u00e1rio os archivelogs ou backups incrementais para fazer o restore\/recover do banco, al\u00e9m de n\u00e3o ser necess\u00e1rio abrir o banco usando a op\u00e7\u00e3o RESETLOGS. Preparando nosso banco de dados para o teste:<\/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 admin]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Thu May 6 05:04:36 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; select instance_name,status from v$instance;\n \nINSTANCE_NAME    STATUS\n---------------- ------------\nRMANDB           OPEN\n \nSQL&gt; shu immediate;\nDatabase closed.\nDatabase dismounted.\nORACLE instance shut down.\nSQL&gt; startup mount;\nORACLE instance started.\n \nTotal System Global Area 1610612016 bytes\nFixed Size                  8658224 bytes\nVariable Size             520093696 bytes\nDatabase Buffers         1073741824 bytes\nRedo Buffers                8118272 bytes\nDatabase mounted.\nSQL&gt; select instance_name,status from v$instance;\n \nINSTANCE_NAME    STATUS\n---------------- ------------\nRMANDB           MOUNTED\n<\/pre><\/div>\n\n\n<p>Ao executar o comando abaixo recebemos um erro, pois a FRA n\u00e3o pode abrigar arquivos dessa natureza:<\/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 admin]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Thu May 6 05:06:59 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, not open)\n \nRMAN&gt; BACKUP DATABASE KEEP UNTIL TIME &#039;SYSDATE+365&#039;;\n \nStarting backup at 2021-05-06:05:07:02\n \nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=44 device type=DISK\nbackup will be obsolete on date 2022-05-06:05:07:02\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting 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-05-06:05:07:02\nRMAN-00571: ===========================================================\nRMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============\nRMAN-00571: ===========================================================\nRMAN-03002: failure of backup command at 05\/06\/2021 05:07:03\nORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes\n<\/pre><\/div>\n\n\n<p>Definindo no comando o destino dos arquivos, al\u00e9m de nomear o restore point para facilitar as consultas posteriores:<\/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 DATABASE FORMAT &#039;\/oracle\/dados\/RMANDB\/BACKUP1\/%U&#039; TAG DB_KEEP KEEP UNTIL TIME &#039;SYSDATE+365&#039; RESTORE POINT BSS;\n \nStarting backup at 2021-05-06:05:09:57\nusing target database control file instead of recovery catalog\n \nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=1 device type=DISK\nbackup will be obsolete on date 2022-05-06:05:09:57\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting 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-05-06:05:09:57\nchannel ORA_DISK_1: finished piece 1 at 2021-05-06:05:11:02\npiece handle=\/oracle\/dados\/RMANDB\/BACKUP1\/cqvu5215_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:05\n \n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 2022-05-06:05:11:03\narchived logs will not be kept or backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current SPFILE in backup set\nchannel ORA_DISK_1: starting piece 1 at 2021-05-06:05:11:03\nchannel ORA_DISK_1: finished piece 1 at 2021-05-06:05:11:04\npiece handle=\/oracle\/dados\/RMANDB\/BACKUP1\/crvu5237_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 2022-05-06:05:11:04\narchived logs will not be kept or backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current control file in backup set\nchannel ORA_DISK_1: starting piece 1 at 2021-05-06:05:11:05\nchannel ORA_DISK_1: finished piece 1 at 2021-05-06:05:11:06\npiece handle=\/oracle\/dados\/RMANDB\/BACKUP1\/csvu5238_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 2021-05-06:05:11:06\n<\/pre><\/div>\n\n\n<p>Abrindo o banco e listando informa\u00e7\u00f5es sobre o backup, observamos que foi definido uma TAG chamada DB_KEEP:<\/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; ALTER DATABASE OPEN;\n \nStatement processed\n \nRMAN&gt; LIST BACKUP OF DATABASE;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n321     Full    1.29G      DISK        00:00:43     2021-05-06:05:10:40\n        BP Key: 347   Status: AVAILABLE  Compressed: NO  Tag: DB_KEEP\n        Piece Name: \/oracle\/dados\/RMANDB\/BACKUP1\/cqvu5215_1_1\n        Keep: BACKUP_LOGS        Until: 2022-05-06:05:09:57\n  List of Datafiles in backup set 321\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  1       Full 2695951    2021-05-06:05:04:56              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\n  3       Full 2695951    2021-05-06:05:04:56              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\n  4       Full 2695951    2021-05-06:05:04:56              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\n  5       Full 2695951    2021-05-06:05:04:56              NO    \/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\n  7       Full 2695951    2021-05-06:05:04:56              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n<\/pre><\/div>\n\n\n<p>Com a query abaixo tamb\u00e9m podemos consultar todos os archival backups:<\/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; SELECT S.RECID, S.SET_COUNT, S.BACKUP_TYPE, S.PIECES, P.PIECE#, S.KEEP_OPTIONS, S.KEEP_UNTIL FROM V$BACKUP_SET S, V$BACKUP_PIECE P WHERE S.RECID = P.RECID AND S.KEEP=&#039;YES&#039;;\n \n     RECID  SET_COUNT B     PIECES     PIECE# KEEP_OPTION KEEP_UNTIL\n---------- ---------- - ---------- ---------- ----------- -------------------\n       321        410 D          1          1 BACKUP_LOGS 2022-05-06:05:09:57\n       322        411 D          1          1 NOLOGS      2022-05-06:05:11:03\n       323        412 D          1          1 NOLOGS      2022-05-06:05:11:04\n<\/pre><\/div>\n\n\n<p>Podemos consultar tamb\u00e9m todos os restore points existentes:<\/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 RESTORE POINT ALL;\n \nSCN              RSP Time            Type       Time                Name\n---------------- ------------------- ---------- ------------------- ----\n2695950                                         2021-05-06:05:11:02 BSS\n<\/pre><\/div>\n\n\n<p>Podemos procurar pelo nome espec\u00edfico do Restore Point:<\/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 RESTORE POINT BSS;\n \nSCN              RSP Time            Type       Time                Name\n---------------- ------------------- ---------- ------------------- ----\n2695950                                         2021-05-06:05:11:02 BSS\n<\/pre><\/div>\n\n\n<p>Caso queiramos usar este recurso fazendo o backup com o banco aberto, percebemos que o backup dos archivelogs tamb\u00e9m \u00e9 realizado, pois ser\u00e1 necess\u00e1rio em um eventual recover:<\/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 DATABASE FORMAT &#039;\/oracle\/dados\/RMANDB\/BACKUP1\/%U&#039; TAG DB_KEEP KEEP UNTIL TIME &#039;SYSDATE+365&#039; RESTORE POINT BSS1;\n \nStarting backup at 2021-05-06:05:19:49\n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 2022-05-06:05:19:49\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting 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-05-06:05:19:49\nchannel ORA_DISK_1: finished piece 1 at 2021-05-06:05:20:14\npiece handle=\/oracle\/dados\/RMANDB\/BACKUP1\/ctvu52jl_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:25\ncurrent log archived\n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 2022-05-06:05:20:17\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting archived log backup set\nchannel ORA_DISK_1: specifying archived log(s) in backup set\ninput archived log thread=1 sequence=100 RECID=110 STAMP=1071811216\nchannel ORA_DISK_1: starting piece 1 at 2021-05-06:05:20:17\nchannel ORA_DISK_1: finished piece 1 at 2021-05-06:05:20:18\npiece handle=\/oracle\/dados\/RMANDB\/BACKUP1\/cuvu52kh_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\n \n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 2022-05-06:05:20:19\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current SPFILE in backup set\nchannel ORA_DISK_1: starting piece 1 at 2021-05-06:05:20:19\nchannel ORA_DISK_1: finished piece 1 at 2021-05-06:05:20:20\npiece handle=\/oracle\/dados\/RMANDB\/BACKUP1\/cvvu52kj_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 2022-05-06:05:20:20\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current control file in backup set\nchannel ORA_DISK_1: starting piece 1 at 2021-05-06:05:20:21\nchannel ORA_DISK_1: finished piece 1 at 2021-05-06:05:20:22\npiece handle=\/oracle\/dados\/RMANDB\/BACKUP1\/d0vu52kk_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 2021-05-06:05:20:22\n \nRMAN&gt; LIST RESTORE POINT BSS1;\n \nSCN              RSP Time            Type       Time                Name\n---------------- ------------------- ---------- ------------------- ----\n2696931                                         2021-05-06:05:20:18 BSS1\n<\/pre><\/div>\n\n\n<p>Tentando realizar o mesmo backup, mas com a op\u00e7\u00e3o KEEP FOREVER. Vemos que esta condi\u00e7\u00e3o s\u00f3 \u00e9 poss\u00edvel utilizando o cat\u00e1logo 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; BACKUP DATABASE FORMAT &#039;\/oracle\/dados\/RMANDB\/BACKUP1\/%U&#039; TAG DB_KEEP KEEP FOREVER RESTORE POINT BSS2;\n \nStarting backup at 2021-05-06:05:24:36\n \nusing channel ORA_DISK_1\nRMAN-00571: ===========================================================\nRMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============\nRMAN-00571: ===========================================================\nRMAN-03002: failure of backup command at 05\/06\/2021 05:24:36\nRMAN-06522: KEEP FOREVER option is not supported without the recovery catalog\n<\/pre><\/div>\n\n\n<p>Desse modo, vou usar um outro banco de dados que possui cat\u00e1logo criado para testar esse recurso:<\/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@oel7 BACKUP]$ rman target \/ catalog CORTEX_CATALOG\/CORTEX_CATALOG@RMANDB\n \nRecovery Manager: Release 19.0.0.0.0 - Production on Thu May 6 05:28:08 2021\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle and\/or its affiliates.  All rights reserved.\n \nconnected to target database: CORTEX (DBID=548968087)\nRMAN-04007: warning from recovery catalog database: ORA-28002: the password will expire within 7 days\n \nconnected to recovery catalog database\n \nRMAN&gt; BACKUP DATABASE FORMAT &#039;\/oracle\/BACKUP\/%U&#039; TAG DB_KEEP KEEP FOREVER RESTORE POINT BSS2;\n \nStarting backup at 06-MAY-21\n \nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=7 device type=DISK\nbackup will never be obsolete\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00001 name=+DG_DATA\/CORTEX\/DATAFILE\/system.256.1039033445\ninput datafile file number=00005 name=+DG_DATA\/CORTEX\/DATAFILE\/soe.266.1065506205\ninput datafile file number=00003 name=+DG_DATA\/CORTEX\/DATAFILE\/sysaux.257.1039033519\ninput datafile file number=00004 name=+DG_DATA\/CORTEX\/DATAFILE\/undotbs1.258.1039033555\ninput datafile file number=00007 name=+DG_DATA\/CORTEX\/DATAFILE\/users.259.1039033555\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/03vu533c_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:02:45\ncurrent log archived\n \nusing channel ORA_DISK_1\nbackup will never be obsolete\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting archived log backup set\nchannel ORA_DISK_1: specifying archived log(s) in backup set\ninput archived log thread=1 sequence=24 RECID=20 STAMP=1071811858\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/04vu538k_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\n \n \nusing channel ORA_DISK_1\nbackup will never be obsolete\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current SPFILE in backup set\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/05vu538m_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\n \nusing channel ORA_DISK_1\nbackup will never be obsolete\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current control file in backup set\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/06vu538o_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 06-MAY-21\n \nRMAN&gt; LIST RESTORE POINT BSS2;\n \nSCN              RSP Time  Type       Time      Name\n---------------- --------- ---------- --------- ----\n3931139                               06-MAY-21 BSS2\n<\/pre><\/div>\n\n\n<p>Para finalizar o artigo, vamos simular uma situa\u00e7\u00e3o onde criamos um archival backup de 1 ano, mas depois queremos deix\u00e1-lo com reten\u00e7\u00e3o infinita:<\/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 DATABASE FORMAT &#039;\/oracle\/BACKUP\/%U&#039; TAG DB_KEEP KEEP UNTIL TIME &#039;SYSDATE+365&#039; RESTORE POINT BSS3;\n \nStarting backup at 06-MAY-21\n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 06-MAY-22\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00001 name=+DG_DATA\/CORTEX\/DATAFILE\/system.256.1039033445\ninput datafile file number=00005 name=+DG_DATA\/CORTEX\/DATAFILE\/soe.266.1065506205\ninput datafile file number=00003 name=+DG_DATA\/CORTEX\/DATAFILE\/sysaux.257.1039033519\ninput datafile file number=00004 name=+DG_DATA\/CORTEX\/DATAFILE\/undotbs1.258.1039033555\ninput datafile file number=00007 name=+DG_DATA\/CORTEX\/DATAFILE\/users.259.1039033555\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/07vu53ck_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:02:25\ncurrent log archived\n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 06-MAY-22\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting archived log backup set\nchannel ORA_DISK_1: specifying archived log(s) in backup set\ninput archived log thread=1 sequence=24 RECID=20 STAMP=1071811858\ninput archived log thread=1 sequence=25 RECID=21 STAMP=1071812134\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/08vu53h7_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\n \n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 06-MAY-22\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current SPFILE in backup set\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/09vu53h9_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\n \nusing channel ORA_DISK_1\nbackup will be obsolete on date 06-MAY-22\narchived logs required to recover from this backup will be backed up\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\nincluding current control file in backup set\nchannel ORA_DISK_1: starting piece 1 at 06-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 06-MAY-21\npiece handle=\/oracle\/BACKUP\/0avu53hb_1_1 tag=DB_KEEP comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 06-MAY-21\n \nRMAN&gt; LIST RESTORE POINT BSS3;\n \nSCN              RSP Time  Type       Time      Name\n---------------- --------- ---------- --------- ----\n3932348                               06-MAY-21 BSS3\n<\/pre><\/div>\n\n\n<p>Com o comando CHANGE podemos alterar este restore point para FOREVER:<\/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 DATABASE;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ ---------------\n85      Full    1.97G      DISK        00:02:03     06-MAY-21\n        BP Key: 88   Status: AVAILABLE  Compressed: NO  Tag: DB_KEEP\n        Piece Name: \/oracle\/BACKUP\/03vu533c_1_1\n        Keep: BACKUP_LOGS        Until: FOREVER\n  List of Datafiles in backup set 85\n  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- --------- ----------- ------ ----\n  1       Full 3931140    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/system.256.1039033445\n  3       Full 3931140    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/sysaux.257.1039033519\n  4       Full 3931140    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/undotbs1.258.1039033555\n  5       Full 3931140    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/soe.266.1065506205\n  7       Full 3931140    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/users.259.1039033555\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ ---------------\n143     Full    1.97G      DISK        00:02:00     06-MAY-21\n        BP Key: 145   Status: AVAILABLE  Compressed: NO  Tag: DB_KEEP\n        Piece Name: \/oracle\/BACKUP\/07vu53ck_1_1\n        Keep: BACKUP_LOGS        Until: 06-MAY-22\n  List of Datafiles in backup set 143\n  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- --------- ----------- ------ ----\n  1       Full 3932349    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/system.256.1039033445\n  3       Full 3932349    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/sysaux.257.1039033519\n  4       Full 3932349    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/undotbs1.258.1039033555\n  5       Full 3932349    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/soe.266.1065506205\n  7       Full 3932349    06-MAY-21              NO    +DG_DATA\/CORTEX\/DATAFILE\/users.259.1039033555\n \nRMAN&gt; CHANGE BACKUPSET 143 KEEP FOREVER;\n \nusing channel ORA_DISK_1\nkeep attributes for the backup are changed\nbackup will never be obsolete\nbackup set key=143 RECID=6 STAMP=1071812132\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>Archival Backups s\u00e3o as exce\u00e7\u00f5es das pol\u00edticas de reten\u00e7\u00e3o do banco de dados, permitindo que os dados sejam preservados por um per\u00edodo muito maior do que definido via regra de reten\u00e7\u00e3o. Pode acontecer que a media usada para estes backups n\u00e3o fiquem dispon\u00edveis (exemplo de fitas que s\u00e3o armazenadas fora do datacenter), al\u00e9m do detalhe [&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-4395","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\/4395","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=4395"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4395\/revisions"}],"predecessor-version":[{"id":9148,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4395\/revisions\/9148"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=4395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=4395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=4395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}