{"id":1715,"date":"2020-05-05T23:39:20","date_gmt":"2020-05-05T23:39:20","guid":{"rendered":"https:\/\/swiv.com.br\/creating-an-oracle-recovery-catalog\/"},"modified":"2026-05-27T20:02:53","modified_gmt":"2026-05-27T19:02:53","slug":"creating-an-oracle-recovery-catalog","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2020\/05\/05\/creating-an-oracle-recovery-catalog\/","title":{"rendered":"Creating an Oracle Recovery Catalog"},"content":{"rendered":"\n<p>O tema deste artigo \u00e9 simples, por\u00e9m \u00e9 de relevante import\u00e2ncia na estrat\u00e9gia de Backup e Recovery de um ambiente Oracle Database. Para explorar a cria\u00e7\u00e3o do Recovery Catalog, utilizarei os ambientes abaixo:<\/p>\n\n\n<p>Banco do Cat\u00e1logo do RMAN (que foi constru\u00eddo neste artigo <a rel=\"\\&quot;noreferrer noopener\" noopener=\"\" href=\"https:\/\/swiv.com.br\/creating-an-oracle-database-18c-using-dbca-in-silent-mode\/\" target=\"\\&quot;_blank\\&quot;\">AQUI<\/a>).<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; select instance_name,status from v$instance;\n \nINSTANCE_NAME    STATUS\n---------------- ------------\nRMANDB           OPEN\n \nSQL&gt; select banner from v$version;\n \nBANNER\n--------------------------------------------------------------------------------\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\n \nSQL&gt; !cat \/etc\/*release*\nOracle Linux Server release 8.1\nSQL&gt; ! hostname\noel8.localdomain\n<\/pre><\/div>\n\n<p>Banco Target (que foi constru\u00eddo neste artigo <a rel=\"\\&quot;noreferrer noopener\" noopener=\"\" href=\"https:\/\/swiv.com.br\/oracle-database-19c-standalone-installation-on-oracle-linux-7\/\" target=\"\\&quot;_blank\\&quot;\">AQUI<\/a>).<\/p>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; select instance_name,status from v$instance;\n \nINSTANCE_NAME    STATUS\n---------------- ------------\ncortex           OPEN\n \nSQL&gt; select banner from v$version;\n \nBANNER\n--------------------------------------------------------------------------------\nOracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production\nSQL&gt; !cat \/etc\/*release*\nOracle Linux Server release 7.7\nSQL&gt; !hostname\noel7.localdomain\n<\/pre><\/div>\n\n\n<p>Antes de iniciar o processo, preciso garantir que essas duas VMs (constru\u00eddas no VirtualBox) possam se comunicar, al\u00e9m de conseguirem ter acesso ao banco de dados remotamente. <\/p>\n\n\n\n<p>Alterando o &#8220;\/etc\/hosts&#8221; da m\u00e1quina do cat\u00e1logo 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;root@oel8 ~]# vi \/etc\/hosts\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4\n#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6\n192.168.0.107 oel8.localdomain oel8\n192.168.0.108 oel7.localdomain oel7\n<\/pre><\/div>\n\n\n<p>Realizando testes de ping:<\/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;root@oel8 ~]# ping oel7\nPING oel7.localdomain (192.168.0.108) 56(84) bytes of data.\n64 bytes from oel7.localdomain (192.168.0.108): icmp_seq=1 ttl=64 time=0.588 ms\n64 bytes from oel7.localdomain (192.168.0.108): icmp_seq=2 ttl=64 time=1.01 ms\n<\/pre><\/div>\n\n\n<p>Realizando o mesmo processo na m\u00e1quina do banco CORTEX:<\/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;root@oel7 ~]# vi \/etc\/hosts\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4\n#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6\n192.168.0.108 oel7.localdomain oel7\n192.168.0.107 oel8.localdomain oel8\n<\/pre><\/div>\n\n\n<p>Teste de ping:<\/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;root@oel7 ~]# ping oel8\nPING oel8.localdomain (192.168.0.107) 56(84) bytes of data.\n64 bytes from oel8.localdomain (192.168.0.107): icmp_seq=1 ttl=64 time=0.964 ms\n64 bytes from oel8.localdomain (192.168.0.107): icmp_seq=2 ttl=64 time=0.569 ms\n<\/pre><\/div>\n\n\n<p>Incluindo a string do banco CORTEX na m\u00e1quina do cat\u00e1logo e realizando testes:<\/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]$ cd $ORACLE_HOME\/network\/admin\n&#x5B;oracle@oel8 admin]$ vi tnsnames.ora\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nRMANDB =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = oel8.localdomain)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = RMANDB)\n    )\n  )\n \nCORTEX =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = cortex.localdomain)\n    )\n  )\n<\/pre><\/div>\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]$ tnsping RMANDB\n \nTNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 02-MAY-2020 21:41:22\n \nCopyright (c) 1997, 2018, Oracle.  All rights reserved.\n \nUsed parameter files:\n \n \nUsed TNSNAMES adapter to resolve the alias\nAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oel8.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RMANDB)))\nOK (0 msec)\n&#x5B;oracle@oel8 admin]$ tnsping CORTEX\n \nTNS Ping Utility for Linux: Version 18.0.0.0.0 - Production on 02-MAY-2020 21:41:31\n \nCopyright (c) 1997, 2018, Oracle.  All rights reserved.\n \nUsed parameter files:\n \n \nUsed TNSNAMES adapter to resolve the alias\nAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oel7.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cortex.localdomain)))\nOK (0 msec)\n&#x5B;oracle@oel8 admin]$\n&#x5B;oracle@oel8 admin]$ sqlplus SYSTEM@CORTEX\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Sat May 2 21:42:19 2020\nVersion 18.3.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \nEnter password:\nLast Successful login time: Sat May 02 2020 18:15:05 -03:00\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 instance_name,status from v$instance;\n \nINSTANCE_NAME    STATUS\n---------------- ------------\ncortex           OPEN\n \nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Realizando configura\u00e7\u00e3o e testes na outra m\u00e1quina:<\/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 admin]$ cd $ORACLE_HOME\/network\/admin\n&#x5B;oracle@oel7 admin]$ vi tnsnames.ora\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCORTEX =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.108.localdomain)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = cortex.localdomain)\n    )\n  )\n \nLISTENER_LISTENER =\n  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.108.localdomain)(PORT = 1521))\n \n \nRMANDB =\n  (DESCRIPTION =\n    (ADDRESS = (PROTOCOL = TCP)(HOST = oel8.localdomain)(PORT = 1521))\n    (CONNECT_DATA =\n      (SERVER = DEDICATED)\n      (SERVICE_NAME = RMANDB)\n    )\n  )\n<\/pre><\/div>\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 admin]$ tnsping CORTEX\n \nTNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 02-MAY-2020 21:44:01\n \nCopyright (c) 1997, 2019, Oracle.  All rights reserved.\n \nUsed parameter files:\n\/oracle\/19.3.0\/product\/network\/admin\/sqlnet.ora\n \n \nUsed TNSNAMES adapter to resolve the alias\nAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.108.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = cortex.localdomain)))\nOK (60 msec)\n&#x5B;oracle@oel7 admin]$ tnsping RMANDB\n \nTNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 02-MAY-2020 21:44:08\n \nCopyright (c) 1997, 2019, Oracle.  All rights reserved.\n \nUsed parameter files:\n\/oracle\/19.3.0\/product\/network\/admin\/sqlnet.ora\n \n \nUsed TNSNAMES adapter to resolve the alias\nAttempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oel8.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = RMANDB)))\nOK (0 msec)\n&#x5B;oracle@oel7 admin]$ sqlplus SYSTEM@RMANDB\n \nSQL*Plus: Release 19.0.0.0.0 - Production on Sat May 2 21:44:17 2020\nVersion 19.3.0.0.0\n \nCopyright (c) 1982, 2019, Oracle.  All rights reserved.\n \nEnter password:\n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.3.0.0.0\n \nSQL&gt; select instance_name,status from v$instance;\n \nINSTANCE_NAME    STATUS\n---------------- ------------\nRMANDB           OPEN\n \nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Antes de iniciar o processo, creio que seja importante, mesmo que de forma breve, falar do prop\u00f3sito e vantagens de se usar o Recovery Catalog. Ele \u00e9 um esquema de banco de dados que armazena metadados de um ou mais bancos Oracle. Tem como benef\u00edcios ser uma redund\u00e2ncia, j\u00e1 que estes metadados tamb\u00e9m s\u00e3o gravados nos arquivos de control file do banco. Ou seja, caso os perca, voc\u00ea tem onde recorrer. Al\u00e9m disso, caso voc\u00ea tenha um ambiente que centraliza essas cat\u00e1logos, fica mais f\u00e1cil extrair informa\u00e7\u00f5es e executar certas tarefas (que voc\u00ea precisaria conectar em v\u00e1rios bancos para coletar). Al\u00e9m disso, o cat\u00e1logo tem capacidade de armazenamento muito maior que o control file, sendo interessante para manter seus artefatos catalogados por um bom tempo. E por \u00faltimo, para ambientes que usam o Oracle Data Guard, o cat\u00e1logo \u00e9 um dos requisitos. O recurso de \\&#8221;Stored Scripts\\&#8221; tamb\u00e9m \u00e9 bem legal, permitindo a persist\u00eancia dos blocos de scripts rman dentro do pr\u00f3prio cat\u00e1logo.<\/p>\n\n\n\n<p>Criando tablespace no banco que abrigar\u00e1 o 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@oel8 datafile]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Sat May 2 22:04:58 2020\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; CREATE TABLESPACE TS_CORTEX_CATALOG DATAFILE &#039;\/oracle\/dados\/RMANDB\/datafile\/ts_cortex_catalog.dbf&#039; SIZE 200M AUTOEXTEND ON NEXT 200M MAXSIZE UNLIMITED;\n \nTablespace created.\n<\/pre><\/div>\n\n\n<p>Criando usu\u00e1rio com o privil\u00e9gio necess\u00e1rio:<\/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; CREATE USER CORTEX_CATALOG IDENTIFIED BY CORTEX_CATALOG DEFAULT TABLESPACE TS_CORTEX_CAALOG;\n \nUser created.\n \nSQL&gt; ALTER USER CORTEX_CATALOG QUOTA UNLIMITED ON TS_CORTEX_CATALOG;\n \nUser altered.\n \nSQL&gt; GRANT RECOVERY_CATALOG_OWNER TO CORTEX_CATALOG;\n \nGrant succeeded.\n<\/pre><\/div>\n\n\n<p>No banco target, realizar a seguinte chamada utilizando o 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@oel7 19.3.0]$ rman target \/ catalog CORTEX_CATALOG\/CORTEX_CATALOG@RMANDB\n \nRecovery Manager: Release 19.0.0.0.0 - Production on Sat May 2 22:10:08 2020\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;\n<\/pre><\/div>\n\n\n<p>Criando o 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; create catalog;\n \nrecovery catalog created\n<\/pre><\/div>\n\n\n<p>Registrando o banco:<\/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; register database;\n \ndatabase registered in recovery catalog\nstarting full resync of recovery catalog\nfull resync complete\n<\/pre><\/div>\n\n\n<p>Realizando uma consulta atrav\u00e9s do report schema:<\/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; report schema;\n \nReport of database schema for database with db_unique_name CORTEX\n \nList of Permanent Datafiles\n===========================\nFile Size(MB) Tablespace           RB segs Datafile Name\n---- -------- -------------------- ------- ------------------------\n1    910      SYSTEM               YES     +DG_DATA\/CORTEX\/DATAFILE\/system.256.1039033445\n3    570      SYSAUX               NO      +DG_DATA\/CORTEX\/DATAFILE\/sysaux.257.1039033519\n4    340      UNDOTBS1             YES     +DG_DATA\/CORTEX\/DATAFILE\/undotbs1.258.1039033555\n7    5        USERS                NO      +DG_DATA\/CORTEX\/DATAFILE\/users.259.1039033555\n \nList of Temporary Files\n=======================\nFile Size(MB) Tablespace           Maxsize(MB) Tempfile Name\n---- -------- -------------------- ----------- --------------------\n1    32       TEMP                 32767       +DG_DATA\/CORTEX\/TEMPFILE\/temp.264.1039033669\n \nRMAN&gt;\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>O tema deste artigo \u00e9 simples, por\u00e9m \u00e9 de relevante import\u00e2ncia na estrat\u00e9gia de Backup e Recovery de um ambiente Oracle Database. Para explorar a cria\u00e7\u00e3o do Recovery Catalog, utilizarei os ambientes abaixo: Banco do Cat\u00e1logo do RMAN (que foi constru\u00eddo neste artigo AQUI). Banco Target (que foi constru\u00eddo neste artigo AQUI). Antes de iniciar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,3],"tags":[13],"class_list":["post-1715","post","type-post","status-publish","format-standard","hentry","category-administration","category-backup-recovery","tag-backup-recovery"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/1715","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=1715"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/1715\/revisions"}],"predecessor-version":[{"id":9291,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/1715\/revisions\/9291"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=1715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=1715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=1715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}