{"id":2581,"date":"2021-03-12T09:01:58","date_gmt":"2021-03-12T09:01:58","guid":{"rendered":"https:\/\/swiv.com.br\/taking-whole-oracle-database-backup\/"},"modified":"2026-05-27T20:02:51","modified_gmt":"2026-05-27T19:02:51","slug":"taking-whole-oracle-database-backup","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/03\/12\/taking-whole-oracle-database-backup\/","title":{"rendered":"Taking whole Oracle Database backup"},"content":{"rendered":"\n<p>Antes de disparar o backup em si, podemos checar se o diret\u00f3rio de FRA, que abrigar\u00e1 os backup pieces, est\u00e1 definido:<\/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 ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Fri Mar 12 05:26:29 2021\nVersion 18.3.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.3.0.0.0\n \nSQL&gt; SHO PARAMETER db_recovery_file_dest\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\ndb_recovery_file_dest                string      \/oracle\/fra\ndb_recovery_file_dest_size           big integer 2G\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Baixando e montando o banco de dados para permitir o backup:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\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>Utilizando o RMAN para disparar o comando de backup. Como os valores dos par\u00e2metros persistentes do RMAN est\u00e3o  todos como Default, e no comando n\u00e3o estou alterando nenhum outro par\u00e2metro, o comportamento que o mesmo adotar\u00e1 ser\u00e1 criar o backup piece no diret\u00f3rio da FRA, utilizando apenas um canal:<\/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 oracle]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Fri Mar 12 05:41:07 2021\nVersion 18.3.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;\n \nStarting backup at 2021-03-12:05:41:16\nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=7 device type=DISK\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-03-12:05:41:18\nchannel ORA_DISK_1: finished piece 1 at 2021-03-12:05:42:23\npiece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_03_12\/o1_mf_nnndf_TAG20210312T054118_j4pb9gv3_.bkp tag=TAG20210312T054118 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:05\nFinished backup at 2021-03-12:05:42:23\n \nStarting Control File and SPFILE Autobackup at 2021-03-12:05:42:24\npiece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_12\/o1_mf_s_1066973440_j4pbck5m_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 2021-03-12:05:42:27\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>Analisando os detalhes dos backupsets 2 e 3 com o comando LIST:<\/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 BACKUPSET 2,3;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n2       Full    1.15G      DISK        00:00:41     2021-03-12:05:41:59\n        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20210312T054118\n        Piece Name: \/oracle\/fra\/RMANDB\/backupset\/2021_03_12\/o1_mf_nnndf_TAG20210312T054118_j4pb9gv3_.bkp\n  List of Datafiles in backup set 2\n  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- ------------------- ----------- ------ ----\n  1       Full 1805356    2021-03-12:05:30:40              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_system_h8nynqfx_.dbf\n  3       Full 1805356    2021-03-12:05:30:40              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_sysaux_h8nyq35q_.dbf\n  4       Full 1805356    2021-03-12:05:30:40              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_undotbs1_h8nyrjdr_.dbf\n  5       Full 1805356    2021-03-12:05:30:40              NO    \/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf\n  7       Full 1805356    2021-03-12:05:30:40              NO    \/oracle\/dados\/RMANDB\/datafile\/o1_mf_users_h8nyrkn7_.dbf\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ -------------------\n3       Full    10.20M     DISK        00:00:01     2021-03-12:05:42:25\n        BP Key: 3   Status: AVAILABLE  Compressed: NO  Tag: TAG20210312T054224\n        Piece Name: \/oracle\/fra\/RMANDB\/autobackup\/2021_03_12\/o1_mf_s_1066973440_j4pbck5m_.bkp\n  Control File Included: Ckp SCN: 1805356      Ckp time: 2021-03-12:05:30:40\n  SPFILE Included: Modification time: 2021-03-12:05:40:39\n  SPFILE db_unique_name: RMANDB\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>Realizando consulta sobre a porcentagem de uso da FRA:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; SET LIN 300\nSQL&gt; SELECT FILE_TYPE,PERCENT_SPACE_USED,PERCENT_SPACE_RECLAIMABLE,NUMBER_OF_FILES FROM V$RECOVERY_AREA_USAGE;\n \nFILE_TYPE               PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES\n----------------------- ------------------ ------------------------- ---------------\nCONTROL FILE                           .49                         0               1\nREDO LOG                              7.32                         0               3\nARCHIVED LOG                             0                         0               0\nBACKUP PIECE                         58.52                        .5               3\nIMAGE COPY                               0                         0               0\nFLASHBACK LOG                            0                         0               0\nFOREIGN ARCHIVED LOG                     0                         0               0\nAUXILIARY DATAFILE COPY                  0                         0               0\n \n8 rows selected.\n<\/pre><\/div>\n\n\n<p>Realizando a remo\u00e7\u00e3o dos backupsets 2 e 3:<\/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 oracle]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Fri Mar 12 05:58:53 2021\nVersion 18.3.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; DELETE BACKUPSET 2,3;\n \nusing target database control file instead of recovery catalog\nallocated channel: ORA_DISK_1\nchannel ORA_DISK_1: SID=45 device type=DISK\n \nList of Backup Pieces\nBP Key  BS Key  Pc# Cp# Status      Device Type Piece Name\n------- ------- --- --- ----------- ----------- ----------\n2       2       1   1   AVAILABLE   DISK        \/oracle\/fra\/RMANDB\/backupset\/2021_03_12\/o1_mf_nnndf_TAG20210312T054118_j4pb9gv3_.bkp\n3       3       1   1   AVAILABLE   DISK        \/oracle\/fra\/RMANDB\/autobackup\/2021_03_12\/o1_mf_s_1066973440_j4pbck5m_.bkp\n \nDo you really want to delete the above objects (enter YES or NO)? YES\ndeleted backup piece\nbackup piece handle=\/oracle\/fra\/RMANDB\/backupset\/2021_03_12\/o1_mf_nnndf_TAG20210312T054118_j4pb9gv3_.bkp RECID=2 STAMP=1066974078\ndeleted backup piece\nbackup piece handle=\/oracle\/fra\/RMANDB\/autobackup\/2021_03_12\/o1_mf_s_1066973440_j4pbck5m_.bkp RECID=3 STAMP=1066974145\nDeleted 2 objects\n \n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>Consultando FRA novamente:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; set lin 300\nSQL&gt; SELECT FILE_TYPE,PERCENT_SPACE_USED,PERCENT_SPACE_RECLAIMABLE,NUMBER_OF_FILES FROM V$RECOVERY_AREA_USAGE;\n \nFILE_TYPE               PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE NUMBER_OF_FILES\n----------------------- ------------------ ------------------------- ---------------\nCONTROL FILE                           .49                         0               1\nREDO LOG                              7.32                         0               3\nARCHIVED LOG                             0                         0               0\nBACKUP PIECE                            .5                         0               1\nIMAGE COPY                               0                         0               0\nFLASHBACK LOG                            0                         0               0\nFOREIGN ARCHIVED LOG                     0                         0               0\nAUXILIARY DATAFILE COPY                  0                         0               0\n \n8 rows selected.\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>Antes de disparar o backup em si, podemos checar se o diret\u00f3rio de FRA, que abrigar\u00e1 os backup pieces, est\u00e1 definido: Baixando e montando o banco de dados para permitir o backup: Utilizando o RMAN para disparar o comando de backup. Como os valores dos par\u00e2metros persistentes do RMAN est\u00e3o todos como Default, e no [&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-2581","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\/2581","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=2581"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2581\/revisions"}],"predecessor-version":[{"id":9237,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2581\/revisions\/9237"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=2581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=2581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=2581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}