{"id":6195,"date":"2021-08-17T00:28:22","date_gmt":"2021-08-17T00:28:22","guid":{"rendered":"https:\/\/swiv.com.br\/restoring-the-spfile-from-the-alert-log-file\/"},"modified":"2026-05-27T20:02:30","modified_gmt":"2026-05-27T19:02:30","slug":"restoring-the-spfile-from-the-alert-log-file","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/08\/17\/restoring-the-spfile-from-the-alert-log-file\/","title":{"rendered":"Restoring the SPFILE from the alert.log file"},"content":{"rendered":"<p>Quando perdemos o SPFILE de um ambiente Oracle, temos 3 alternativas de recupera\u00e7\u00e3o: from <a rel=\"\\&quot;noreferrer noopener\" noopener=\"\" href=\"https:\/\/swiv.com.br\/restoring-the-spfile-from-memory\/\" target=\"\\&quot;_blank\\&quot;\">Memory<\/a> , <a rel=\"\\&quot;noreferrer noopener\" noopener=\"\" href=\"https:\/\/swiv.com.br\/restoring-the-spfile-from-autobackup\/\" target=\"\\&quot;_blank\\&quot;\">Autobackup<\/a> ou como \u00faltima op\u00e7\u00e3o, utilizar o alert.log para criar um PFILE, e dele, um SPFILE. Esse artigo explorar\u00e1 este \u00faltimo cen\u00e1rio.<\/p>\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 RMANDB]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Mon Aug 16 21:11:15 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 SPFILE;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\nspfile                               string      \/oracle\/18.0.0\/product\/dbs\/spf\n                                                 ileRMANDB.ora\n<\/pre><\/div>\n\n\n<p>Toda vez que subimos a inst\u00e2ncia do Oracle, \u00e9 escrito em seu arquivo Alert os par\u00e2metros e valores usados nesse startup. Vamos coletar em nosso banco de teste essas informa\u00e7\u00f5es:<\/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 trace]$ pwd\n\/oracle\/18.0.0\/base\/diag\/rdbms\/rmandb\/RMANDB\/trace\n&#x5B;oracle@oel8 trace]$ vi alert_RMANDB.log\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/swiv.com.br\/wp-content\/uploads\/2022\/07\/image-1-1-1024x714.png\" alt=\"\" class=\"wp-image-7449\"\/><\/figure>\n\n\n\n<p>Para simular a perda do SPFILE, vou renomear o arquivo vigente:<\/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; ! mv \/oracle\/18.0.0\/product\/dbs\/spfileRMANDB.ora \/oracle\/18.0.0\/product\/dbs\/spfileRMANDB.BSS\n \nSQL&gt; ! ls -lthr \/oracle\/18.0.0\/product\/dbs\/spfileRMANDB.BSS\n-rw-r-----. 1 oracle oinstall 9.5K Aug 16 20:48 \/oracle\/18.0.0\/product\/dbs\/spfileRMANDB.BSS\n<\/pre><\/div>\n\n\n<p>Baixando a inst\u00e2ncia e visualizando a mensagem de erro ao tentar inici\u00e1-la:<\/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;\nORA-01078: failure in processing system parameters\nLRM-00109: could not open parameter file &#039;\/oracle\/18.0.0\/product\/dbs\/initRMANDB.ora&#039;\n<\/pre><\/div>\n\n\n<p>Nesta etapa, podemos criar um PFILE com o nome &#8220;$ORACLE_HOME\/dbs\/init&lt;SID&gt;&#8221;, utilizando o conte\u00fado dos par\u00e2metros retirados do arquivo Alert.log. No meu caso, o PFILE ficou da seguinte maneira:<\/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 dbs]$ cd $ORACLE_HOME\/dbs\n&#x5B;oracle@oel8 dbs]$ vi initRMANDB.ora\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/swiv.com.br\/wp-content\/uploads\/2022\/07\/image-2-2-1024x543.png\" alt=\"\" class=\"wp-image-7450\"\/><\/figure>\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 dbs]$ ls -lthr initRMANDB.ora\n-rw-r--r--. 1 oracle oinstall 3.9K Aug 16 21:23 initRMANDB.ora\n<\/pre><\/div>\n\n\n<p>Iniciando inst\u00e2ncia com o PFILE:<\/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 dbs]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Mon Aug 16 21:24:29 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \nConnected to an idle instance.\n \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; SHO PARAMETER SPFILE;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\nspfile                               string\n<\/pre><\/div>\n\n\n<p>Criando SPFILE a partir do PFILE:<\/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 SPFILE FROM PFILE;\n \nFile created.\n<\/pre><\/div>\n\n\n<p>Baixando e subindo a inst\u00e2ncia, agora com o novo SPFILE:<\/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;\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; SHO PARAMETER SPFILE;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\nspfile                               string      \/oracle\/18.0.0\/product\/dbs\/spf\n                                                 ileRMANDB.ora\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>Quando perdemos o SPFILE de um ambiente Oracle, temos 3 alternativas de recupera\u00e7\u00e3o: from Memory , Autobackup ou como \u00faltima op\u00e7\u00e3o, utilizar o alert.log para criar um PFILE, e dele, um SPFILE. Esse artigo explorar\u00e1 este \u00faltimo cen\u00e1rio. Reconhecendo o nosso laborat\u00f3rio: Toda vez que subimos a inst\u00e2ncia do Oracle, \u00e9 escrito em seu arquivo [&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-6195","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\/6195","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=6195"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/6195\/revisions"}],"predecessor-version":[{"id":9060,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/6195\/revisions\/9060"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=6195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=6195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=6195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}