{"id":4496,"date":"2021-05-11T07:22:11","date_gmt":"2021-05-11T07:22:11","guid":{"rendered":"https:\/\/swiv.com.br\/performing-rman-whole-cdb-backup\/"},"modified":"2026-05-27T20:02:32","modified_gmt":"2026-05-27T19:02:32","slug":"performing-rman-whole-cdb-backup","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/05\/11\/performing-rman-whole-cdb-backup\/","title":{"rendered":"Performing RMAN Whole CDB Backup"},"content":{"rendered":"\n<p>Os mesmos comandos emitidos para um backup de banco &#8220;Non-CDB&#8221; s\u00e3o aplic\u00e1veis para um banco do tipo CDB. Quando esta opera\u00e7\u00e3o de backup full \u00e9 realizada no root container, tanto o root quantos todos os PDBs ser\u00e3o contemplados. Caso seja necess\u00e1rio alterar o archivelog mode do banco, o processo \u00e9 exatamente o mesmo da arquitetura antiga. Por fim, tamb\u00e9m conseguimos checar todos os par\u00e2metros do RMAN atrav\u00e9s do comando SHOW ALL. Neste artigo, vamos praticar a execu\u00e7\u00e3o de um backup em arquitetura multitenant, considerando esses pormenores t\u00e9cnicos citados.<\/p>\n\n\n\n<p>Avaliando o atual CDB$ROOT e seus PDBs:<\/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@quiasma ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Tue May 11 04:02:16 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 NAME,LOG_MODE,CDB FROM V$DATABASE;\n \nNAME      LOG_MODE     CDB\n--------- ------------ ---\nTALAMO    ARCHIVELOG   YES\n \nSQL&gt; SELECT NAME FROM V$PDBS;\n \nNAME\n--------------------------------------------------------------------------------\nPDB$SEED\nHIPOFISE1\n<\/pre><\/div>\n\n\n<p>Avaliando os par\u00e2metros persistentes 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=\"\">\n&#x5B;oracle@quiasma ~]$ rman target \/\n \nRecovery Manager: Release 18.0.0.0.0 - Production on Tue May 11 04:07:37 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: TALAMO (DBID=2194831545)\n \nRMAN&gt; SHOW ALL;\n \nusing target database control file instead of recovery catalog\nRMAN configuration parameters for database with db_unique_name TALAMO are:\nCONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default\nCONFIGURE BACKUP OPTIMIZATION OFF; # default\nCONFIGURE DEFAULT DEVICE TYPE TO DISK; # default\nCONFIGURE CONTROLFILE AUTOBACKUP ON; # default\nCONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO &#039;%F&#039;; # default\nCONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default\nCONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default\nCONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default\nCONFIGURE MAXSETSIZE TO UNLIMITED; # default\nCONFIGURE ENCRYPTION FOR DATABASE OFF; # default\nCONFIGURE ENCRYPTION ALGORITHM &#039;AES128&#039;; # default\nCONFIGURE COMPRESSION ALGORITHM &#039;BASIC&#039; AS OF RELEASE &#039;DEFAULT&#039; OPTIMIZE FOR LOAD TRUE ; # default\nCONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default\nCONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default\nCONFIGURE SNAPSHOT CONTROLFILE NAME TO &#039;\/oracle\/18.0.0\/product\/dbs\/snapcf_TALAMO.f&#039;; # default\n<\/pre><\/div>\n\n\n<p>Avaliando o destino dos backups na FRA, vemos que \u00e9 necess\u00e1rio aumentar o seu tamanho limite para evitar problemas de espa\u00e7o durante 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; SHOW PARAMETER DB_RECOVERY_FILE_DEST;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\ndb_recovery_file_dest                string      \/oracle\/fra\ndb_recovery_file_dest_size           big integer 1G\nSQL&gt; ALTER SYSTEM SET db_recovery_file_dest_size=5G;\n \nSystem altered.\n \nSQL&gt; SHOW PARAMETER DB_RECOVERY_FILE_DEST;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\ndb_recovery_file_dest                string      \/oracle\/fra\ndb_recovery_file_dest_size           big integer 5G\n<\/pre><\/div>\n\n\n<p>Como nos par\u00e2metros do RMAN j\u00e1 est\u00e1 considerando o autobackup do control file, vamos emitir o comando de backup abaixo, que far\u00e1 o backup do CDB$ROOT e todos os seus PDBs. Como os archives tamb\u00e9m ser\u00e3o contemplados, e o backup est\u00e1 sendo emitido com o banco no ar, o mesmo deve estar em archivelog mode:<\/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 PLUS ARCHIVELOG;\n \n \nStarting backup at 11-MAY-21\ncurrent log archived\nusing channel ORA_DISK_1\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=43 RECID=40 STAMP=1072239246\nchannel ORA_DISK_1: starting piece 1 at 11-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 11-MAY-21\npiece handle=\/oracle\/fra\/TALAMO\/backupset\/2021_05_11\/o1_mf_annnn_TAG20210511T041406_j9ncoy9j_.bkp tag=TAG20210511T041406 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 11-MAY-21\n \nStarting backup at 11-MAY-21\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=00001 name=\/oracle\/dados\/TALAMO\/datafile\/o1_mf_system_j3w17w26_.dbf\ninput datafile file number=00003 name=\/oracle\/dados\/TALAMO\/datafile\/o1_mf_sysaux_j3w1bkdm_.dbf\ninput datafile file number=00004 name=\/oracle\/dados\/TALAMO\/datafile\/o1_mf_undotbs1_j3w1cyoh_.dbf\ninput datafile file number=00007 name=\/oracle\/dados\/TALAMO\/datafile\/o1_mf_users_j3w1czy4_.dbf\nchannel ORA_DISK_1: starting piece 1 at 11-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 11-MAY-21\npiece handle=\/oracle\/fra\/TALAMO\/backupset\/2021_05_11\/o1_mf_nnndf_TAG20210511T041407_j9ncozj1_.bkp tag=TAG20210511T041407 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:15\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00085 name=\/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_system_j781yvm6_.dbf\ninput datafile file number=00086 name=\/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_sysaux_j781yvmc_.dbf\ninput datafile file number=00087 name=\/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_undotbs1_j781yvmc_.dbf\ninput datafile file number=00088 name=\/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_users_j7824z91_.dbf\nchannel ORA_DISK_1: starting piece 1 at 11-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 11-MAY-21\npiece handle=\/oracle\/fra\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/backupset\/2021_05_11\/o1_mf_nnndf_TAG20210511T041407_j9ncpgmk_.bkp tag=TAG20210511T041407 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:07\nchannel ORA_DISK_1: starting full datafile backup set\nchannel ORA_DISK_1: specifying datafile(s) in backup set\ninput datafile file number=00005 name=\/oracle\/dados\/TALAMO\/datafile\/o1_mf_system_j3w1q776_.dbf\ninput datafile file number=00006 name=\/oracle\/dados\/TALAMO\/datafile\/o1_mf_sysaux_j3w1q76z_.dbf\ninput datafile file number=00008 name=\/oracle\/dados\/TALAMO\/datafile\/o1_mf_undotbs1_j3w1q779_.dbf\nchannel ORA_DISK_1: starting piece 1 at 11-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 11-MAY-21\npiece handle=\/oracle\/fra\/TALAMO\/BC8B772AA6A82204E0536B00A8C0CF6B\/backupset\/2021_05_11\/o1_mf_nnndf_TAG20210511T041407_j9ncpoqs_.bkp tag=TAG20210511T041407 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:07\nFinished backup at 11-MAY-21\n \nStarting backup at 11-MAY-21\ncurrent log archived\nusing channel ORA_DISK_1\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=44 RECID=41 STAMP=1072239276\nchannel ORA_DISK_1: starting piece 1 at 11-MAY-21\nchannel ORA_DISK_1: finished piece 1 at 11-MAY-21\npiece handle=\/oracle\/fra\/TALAMO\/backupset\/2021_05_11\/o1_mf_annnn_TAG20210511T041436_j9ncpwyt_.bkp tag=TAG20210511T041436 comment=NONE\nchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01\nFinished backup at 11-MAY-21\n \nStarting Control File and SPFILE Autobackup at 11-MAY-21\npiece handle=\/oracle\/fra\/TALAMO\/autobackup\/2021_05_11\/o1_mf_s_1072239278_j9ncpy9s_.bkp comment=NONE\nFinished Control File and SPFILE Autobackup at 11-MAY-21\n<\/pre><\/div>\n\n\n<p>Listando os 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; LIST BACKUP;\n \n \nList of Backup Sets\n===================\n \n \nBS Key  Size       Device Type Elapsed Time Completion Time\n------- ---------- ----------- ------------ ---------------\n49      167.44M    DISK        00:00:00     11-MAY-21\n        BP Key: 49   Status: AVAILABLE  Compressed: NO  Tag: TAG20210511T041406\n        Piece Name: \/oracle\/fra\/TALAMO\/backupset\/2021_05_11\/o1_mf_annnn_TAG20210511T041406_j9ncoy9j_.bkp\n \n  List of Archived Logs in backup set 49\n  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time\n  ---- ------- ---------- --------- ---------- ---------\n  1    43      3639906    08-MAY-21 3709681    11-MAY-21\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ ---------------\n50      Full    1.42G      DISK        00:00:08     11-MAY-21\n        BP Key: 50   Status: AVAILABLE  Compressed: NO  Tag: TAG20210511T041407\n        Piece Name: \/oracle\/fra\/TALAMO\/backupset\/2021_05_11\/o1_mf_nnndf_TAG20210511T041407_j9ncozj1_.bkp\n  List of Datafiles in backup set 50\n  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- --------- ----------- ------ ----\n  1       Full 3709696    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/datafile\/o1_mf_system_j3w17w26_.dbf\n  3       Full 3709696    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/datafile\/o1_mf_sysaux_j3w1bkdm_.dbf\n  4       Full 3709696    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/datafile\/o1_mf_undotbs1_j3w1cyoh_.dbf\n  7       Full 3709696    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/datafile\/o1_mf_users_j3w1czy4_.dbf\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ ---------------\n51      Full    667.92M    DISK        00:00:04     11-MAY-21\n        BP Key: 51   Status: AVAILABLE  Compressed: NO  Tag: TAG20210511T041407\n        Piece Name: \/oracle\/fra\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/backupset\/2021_05_11\/o1_mf_nnndf_TAG20210511T041407_j9ncpgmk_.bkp\n  List of Datafiles in backup set 51\n  Container ID: 3, PDB Name: HIPOFISE1\n  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- --------- ----------- ------ ----\n  85      Full 3709702    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_system_j781yvm6_.dbf\n  86      Full 3709702    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_sysaux_j781yvmc_.dbf\n  87      Full 3709702    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_undotbs1_j781yvmc_.dbf\n  88      Full 3709702    11-MAY-21              NO    \/oracle\/dados\/TALAMO\/BFC37CDFCB3A0CF9E0536A00A8C0C9C5\/datafile\/o1_mf_users_j7824z91_.dbf\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ ---------------\n52      Full    713.02M    DISK        00:00:05     11-MAY-21\n        BP Key: 52   Status: AVAILABLE  Compressed: NO  Tag: TAG20210511T041407\n        Piece Name: \/oracle\/fra\/TALAMO\/BC8B772AA6A82204E0536B00A8C0CF6B\/backupset\/2021_05_11\/o1_mf_nnndf_TAG20210511T041407_j9ncpoqs_.bkp\n  List of Datafiles in backup set 52\n  Container ID: 2, PDB Name: PDB$SEED\n  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name\n  ---- -- ---- ---------- --------- ----------- ------ ----\n  5       Full 3007123    30-MAR-21              NO    \/oracle\/dados\/TALAMO\/datafile\/o1_mf_system_j3w1q776_.dbf\n  6       Full 3007123    30-MAR-21              NO    \/oracle\/dados\/TALAMO\/datafile\/o1_mf_sysaux_j3w1q76z_.dbf\n  8       Full 3007123    30-MAR-21              NO    \/oracle\/dados\/TALAMO\/datafile\/o1_mf_undotbs1_j3w1q779_.dbf\n \nBS Key  Size       Device Type Elapsed Time Completion Time\n------- ---------- ----------- ------------ ---------------\n53      10.50K     DISK        00:00:00     11-MAY-21\n        BP Key: 53   Status: AVAILABLE  Compressed: NO  Tag: TAG20210511T041436\n        Piece Name: \/oracle\/fra\/TALAMO\/backupset\/2021_05_11\/o1_mf_annnn_TAG20210511T041436_j9ncpwyt_.bkp\n \n  List of Archived Logs in backup set 53\n  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time\n  ---- ------- ---------- --------- ---------- ---------\n  1    44      3709681    11-MAY-21 3709717    11-MAY-21\n \nBS Key  Type LV Size       Device Type Elapsed Time Completion Time\n------- ---- -- ---------- ----------- ------------ ---------------\n54      Full    17.95M     DISK        00:00:00     11-MAY-21\n        BP Key: 54   Status: AVAILABLE  Compressed: NO  Tag: TAG20210511T041438\n        Piece Name: \/oracle\/fra\/TALAMO\/autobackup\/2021_05_11\/o1_mf_s_1072239278_j9ncpy9s_.bkp\n  SPFILE Included: Modification time: 11-MAY-21\n  SPFILE db_unique_name: TALAMO\n  Control File Included: Ckp SCN: 3709733      Ckp time: 11-MAY-21\n<\/pre><\/div>\n\n\n<p>Percebemos que o Backup Set n\u00famero 52 reporta que at\u00e9 o PDB$SEED foi considerado no backup (\u00e9 poss\u00edvel identificar isso pelo GUID que \u00e9 usado no nome do backup piece):<\/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; SELECT NAME,GUID FROM V$PDBS;\n \nNAME\n--------------------------------------------------------------------------------\nGUID\n--------------------------------\nPDB$SEED\nBC8B772AA6A82204E0536B00A8C0CF6B\n \nHIPOFISE1\nBFC37CDFCB3A0CF9E0536A00A8C0C9C5\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>Os mesmos comandos emitidos para um backup de banco &#8220;Non-CDB&#8221; s\u00e3o aplic\u00e1veis para um banco do tipo CDB. Quando esta opera\u00e7\u00e3o de backup full \u00e9 realizada no root container, tanto o root quantos todos os PDBs ser\u00e3o contemplados. Caso seja necess\u00e1rio alterar o archivelog mode do banco, o processo \u00e9 exatamente o mesmo da arquitetura [&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,8],"tags":[],"class_list":["post-4496","post","type-post","status-publish","format-standard","hentry","category-backup-recovery","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4496","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=4496"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4496\/revisions"}],"predecessor-version":[{"id":9143,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/4496\/revisions\/9143"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=4496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=4496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=4496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}