{"id":6212,"date":"2021-08-17T23:25:49","date_gmt":"2021-08-17T23:25:49","guid":{"rendered":"https:\/\/swiv.com.br\/restoring-the-control-file-to-a-default-location-subset-is-lost\/"},"modified":"2026-05-27T20:02:30","modified_gmt":"2026-05-27T19:02:30","slug":"restoring-the-control-file-to-a-default-location-subset-is-lost","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/08\/17\/restoring-the-control-file-to-a-default-location-subset-is-lost\/","title":{"rendered":"Restoring the Control File to a Default location: Subset is Lost"},"content":{"rendered":"\n<p>Este artigo simular\u00e1 a recupera\u00e7\u00e3o de control file em um banco de dados com os arquivos multiplexados, al\u00e9m de preservar o seu local de origem. Em suma, ao menos 1 control file deve estar dispon\u00edvel e intacto para que possamos fazer o procedimento.<\/p>\n\n\n\n<p>Reconhecendo o nosso laborat\u00f3rio:<\/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 Tue Aug 17 19:57:30 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,OPEN_MODE,LOG_MODE FROM V$DATABASE;\n \nNAME      OPEN_MODE            LOG_MODE\n--------- -------------------- ------------\nRMANDB    READ WRITE           ARCHIVELOG\n \nSQL&gt; SHO PARAMETER CONTROL_FILES;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\ncontrol_files                        string      \/oracle\/dados\/RMANDB\/controlfi\n                                                 le\/o1_mf_h8nytrhd_.ctl, \/oracl\n                                                 e\/fra\/RMANDB\/controlfile\/o1_mf\n                                                 _h8nytrty_.ctl\n<\/pre><\/div>\n\n\n<p>Para simular a perda, faremos a remo\u00e7\u00e3o do arquivo conforme abaixo, preservando ainda 1 control file:<\/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; !rm \/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl\n \nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Depois de pouco tempo, o Alert.log j\u00e1 reporta o problema:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n2021-08-17T20:02:53.169969-03:00\nErrors in file \/oracle\/18.0.0\/base\/diag\/rdbms\/rmandb\/RMANDB\/trace\/RMANDB_mz00_3395.trc:\nORA-00202: control file: &#039;\/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl&#039;\nORA-27041: unable to open file\nLinux-x86_64 Error: 2: No such file or directory\nAdditional information: 3\n<\/pre><\/div>\n\n\n<p>Em certas ocasi\u00f5es, a inst\u00e2ncia pode abortar ou pode continuar funcionando. Em meu caso, ao tentar rodar alguns comandos, o erro j\u00e1 \u00e9 reportado:<\/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 FROM V$DATABASE;\nSELECT NAME FROM V$DATABASE\n                 *\nERROR at line 1:\nORA-00210: cannot open the specified control file\nORA-00202: control file: &#039;\/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl&#039;\nORA-27041: unable to open file\nLinux-x86_64 Error: 2: No such file or directory\nAdditional information: 3\n<\/pre><\/div>\n\n\n<p>Para iniciar o processo de recupera\u00e7\u00e3o, abortamos a inst\u00e2ncia, pois n\u00e3o \u00e9 poss\u00edvel realizar um shutdown limpo se um control file est\u00e1 indispon\u00edvel:<\/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 ABORT;\nORACLE instance shut down.\nSQL&gt;\n<\/pre><\/div>\n\n\n<p>Agora basta copiarmos um control file intacto para o arquivo perdido:<\/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; !cp \/oracle\/fra\/RMANDB\/controlfile\/o1_mf_h8nytrty_.ctl \/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl\n \nSQL&gt; !ls -lthr \/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl\n-rw-r-----. 1 oracle oinstall 12M Aug 17 20:23 \/oracle\/dados\/RMANDB\/controlfile\/o1_mf_h8nytrhd_.ctl\n<\/pre><\/div>\n\n\n<p>Agora \u00e9 s\u00f3 subir o banco de dados:<\/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; STARTUP;\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.\nDatabase opened.\nSQL&gt; SELECT NAME FROM V$DATABASE;\n \nNAME\n---------\nRMANDB\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>Este artigo simular\u00e1 a recupera\u00e7\u00e3o de control file em um banco de dados com os arquivos multiplexados, al\u00e9m de preservar o seu local de origem. Em suma, ao menos 1 control file deve estar dispon\u00edvel e intacto para que possamos fazer o procedimento. Reconhecendo o nosso laborat\u00f3rio: Para simular a perda, faremos a remo\u00e7\u00e3o do [&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-6212","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\/6212","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=6212"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/6212\/revisions"}],"predecessor-version":[{"id":9059,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/6212\/revisions\/9059"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=6212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=6212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=6212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}