{"id":5622,"date":"2021-06-29T07:45:23","date_gmt":"2021-06-29T07:45:23","guid":{"rendered":"https:\/\/swiv.com.br\/creating-a-rman-recovery-catalog-and-registering-the-primary-and-standby-database\/"},"modified":"2026-05-27T20:02:31","modified_gmt":"2026-05-27T19:02:31","slug":"creating-a-rman-recovery-catalog-and-registering-the-primary-and-standby-database","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/06\/29\/creating-a-rman-recovery-catalog-and-registering-the-primary-and-standby-database\/","title":{"rendered":"Creating a RMAN Recovery Catalog and Registering the Primary and Standby Database"},"content":{"rendered":"\n<p>Neste artigo, vamos reproduzir a cria\u00e7\u00e3o de um Cat\u00e1logo de Backup RMAN em um ambiente Data Guard, contemplando tanto o Primary quanto o Standby Database (utilizando Data Broker). Al\u00e9m disso, veremos a quest\u00e3o do registro de ambos os ambientes no cat\u00e1logo, e a cria\u00e7\u00e3o da string de conex\u00e3o dentro do RMAN para cada banco de dados, o que facilitar\u00e1 opera\u00e7\u00f5es posteriores.<\/p>\n\n\n\n<p>Analisando a configura\u00e7\u00e3o do nosso Data Guard:<\/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@fornix1 ~]$ dgmgrl sys\/oracle@CORTEX as sysdba\nDGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Jun 29 04:15:31 2021\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle and\/or its affiliates.  All rights reserved.\n \nWelcome to DGMGRL, type &quot;help&quot; for information.\nConnected to &quot;cortex&quot;\nConnected as SYSDBA.\nDGMGRL&gt; SHOW CONFIGURATION;\n \nConfiguration - cortex\n \n  Protection Mode: MaxPerformance\n  Members:\n  cortex   - Primary database\n    cortexdr - Physical standby database\n \nFast-Start Failover:  Disabled\n \nConfiguration Status:\nSUCCESS   (status updated 41 seconds ago)\n \nDGMGRL&gt; SHOW DATABASE CORTEX;\n \nDatabase - cortex\n \n  Role:               PRIMARY\n  Intended State:     TRANSPORT-ON\n  Instance(s):\n    cortex\n \nDatabase Status:\nSUCCESS\n \nDGMGRL&gt;\n<\/pre><\/div>\n\n\n<p>Standby:<\/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@fornix2 ~]$ dgmgrl sys\/oracle@CORTEXDR as sysdba\nDGMGRL for Linux: Release 19.0.0.0.0 - Production on Tue Jun 29 04:16:08 2021\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle and\/or its affiliates.  All rights reserved.\n \nWelcome to DGMGRL, type &quot;help&quot; for information.\nConnected to &quot;cortexDR&quot;\nConnected as SYSDBA.\nDGMGRL&gt; SHOW DATABASE CORTEXDR;\n \nDatabase - cortexdr\n \n  Role:               PHYSICAL STANDBY\n  Intended State:     APPLY-ON\n  Transport Lag:      0 seconds (computed 0 seconds ago)\n  Apply Lag:          0 seconds (computed 0 seconds ago)\n  Average Apply Rate: 28.00 KByte\/s\n  Real Time Query:    ON\n  Instance(s):\n    CORTEXDR\n \nDatabase Status:\nSUCCESS\n \nDGMGRL&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Creating a RMAN Recovery Catalog<\/h2>\n\n\n\n<p>Obviamente, para ambientes corporativos, devemos criar o cat\u00e1logo de backup em um banco de dados separado daquele(s) que queremos registrar, mas como nosso artigo tem objetivo apenas educacional, vou criar o cat\u00e1logo dentro do meu banco primary:<\/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@fornix1 ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 19.0.0.0.0 - Production on Tue Jun 29 04:18:47 2021\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\nVersion 19.3.0.0.0\n \nSQL&gt; SELECT DB_UNIQUE_NAME,OPEN_MODE FROM V$DATABASE;\n \nDB_UNIQUE_NAME                 OPEN_MODE\n------------------------------ --------------------\ncortex                         READ WRITE\n \nSQL&gt; CREATE USER CAT IDENTIFIED BY CAT DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;\n \nUser created.\n \nSQL&gt; GRANT RECOVERY_CATALOG_OWNER TO CAT;\n \nGrant succeeded.\n<\/pre><\/div>\n\n\n<p>Criando cat\u00e1logo:<\/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@fornix1 ~]$ rman\n \nRecovery Manager: Release 19.0.0.0.0 - Production on Tue Jun 29 04:19:54 2021\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle and\/or its affiliates.  All rights reserved.\n \nRMAN&gt; CONNECT CATALOG CAT\/CAT@CORTEX\n \nconnected to recovery catalog database\n \nRMAN&gt; CREATE CATALOG;\n \nrecovery catalog created\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Registering the Databases in the recovery catalog<\/h2>\n\n\n\n<p>Registrando o banco Primary no novo cat\u00e1logo:<\/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; CONNECT TARGET \/\n \nconnected to target database: CORTEX (DBID=548968087)\n \nRMAN&gt; REGISTER DATABASE;\n \ndatabase registered in recovery catalog\nstarting full resync of recovery catalog\nfull resync complete\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>Validando o banco registrado:<\/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 DB_UNIQUE_NAME OF DATABASE;\n \n \nList of Databases\nDB Key  DB Name  DB ID            Database Role    Db_unique_name\n------- ------- ----------------- ---------------  ------------------\n1       CORTEX   548968087        PRIMARY          CORTEX\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>O mais legal \u00e9 que o registro do Standby Database acontece automaticamente quando conectamos no cat\u00e1logo com o standby, 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=\"\">\n&#x5B;oracle@fornix2 ~]$ rman target \/ catalog CAT\/CAT@CORTEX\n \nRecovery Manager: Release 19.0.0.0.0 - Production on Tue Jun 29 04:24:55 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)\nconnected to recovery catalog database\n \nRMAN&gt; LIST DB_UNIQUE_NAME OF DATABASE;\n \n \nList of Databases\nDB Key  DB Name  DB ID            Database Role    Db_unique_name\n------- ------- ----------------- ---------------  ------------------\n1       CORTEX   548968087        PRIMARY          CORTEX\n1       CORTEX   548968087        STANDBY          CORTEXDR\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Defining the connect string for the primary and standby databases<\/h2>\n\n\n\n<p>Por fim, podemos definir uma string\/alias que representar\u00e1 os 2 bancos em opera\u00e7\u00f5es que faremos em artigos posteriores, como na execu\u00e7\u00e3o de comandos LIST ou REPORT no 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@fornix1 ~]$ rman target \/ catalog CAT\/CAT@CORTEX\n \nRecovery Manager: Release 19.0.0.0.0 - Production on Tue Jun 29 04:32:11 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)\nconnected to recovery catalog database\n \nRMAN&gt; CONFIGURE DB_UNIQUE_NAME CORTEX CONNECT IDENTIFIER &#039;CORTEX&#039;;\n \nnew RMAN configuration parameters:\nCONFIGURE DB_UNIQUE_NAME &#039;CORTEX&#039; CONNECT IDENTIFIER  &#039;CORTEX&#039;;\nnew RMAN configuration parameters are successfully stored\nstarting full resync of recovery catalog\nfull resync complete\n \nRMAN&gt; CONFIGURE DB_UNIQUE_NAME CORTEXDR CONNECT IDENTIFIER &#039;CORTEXDR&#039;;\n \nnew RMAN configuration parameters:\nCONFIGURE DB_UNIQUE_NAME &#039;CORTEXDR&#039; CONNECT IDENTIFIER  &#039;CORTEXDR&#039;;\nnew RMAN configuration parameters are successfully stored\nstarting full resync of recovery catalog\nfull resync complete\n \nRMAN&gt;\n<\/pre><\/div>\n\n\n<p>\u00c9 poss\u00edvel realizar o SYNC dos 2 bancos com o cat\u00e1logo ao mesmo tempo com o comando abaixo:<\/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@fornix1 ~]$ rman target sys\/oracle@CORTEX CATALOG CAT\/CAT@CORTEX\n \nRecovery Manager: Release 19.0.0.0.0 - Production on Tue Jun 29 04:41:18 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)\nconnected to recovery catalog database\n \nRMAN&gt; RESYNC CATALOG FROM DB_UNIQUE_NAME ALL ;\n \n \nstarting full resync of recovery catalog\nfull resync complete\n \nresyncing from database with DB_UNIQUE_NAME CORTEXDR\nstarting resync of recovery catalog\nresync complete\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>Neste artigo, vamos reproduzir a cria\u00e7\u00e3o de um Cat\u00e1logo de Backup RMAN em um ambiente Data Guard, contemplando tanto o Primary quanto o Standby Database (utilizando Data Broker). Al\u00e9m disso, veremos a quest\u00e3o do registro de ambos os ambientes no cat\u00e1logo, e a cria\u00e7\u00e3o da string de conex\u00e3o dentro do RMAN para cada banco de [&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,5],"tags":[],"class_list":["post-5622","post","type-post","status-publish","format-standard","hentry","category-backup-recovery","category-high-availability"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5622","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=5622"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5622\/revisions"}],"predecessor-version":[{"id":9091,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/5622\/revisions\/9091"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=5622"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=5622"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=5622"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}