{"id":162,"date":"2014-09-07T12:32:55","date_gmt":"2014-09-07T15:32:55","guid":{"rendered":"http:\/\/www.fernandosimon.com\/blog\/?p=162"},"modified":"2015-01-25T23:20:17","modified_gmt":"2015-01-26T02:20:17","slug":"oracle-e-maa-artigo-vi-failover-broker","status":"publish","type":"post","link":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/","title":{"rendered":"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker"},"content":{"rendered":"<p style=\"text-align: justify;\">Neste artigo vamos ver como fazer um failover e reinstate em um ambiente que temos o Broker configurado. Se voc\u00ea est\u00e1 acompanhando a s\u00e9rie de artigos at\u00e9 ver\u00e1 que j\u00e1 passamos por failover manual, resintate, switchover (todos manuais e sem Broker) e no \u00faltimo n\u00f3s configuramos o Broker.<\/p>\n<p style=\"text-align: justify;\">De qualquer forma, ainda n\u00e3o chegamos a um ambiente ideal de Oracle MAA (Maximum Availability Architecture) com DataGuard e Oracle RAC. At\u00e9 o momento n\u00e3o foi configurado o Fast-Start Failover e em caso de falha, mesmo com o Broker, ainda precisamos de interven\u00e7\u00e3o manual em caso de falha no ambiente.<\/p>\n<p style=\"text-align: justify;\"><strong>SEXTO ARTIGO<\/strong><\/p>\n<p style=\"text-align: justify;\">Neste artigo vamos ver como proceder em caso de falha do ambiente quando estamos com o Broker, vamos ver como realizar o failover e reinstate atrav\u00e9s do Broker. Como disse acima, ainda n\u00e3o estamos com o ambiente de MAA finalizado, mas isso n\u00e3o impede que ocorra uma falha e voc\u00ea tenha que interferir.<\/p>\n<p style=\"text-align: justify;\">Acredito que j\u00e1 tenha ficado claro atrav\u00e9s da s\u00e9ria sobre MAA que muitos passos n\u00e3o s\u00e3o aplicados em um ambiente real na mesma sequ\u00eancia que a apresentada na s\u00e9rie, voc\u00ea n\u00e3o vai fazer um failover s\u00f3 para testar o Broker \u2013 voc\u00ea j\u00e1 configura tudo sem precisar \u201crestaurar\u201d o ambiente. Atrav\u00e9s dos artigos cobrimos os diversos pontos que envolvem um ambiente MAA, voc\u00ea tem que estar preparado para agir mesmo quer o seu ambiente n\u00e3o esteja completamente configurado. Voc\u00ea vai dizer para o seu gerente que n\u00e3o pode realizar um failover porque n\u00e3o tem o Broker configurado?<\/p>\n<p style=\"text-align: justify;\"><!--more Continue lendo...--><\/p>\n<p style=\"text-align: justify;\"><strong>AMBIENTE<\/strong><\/p>\n<p style=\"text-align: justify;\">Neste artigo temos um ambiente com dois Oracle RAC sincronizados atrav\u00e9s de DataGuard. O banco primary \u00e9 o <strong>\u201cmaa\u201d<\/strong> e o standby \u00e9 o <strong>\u201cmaastb\u201d<\/strong>, ambos sincronizados com DG operando em MAXIMUM AVAILABILITY e com real-time apply. Por fim, temos o Broker configurado e \u201ccuidando\u201d do ambiente.<\/p>\n<p style=\"text-align: justify;\">Antes de continuar voltamos brevemente ao ponto destacado no artigo do failover manual: sincronia e import\u00e2ncia do ambiente. Sobre a sincronia destaco que em um ambiente DG ela deve ser um dos pontos chaves, voc\u00ea opera em MAA e n\u00e3o deixa seu ambiente sincronizado? Quanto a import\u00e2ncia, se voc\u00ea est\u00e1 operando em MAA com Oracle RAC em ambos os lados o seu ambiente prim\u00e1rio e standby \u00e9 importante tamb\u00e9m n\u00e3o \u00e9?<\/p>\n<p style=\"text-align: justify;\">Ent\u00e3o, voc\u00ea tem um banco de dados que armazena dados importantes e n\u00e3o mant\u00eam seu standby sincronizado com o primary? Voc\u00ea j\u00e1 avisou seu gerente que voc\u00eas v\u00e3o perder dados?<\/p>\n<p style=\"text-align: justify;\">N\u00e3o que todo o ambiente MAA com DG nunca deve perder dados. Talvez por raz\u00f5es de projeto exista um acordo quanto o que possa ser perdido de informa\u00e7\u00e3o, algumas informa\u00e7\u00f5es podem ser recuperadas por outros m\u00e9todos. De qualquer forma, conhe\u00e7a bem o seu ambiente, saiba todos os seus detalhes.<\/p>\n<p style=\"text-align: justify;\"><strong>CONTROLE<\/strong><\/p>\n<p style=\"text-align: justify;\">Em artigos anteriores j\u00e1 foi usado o mesmo artif\u00edcio para exemplificar a sincronia do DG, voltamos com ele aqui. Utilizando a mesma tabela que foi criada antes, limpamos seus dados e em cada inst\u00e2ncia do primary ser\u00e3o inseridos dados. Com esta tabela mostramos que no ambiente atual, mesmo sem gerar archivelog, as transa\u00e7\u00f5es est\u00e3o protegidas.<\/p>\n<pre>Na inst\u00e2ncia primary maa1:\r\n\tSQL&gt; SELECT database_role FROM v$database;\r\n\r\n\tDATABASE_ROLE\r\n\t----------------\r\n\tPRIMARY\r\n\r\n\tSQL&gt; SELECT instance_name FROM v$instance;\r\n\r\n\tINSTANCE_NAME\r\n\t----------------\r\n\tmaa1\r\n\r\n\tSQL&gt; DELETE FROM testedg;\r\n\r\n\t1 row deleted.\r\n\r\n\tSQL&gt; INSERT INTO testedg(c1, c2) VALUES(1, sysdate);\r\n\r\n\t1 row created.\r\n\r\n\tSQL&gt; COMMIT;\r\n\r\n\tCommit complete.\r\n\r\n\tSQL&gt;\r\n\r\nNa inst\u00e2ncia primary maa2:\r\n\tSQL&gt; SELECT instance_name FROM v$instance;\r\n\r\n\tINSTANCE_NAME\r\n\t----------------\r\n\tmaa2\r\n\r\n\tSQL&gt; INSERT INTO testedg(c1, c2) VALUES(2, sysdate);\r\n\r\n\t1 row created.\r\n\r\n\tSQL&gt; COMMIT;\r\n\r\n\tCommit complete.\r\n\r\n\tSQL&gt; SELECT c1, TO_CHAR(c2, 'DD\/MM\/RRRR HH24:MI:SS') AS momento FROM testedg;\r\n\r\n\t\t\tC1 MOMENTO\r\n\t---------- -------------------\r\n\t\t\t 1 11\/05\/2014 12:01:07\r\n\t\t\t 2 11\/05\/2014 12:02:17\r\n\r\n\tSQL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\"><strong>FAILOVER<\/strong><\/p>\n<p style=\"text-align: justify;\"><strong>Criando a falha<\/strong><\/p>\n<p style=\"text-align: justify;\">Aqui a falha ser\u00e1 um pouco mais catastr\u00f3fica que a do \u00faltimo failover, os servidores do Oracle RAC primary foram fisicamente desligados. Suponha que algo parecido aconte\u00e7a no seu ambiente, que a sua controladora do Storage dos discos respons\u00e1veis pelo sue banco deu erro e voc\u00ea n\u00e3o estava com o seu Raid na vertical? Imagine que seu Exadata perdeu mais que duas c\u00e9lulas de Storage no turno da noite.<\/p>\n<p style=\"text-align: justify;\">Ent\u00e3o, voc\u00ea chega de manh\u00e3 (isso se j\u00e1 n\u00e3o te ligaram a noite) e j\u00e1 tem uma comiss\u00e3o te \u201crecepcionando\u201d com cara assustada e pronta para entregar a bomba e dizer: Boa Sorte! Bom, vamos ver que o cen\u00e1rio n\u00e3o \u00e9 t\u00e3o negro assim d\u00e1 pra sair dessa bem tranquilo.<\/p>\n<p style=\"text-align: justify;\"><strong>FAILOVER TO<\/strong><\/p>\n<p style=\"text-align: justify;\">J\u00e1 falei acima que a primeira preocupa\u00e7\u00e3o \u00e9 a s\u00edncrona, mas como voc\u00ea j\u00e1 tem todo o ambiente configurado de maneira correta sabe que a sincronia n\u00e3o ser\u00e1 problema. Se voc\u00ea quiser conferir conecte-se no standby e verifique como ela est\u00e1:<\/p>\n<pre>SQL&gt; SELECT database_role FROM v$database;\r\n\r\nDATABASE_ROLE\r\n----------------\r\nPHYSICAL STANDBY\r\n\r\nSQL&gt; SELECT protection_mode, protection_level FROM v$database;\r\n\r\nPROTECTION_MODE      PROTECTION_LEVEL\r\n-------------------- --------------------\r\nMAXIMUM AVAILABILITY MAXIMUM AVAILABILITY\r\n\r\nSQL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\">Como estamos com o Broker configurado, vamos usar ele. Aqui um detalhe, se voc\u00ea tentar se conectar no primary ir\u00e1 receber um erro, voc\u00ea tem que recorrer a conex\u00e3o do standby no Broker:<\/p>\n<pre>[oracle@rac11stb01 ~]$ dgmgrl\r\nDGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production\r\n\r\nCopyright (c) 2000, 2009, Oracle. All rights reserved.\r\n\r\nWelcome to DGMGRL, type \"help\" for information.\r\nDGMGRL&gt; CONNECT sys@maa\r\nPassword:\r\nUnable to connect to database\r\nORA-12543: TNS:destination host unreachable\r\n\r\nFailed.\r\nDGMGRL&gt; CONNECT sys@maastb\r\nPassword:\r\nConnected.\r\nDGMGRL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\">Como vimos acima o Broker n\u00e3o consegue conectar no ambiente primary. Sabemos que ele est\u00e1 fora e precisamos do failover. Claro que antes de voc\u00ea fazer o failover voc\u00ea conversou com a equipe de infra\/sistema e verificou a indisponibilidade de retorno r\u00e1pido do ambiente. Assim, a \u00fanica op\u00e7\u00e3o \u00e9 o failover.<\/p>\n<p style=\"text-align: justify;\">Depois de conectado no Broker voc\u00ea pode verificar como est\u00e1 o seu ambiente:<\/p>\n<pre>DGMGRL&gt; <strong>SHOW CONFIGURATION VERBOSE;<\/strong>\r\n\r\nConfiguration - dgrac\r\n\r\n  Protection Mode: MaxAvailability\r\n  Databases:\r\n\tmaa    - Primary database\r\n\tmaastb - Physical standby database\r\n\r\n  Properties:\r\n\tFastStartFailoverThreshold      = '30'\r\n\tOperationTimeout                = '30'\r\n\tFastStartFailoverLagLimit       = '30'\r\n\tCommunicationTimeout            = '180'\r\n\tFastStartFailoverAutoReinstate  = 'TRUE'\r\n\tFastStartFailoverPmyShutdown    = 'TRUE'\r\n\tBystandersFollowRoleChange      = 'ALL'\r\n\r\nFast-Start Failover: DISABLED\r\n\r\nConfiguration Status:\r\nORA-12543: TNS:destination host unreachable\r\n<strong>ORA-16625: cannot reach database \"maa\"<\/strong>\r\nDGM-17017: unable to determine configuration status\r\n\r\nDGMGRL&gt; <strong>SHOW DATABASE maa<\/strong>\r\n\r\nDatabase - maa\r\n\r\n  Role:            PRIMARY\r\n  Intended State:  TRANSPORT-ON\r\n  Instance(s):\r\n\tmaa1\r\n\tmaa2\r\n\r\nDatabase Status:\r\n<strong>DGM-17016: failed to retrieve status for database \"maa\"<\/strong>\r\n<strong>ORA-12543: TNS:destination host unreachable<\/strong>\r\nORA-16625: cannot reach database \"maa\"\r\n\r\nDGMGRL&gt; <strong>SHOW DATABASE maastb;<\/strong>\r\n\r\nDatabase - maastb\r\n\r\n  Role:            PHYSICAL STANDBY\r\n  Intended State:  APPLY-ON\r\n  Transport Lag:   0 seconds\r\n  Apply Lag:       0 seconds\r\n  Real Time Query: OFF\r\n  Instance(s):\r\n\tmaastb1 (apply instance)\r\n\tmaastb2\r\n\r\nDatabase Status:\r\nSUCCESS\r\n\r\nDGMGRL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\">Como voc\u00ea viu acima, o banco primary (maa) est\u00e1 fora e o Broker est\u00e1 esperando voc\u00ea se decidir. Para realizar o failover atrav\u00e9s do Broker basta digitar o comando \u201c<strong>FAILOVER TO &lt;nome do standby&gt;<\/strong>\u201d como mostrarei abaixo. Para realizar o failover execute:<\/p>\n<pre>DGMGRL&gt; <strong>FAILOVER TO maastb;<\/strong>\r\nPerforming failover NOW, please wait...\r\n<strong>Operation requires a connection to instance \"maastb1\" on database \"maastb\"<\/strong>\r\nConnecting to instance \"maastb1\"...\r\nConnected.\r\nFailover succeeded, new primary is \"maastb\"\r\nDGMGRL&gt;\r\n\r\n<strong>No log do broker da inst\u00e2ncia maastb1:<\/strong>\r\n\t05\/11\/2014 12:52:28\r\n\tFAILOVER TO maastb\r\n\tBeginning failover to database maastb\r\n\t<strong>Notifying Oracle Clusterware to teardown database for FAILOVER<\/strong>\r\n\t05\/11\/2014 12:53:18\r\n\t<strong>Protection mode set to MAXIMUM AVAILABILITY<\/strong>\r\n\t05\/11\/2014 12:53:29\r\n\t<strong>Deferring associated archivelog destinations of sites permanently disabled due to Failover<\/strong>\r\n\t<strong>Notifying Oracle Clusterware to buildup primary database after FAILOVER<\/strong>\r\n\tData Guard notifying Oracle Clusterware to start services and other instances change\r\n\t05\/11\/2014 12:53:33\r\n\tPosting DB_DOWN alert ...\r\n\t\t\t... with reason Data Guard Failover\r\n\t05\/11\/2014 12:53:37\r\n\tCommand FAILOVER TO maastb completed\r\n\r\n<strong>No log do broker da inst\u00e2ncia maastb2:<\/strong>\r\n\t05\/11\/2014 18:52:26\r\n\tFAILOVER TO maastb\r\n\tCommand FAILOVER TO maastb completed with warning ORA-16523\r\n\t05\/11\/2014 18:53:18\r\n\tProtection mode set to MAXIMUM AVAILABILITY\r\n\t05\/11\/2014 18:53:33\r\n\tCommand FAILOVER TO maastb completed\r\n<\/pre>\n<p style=\"text-align: justify;\">Observe atentamente as sa\u00eddas mostradas acima. Na primeira temos a execu\u00e7\u00e3o do comando e observe que o Broker para proceder com o comando conectou especificamente em uma \u00fanica inst\u00e2ncia. Nos logs do Broker temos a informa\u00e7\u00e3o de que a inst\u00e2ncia foi reiniciada devido a failover (teardown) e que os destinos de archives foram \u201cdesabilitados\u201d.<\/p>\n<p style=\"text-align: justify;\">Vamos ver o que aconteceu no alertlog da inst\u00e2ncia \u201cmaastb1\u201d (fa\u00e7a uma rela\u00e7\u00e3o com os hor\u00e1rios dos logs anteriores). Adianto as desculpas, mas o log abaixo \u00e9 extenso exatamente para ilustrar tudo o que ocorreu:<\/p>\n<pre><strong>No alertlog da standby maastb (nova primary):<\/strong>\r\n\tSun May 11 12:52:28 2014\r\n\tData Guard Broker: Beginning failover\r\n\tSun May 11 12:52:29 2014\r\n\t<strong>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL<\/strong>\r\n\tSun May 11 12:52:29 2014\r\n\tMRP0: Background Media Recovery cancelled with status 16037\r\n\tErrors in file \/u01\/app\/oracle\/diag\/rdbms\/maastb\/maastb1\/trace\/maastb1_pr00_10962.trc:\r\n\tORA-16037: user requested cancel of managed recovery operation\r\n\tSun May 11 12:52:29 2014\r\n\tManaged Standby Recovery not using Real Time Apply\r\n\t<strong>Recovery interrupted!<\/strong>\r\n\tRecovered data files to a consistent state at change 8878906\r\n\tSun May 11 12:52:33 2014\r\n\tMRP0: Background Media Recovery process shutdown (maastb1)\r\n\tManaged Standby Recovery Canceled (maastb1)\r\n\tCompleted: <strong>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL<\/strong>\r\n\tALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE\r\n\tAttempt to do a Terminal Recovery (maastb1)\r\n\tMedia Recovery Start: Managed Standby Recovery (maastb1)\r\n\t started logmerger process\r\n\tManaged Standby Recovery not using Real Time Apply\r\n\tParallel Media Recovery started with 2 slaves\r\n\tSun May 11 12:52:36 2014\r\n\t<strong>Media Recovery Waiting for thread 2 sequence 99 (in transit)<\/strong>\r\n\tSun May 11 12:52:37 2014\r\n\tkrsv_proc_kill: Killing 6 processes (all RFS, wait for I\/O)\r\n\tBegin: Standby Redo Logfile archival\r\n\tEnd: Standby Redo Logfile archival\r\n\tTerminal Recovery timestamp is '05\/11\/2014 12:52:40'\r\n\tTerminal Recovery: applying standby redo logs.\r\n\tTerminal Recovery: thread 2 seq# 99 redo required\r\n\tTerminal Recovery:\r\n\tRecovery of Online Redo Log: Thread 2 Group 9 Seq 99 Reading mem 0\r\n\t  Mem# 0: +DG01\/maastb\/onlinelog\/group_9.260.844716095\r\n\t  Mem# 1: +FRA\/maastb\/onlinelog\/group_9.591.844716097\r\n\tIdentified End-Of-Redo (failover) for thread 2 sequence 99 at SCN 0xffff.ffffffff\r\n\tTerminal Recovery: thread 1 seq# 140 redo required\r\n\tTerminal Recovery:\r\n\tRecovery of Online Redo Log: Thread 1 Group 6 Seq 140 Reading mem 0\r\n\t  Mem# 0: +DG01\/maastb\/onlinelog\/group_6.267.844716079\r\n\t  Mem# 1: +FRA\/maastb\/onlinelog\/group_6.604.844716081\r\n\t<strong>Identified End-Of-Redo (failover) for thread 1 sequence 140 at SCN 0xffff.ffffffff<\/strong>\r\n\t<strong>Incomplete Recovery applied until change 8878917 time 05\/11\/2014 18:08:24<\/strong>\r\n\tSun May 11 12:52:41 2014\r\n\tMedia Recovery Complete (maastb1)\r\n\tTerminal Recovery: successful completion\r\n\tSun May 11 12:52:41 2014\r\n\tARC0: Archiving not possible: error count exceeded\r\n\tSun May 11 12:52:41 2014\r\n\tARC3: Archiving not possible: error count exceeded\r\n\tForcing ARSCN to IRSCN for TR 0:8878917\r\n\tAttempt to set limbo arscn 0:8878917 irscn 0:8878917\r\n\tResetting standby activation ID 723321957 (0x2b1d0465)\r\n\tARCH: Archival stopped, error occurred. Will continue retrying\r\n\t<strong>ORACLE Instance maastb1 - Archival Error<\/strong>\r\n\t<strong>ORA-16014: log 6 sequence# 140 not archived, no available destinations<\/strong>\r\n\tORA-00312: online log 6 thread 1: '+DG01\/maastb\/onlinelog\/group_6.267.844716079'\r\n\tORA-00312: online log 6 thread 1: '+FRA\/maastb\/onlinelog\/group_6.604.844716081'\r\n\tCompleted: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE\r\n\tALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN\r\n\tALTER DATABASE SWITCHOVER TO PRIMARY (maastb1)\r\n\tMaximum wait for role transition is 15 minutes.\r\n\tBackup controlfile written to trace file \/u01\/app\/oracle\/diag\/rdbms\/maastb\/maastb1\/trace\/maastb1_rsm0_18329.trc\r\n\t<strong>Standby terminal recovery start SCN: 8878906<\/strong>\r\n\t<strong>RESETLOGS after incomplete recovery UNTIL CHANGE 8878917<\/strong>\r\n\tOnline log +DG01\/maastb\/onlinelog\/group_1.257.844716051: Thread 1 Group 1 was previously cleared\r\n\tOnline log +FRA\/maastb\/onlinelog\/group_1.568.844716053: Thread 1 Group 1 was previously cleared\r\n\tOnline log +DG01\/maastb\/onlinelog\/group_2.268.844716057: Thread 1 Group 2 was previously cleared\r\n\tOnline log +FRA\/maastb\/onlinelog\/group_2.564.844716059: Thread 1 Group 2 was previously cleared\r\n\tOnline log +DG01\/maastb\/onlinelog\/group_3.269.844716063: Thread 2 Group 3 was previously cleared\r\n\tOnline log +FRA\/maastb\/onlinelog\/group_3.562.844716065: Thread 2 Group 3 was previously cleared\r\n\tOnline log +DG01\/maastb\/onlinelog\/group_4.270.844716067: Thread 2 Group 4 was previously cleared\r\n\tOnline log +FRA\/maastb\/onlinelog\/group_4.559.844716071: Thread 2 Group 4 was previously cleared\r\n\t<strong>Standby became primary SCN: 8878905<\/strong>\r\n\tSun May 11 12:52:45 2014\r\n\tSetting recovery target incarnation to 3\r\n\tSwitchover: Complete - Database mounted as primary\r\n\tSun May 11 12:52:51 2014\r\n\tCompleted: <strong>ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN<\/strong>\r\n\tALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY\r\n\tCompleted: ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY\r\n\tALTER DATABASE OPEN\r\n\tData Guard Broker initializing...\r\n\tThis instance was first to open\r\n\tPicked broadcast on commit scheme to generate SCNs\r\n\tSun May 11 12:52:53 2014\r\n\tAssigning activation ID 723379342 (0x2b1de48e)\r\n\tLGWR: Primary database is in MAXIMUM AVAILABILITY mode\r\n\t<strong>Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED<\/strong>\r\n\tLGWR: Destination LOG_ARCHIVE_DEST_1 is not serviced by LGWR\r\n\tThread 1 advanced to log sequence 2 (thread open)\r\n\tSun May 11 12:52:54 2014\r\n\tARC3: Becoming the 'no SRL' ARCH\r\n\tThread 1 opened at log sequence 2\r\n\tSun May 11 12:52:54 2014\r\n\t  Current log# 2 seq# 2 mem# 0: +DG01\/maastb\/onlinelog\/group_2.268.844716057ARC0: Becoming the 'no SRL' ARCH\r\n\r\n\t  Current log# 2 seq# 2 mem# 1: +FRA\/maastb\/onlinelog\/group_2.564.844716059\r\n\tSuccessful open of redo thread 1\r\n\tMTTR advisory is disabled because FAST_START_MTTR_TARGET is not set\r\n\tSun May 11 12:52:55 2014\r\n\tSMON: enabling cache recovery\r\n\tARC0: Becoming the 'no SRL' ARCH\r\n\tArchived Log entry 323 added for thread 1 sequence 1 ID 0x2b1de48e dest 1:\r\n\tArchiver process freed from errors. No longer stopped\r\n\tInstance recovery: looking for dead threads\r\n\tInstance recovery: lock domain invalid but no dead threads\r\n\tSun May 11 12:53:04 2014\r\n\r\n\r\n\t***********************************************************************\r\n\r\n\tFatal NI connect error 12543, connecting to:\r\n\t (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac11pri-scan.tjsc.jus.br)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=maa)(CID=(PROGRAM=oracle)(HOST=rac11stb01.tjsc.jus.br)(USER=oracle))))\r\n\r\n\t  VERSION INFORMATION:\r\n\t\t\tTNS for Linux: Version 11.2.0.3.0 - Production\r\n\t\t\tTCP\/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production\r\n\t  Time: 11-MAY-2014 12:53:04\r\n\t  Tracing not turned on.\r\n\t  Tns error struct:\r\n\t\tns main err code: 12543\r\n\r\n\tTNS-12543: TNS:destination host unreachable\r\n\t\tns secondary err code: 12560\r\n\t\tnt main err code: 513\r\n\r\n\tTNS-00513: Destination host unreachable\r\n\t\tnt secondary err code: 113\r\n\t\tnt OS err code: 0\r\n\tSun May 11 12:53:06 2014\r\n\t[18329] Successfully onlined Undo Tablespace 2.\r\n\tUndo initialization finished serial:0 start:3723812044 end:3723813584 diff:1540 (15 seconds)\r\n\tVerifying file header compatibility for 11g tablespace encryption..\r\n\tVerifying 11g file header compatibility for tablespace encryption completed\r\n\tSun May 11 12:53:06 2014\r\n\tSMON: enabling tx recovery\r\n\tDatabase Characterset is WE8MSWIN1252\r\n\tSun May 11 12:53:07 2014\r\n\tminact-scn: Inst 1 is a slave inc#:4 mmon proc-id:10424 status:0x2\r\n\tminact-scn status: grec-scn:0x0000.00000000 gmin-scn:0x0000.00000000 gcalc-scn:0x0000.00000000\r\n\tNo Resource Manager plan active\r\n\r\n\r\n\t***********************************************************************\r\n\r\n\tFatal NI connect error 12543, connecting to:\r\n\t (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac11pri-scan.tjsc.jus.br)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=maa)(CID=(PROGRAM=oracle)(HOST=rac11stb01.tjsc.jus.br)(USER=oracle))))\r\n\r\n\t  VERSION INFORMATION:\r\n\t\t\tTNS for Linux: Version 11.2.0.3.0 - Production\r\n\t\t\tTCP\/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production\r\n\t  Time: 11-MAY-2014 12:53:13\r\n\t  Tracing not turned on.\r\n\t  Tns error struct:\r\n\t\tns main err code: 12543\r\n\r\n\tTNS-12543: TNS:destination host unreachable\r\n\t\tns secondary err code: 12560\r\n\t\tnt main err code: 513\r\n\r\n\tTNS-00513: Destination host unreachable\r\n\t\tnt secondary err code: 113\r\n\t\tnt OS err code: 0\r\n\tStarting background process GTX0\r\n\tSun May 11 12:53:14 2014\r\n\tGTX0 started with pid=40, OS id=10940\r\n\tStarting background process RCBG\r\n\tSun May 11 12:53:14 2014\r\n\tRCBG started with pid=41, OS id=10942\r\n\treplication_dependency_tracking turned off (no async multimaster replication found)\r\n\tSun May 11 12:53:16 2014\r\n\tStarting background process QMNC\r\n\tSun May 11 12:53:16 2014\r\n\tQMNC started with pid=42, OS id=10944\r\n\tCompleted: ALTER DATABASE OPEN\r\n\tALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='maastb1';\r\n\tALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=SPFILE SID='maastb1';\r\n\tSun May 11 12:53:22 2014\r\n\tStarting background process SMCO\r\n\tSun May 11 12:53:22 2014\r\n\tSMCO started with pid=44, OS id=10957\r\n\tSun May 11 12:53:22 2014\r\n\r\n\r\n\t***********************************************************************\r\n\r\n\tFatal NI connect error 12543, connecting to:\r\n\t (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac11pri-scan.tjsc.jus.br)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=maa)(CID=(PROGRAM=oracle)(HOST=rac11stb01.tjsc.jus.br)(USER=oracle))))\r\n\r\n\t  VERSION INFORMATION:\r\n\t\t\tTNS for Linux: Version 11.2.0.3.0 - Production\r\n\t\t\tTCP\/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production\r\n\t  Time: 11-MAY-2014 12:53:22\r\n\t  Tracing not turned on.\r\n\t  Tns error struct:\r\n\t\tns main err code: 12543\r\n\r\n\tTNS-12543: TNS:destination host unreachable\r\n\t\tns secondary err code: 12560\r\n\t\tnt main err code: 513\r\n\r\n\tTNS-00513: Destination host unreachable\r\n\t\tnt secondary err code: 113\r\n\t\tnt OS err code: 0\r\n\tError 12543 received logging on to the standby\r\n\tPING[ARC2]: Heartbeat failed to connect to standby 'maa'. Error is 12543.\r\n\tSun May 11 12:53:22 2014\r\n\tARC1: STARTING ARCH PROCESSES\r\n\tSun May 11 12:53:22 2014\r\n\tARC0: Becoming the 'no SRL' ARCH\r\n\tSun May 11 12:53:22 2014\r\n\tARC4 started with pid=48, OS id=10961\r\n\tARC4: Archival started\r\n\tARC1: STARTING ARCH PROCESSES COMPLETE\r\n\tARC1: Becoming the 'no SRL' ARCH\r\n\tSun May 11 12:53:26 2014\r\n\tALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET log_archive_max_processes=4 SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET db_file_name_convert='+DATA\/maa','+DG01\/maastb','+FRA\/maa','+FRA\/maastb' SCOPE=SPFILE;\r\n\tALTER SYSTEM SET log_file_name_convert='+DATA\/maa','+DG01\/maastb','+FRA\/maa','+FRA\/maastb' SCOPE=SPFILE;\r\n\tSun May 11 12:53:29 2014\r\n\tALTER SYSTEM SET log_archive_dest_state_2='RESET' SCOPE=BOTH;\r\n\tSun May 11 12:53:31 2014\r\n\tStarting background process CJQ0\r\n\tSun May 11 12:53:31 2014\r\n\tCJQ0 started with pid=52, OS id=10995\r\n\tFailover succeeded. Primary database is now maastb.\r\n\tSun May 11 12:53:33 2014\r\n\tSetting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter\r\n\tSun May 11 12:53:33 2014\r\n\tStarting background process VKRM\r\n\tSun May 11 12:53:33 2014\r\n\tVKRM started with pid=60, OS id=11000\r\n\tSetting Resource Manager plan SCHEDULER[0x318F]:DEFAULT_MAINTENANCE_PLAN via scheduler window\r\n\tSetting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter\r\n\tSun May 11 12:53:38 2014\r\n\tActive Session History (ASH) performed an emergency flush. This may mean that ASH is undersized. If emergency flushes are a recurring issue, you may consider increasing ASH size by setting the value of _ASH_SIZE to a sufficiently large value. Currently, ASH size is 4194304 bytes. Both ASH size and the total number of emergency flushes since instance startup can be monitored by running the following query:\r\n\t select total_size,awr_flush_emergency_count from v$ash_info;\r\n<\/pre>\n<p style=\"text-align: justify;\">Analisando com calma tudo o que temos acima observamos que a primeira coisa que o Broker fez foi cancelar a aplica\u00e7\u00e3o de redo oriundos da antiga primary. Identificamos tamb\u00e9m que o standby se tornou primary no SCN# 8878905 e marcou um End-Of-Redo em ambas as threads. Depois, todas as transa\u00e7\u00f5es e informa\u00e7\u00f5es sofreram commit para que o banco passasse a ser o primary. Al\u00e9m disso, o banco abriu em MAXIMUM AVAILABILITY e j\u00e1 detectou que o log_archive_dest_2 est\u00e1 dessincronizado (por isso as falhas de TNS que aparecem). \u00a0Acima eu n\u00e3o demonstrei alertlog da segunda inst\u00e2ncia que comp\u00f5e o banco \u201cmaastb\u201d, mas as informa\u00e7\u00f5es contidas l\u00e1 s\u00e3o simples (j\u00e1 que tudo foi feito pela \u201cmaastb1\u201d).<\/p>\n<p style=\"text-align: justify;\">Se voc\u00ea n\u00e3o tivesse o Broker voc\u00ea teria que fazer tudo isso manualmente. Todos os comandos desde o cancel ante o failover seriam manuais, inclusive o ajuste do CRS. Para verificar como ficou o ambiente podemos executar no Broker:<\/p>\n<pre>DGMGRL&gt; SHOW CONFIGURATION VERBOSE;\r\n\r\nConfiguration - dgrac\r\n\r\n  Protection Mode: MaxAvailability\r\n  Databases:\r\n\tmaastb - Primary database\r\n\t  <strong>Warning: ORA-16629: database reports a different protection level from the protection mode<\/strong>\r\n\r\n\tmaa    - Physical standby database (disabled)\r\n\t  <strong>ORA-16661: the standby database needs to be reinstated<\/strong>\r\n\r\n  Properties:\r\n\tFastStartFailoverThreshold      = '30'\r\n\tOperationTimeout                = '30'\r\n\tFastStartFailoverLagLimit       = '30'\r\n\tCommunicationTimeout            = '180'\r\n\tFastStartFailoverAutoReinstate  = 'TRUE'\r\n\tFastStartFailoverPmyShutdown    = 'TRUE'\r\n\tBystandersFollowRoleChange      = 'ALL'\r\n\r\nFast-Start Failover: DISABLED\r\n\r\nConfiguration Status:\r\nWARNING\r\n\r\nDGMGRL&gt; <strong>SHOW DATABASE VERBOSE maastb;<\/strong>\r\n\r\nDatabase - maastb\r\n\r\n  Role:            PRIMARY\r\n  Intended State:  TRANSPORT-ON\r\n  Instance(s):\r\n\tmaastb1\r\n\tmaastb2\r\n\r\n  Database Warning(s):\r\n\tORA-16629: database reports a different protection level from the protection mode\r\n\r\n  Properties:\r\n\tDGConnectIdentifier             = 'maastb'\r\n\tObserverConnectIdentifier       = ''\r\n\tLogXptMode                      = 'SYNC'\r\n\tDelayMins                       = '0'\r\n\tBinding                         = 'OPTIONAL'\r\n\tMaxFailure                      = '0'\r\n\tMaxConnections                  = '1'\r\n\tReopenSecs                      = '300'\r\n\tNetTimeout                      = '30'\r\n\tRedoCompression                 = 'DISABLE'\r\n\tLogShipping                     = 'ON'\r\n\tPreferredApplyInstance          = ''\r\n\tApplyInstanceTimeout            = '0'\r\n\tApplyParallel                   = 'AUTO'\r\n\tStandbyFileManagement           = 'AUTO'\r\n\tArchiveLagTarget                = '0'\r\n\tLogArchiveMaxProcesses          = '4'\r\n\tLogArchiveMinSucceedDest        = '1'\r\n\tDbFileNameConvert               = '+DATA\/maa, +DG01\/maastb, +FRA\/maa, +FRA\/maastb'\r\n\tLogFileNameConvert              = '+DATA\/maa, +DG01\/maastb, +FRA\/maa, +FRA\/maastb'\r\n\tFastStartFailoverTarget         = ''\r\n\tInconsistentProperties          = '(monitor)'\r\n\tInconsistentLogXptProps         = '(monitor)'\r\n\tSendQEntries                    = '(monitor)'\r\n\tLogXptStatus                    = '(monitor)'\r\n\tRecvQEntries                    = '(monitor)'\r\n\tSidName(*)\r\n\tStaticConnectIdentifier(*)\r\n\tStandbyArchiveLocation(*)\r\n\tAlternateLocation(*)\r\n\tLogArchiveTrace(*)\r\n\tLogArchiveFormat(*)\r\n\tTopWaitEvents(*)\r\n\t(*) - Please check specific instance for the property value\r\n\r\nDatabase Status:\r\nWARNING\r\n\r\nDGMGRL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\">Observe acima que temos alguns detalhes a serem averiguados. Temos um belo <strong>\u201cORA-16629: database reports a different protection level from the protection mode\u201d <\/strong>e ele ocorre pois o novo standby n\u00e3o est\u00e1 dispon\u00edvel para sincroniza\u00e7\u00e3o de archives (vou demonstrar abaixo). Vemos tamb\u00e9m que o \u201cmaastb\u201d \u00e9 o novo primary.<\/p>\n<p style=\"text-align: justify;\">Se verificarmos o antigo primary iremos ver informa\u00e7\u00f5es importantes:<\/p>\n<pre>DGMGRL&gt; <strong>SHOW DATABASE VERBOSE maa;<\/strong>\r\n\r\nDatabase - maa\r\n\r\n  Role:            PHYSICAL STANDBY\r\n  Intended State:  APPLY-ON\r\n  Transport Lag:   (unknown)\r\n  Apply Lag:       (unknown)\r\n  Real Time Query: OFF\r\n  Instance(s):\r\n\tmaa1\r\n\tmaa2\r\n\r\n  Properties:\r\n\tDGConnectIdentifier             = 'maa'\r\n\tObserverConnectIdentifier       = ''\r\n\tLogXptMode                      = 'SYNC'\r\n\tDelayMins                       = '0'\r\n\tBinding                         = 'optional'\r\n\tMaxFailure                      = '0'\r\n\tMaxConnections                  = '1'\r\n\tReopenSecs                      = '300'\r\n\tNetTimeout                      = '30'\r\n\tRedoCompression                 = 'DISABLE'\r\n\tLogShipping                     = 'ON'\r\n\tPreferredApplyInstance          = ''\r\n\tApplyInstanceTimeout            = '0'\r\n\tApplyParallel                   = 'AUTO'\r\n\tStandbyFileManagement           = 'AUTO'\r\n\tArchiveLagTarget                = '0'\r\n\tLogArchiveMaxProcesses          = '4'\r\n\tLogArchiveMinSucceedDest        = '1'\r\n\tDbFileNameConvert               = '+DG01\/maastb, +DATA\/maa, +FRA\/maastb, +FRA\/maa'\r\n\tLogFileNameConvert              = '+DG01\/maastb, +DATA\/maa, +FRA\/maastb, +FRA\/maa'\r\n\tFastStartFailoverTarget         = ''\r\n\tInconsistentProperties          = '(monitor)'\r\n\tInconsistentLogXptProps         = '(monitor)'\r\n\tSendQEntries                    = '(monitor)'\r\n\tLogXptStatus                    = '(monitor)'\r\n\tRecvQEntries                    = '(monitor)'\r\n\tSidName(*)\r\n\tStaticConnectIdentifier(*)\r\n\tStandbyArchiveLocation(*)\r\n\tAlternateLocation(*)\r\n\tLogArchiveTrace(*)\r\n\tLogArchiveFormat(*)\r\n\tTopWaitEvents(*)\r\n\t(*) - Please check specific instance for the property value\r\n\r\nDatabase Status:\r\n<strong>ORA-16661: the standby database needs to be reinstated<\/strong>\r\n\r\nDGMGRL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\">O principal detalhe aqui \u00e9 a informa\u00e7\u00e3o que ele necessita de um reinstate: <strong>\u201cORA-16661: the standby database needs to be reinstated\u201d<\/strong>. Se voc\u00ea disponibilizar o seu antigo primary voc\u00ea ter\u00e1 que fazer o reinstate dele.<\/p>\n<p style=\"text-align: justify;\"><strong>CONTROLE 2<\/strong><\/p>\n<p style=\"text-align: justify;\">At\u00e9 o momento tudo foi muito legal e bonito, fizemos o failover atrav\u00e9s do Broker e ele cuidou de tudo por n\u00f3s. Claro que tudo isso aconteceu porque deixamos e mantivemos o ambiente s\u00e3o, a sincroniza\u00e7\u00e3o entre primary e standby estava correta e nenhuma informa\u00e7\u00e3o foi perdida. Vamos ver a tabela de teste que usamos no in\u00edcio do artigo:<\/p>\n<pre>SQL&gt; SELECT instance_name, status FROM gv$instance;\r\n\r\nINSTANCE_NAME    STATUS\r\n---------------- ------------\r\nmaastb2          OPEN\r\nmaastb1          OPEN\r\n\r\nSQL&gt; SELECT c1, TO_CHAR(c2, 'DD\/MM\/RRRR HH24:MI:SS') AS momento FROM testedg;\r\n\r\n\t\tC1 MOMENTO\r\n---------- -------------------\r\n\t\t 1 11\/05\/2014 12:01:07\r\n\t\t 2 11\/05\/2014 12:02:17\r\n\r\nSQL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\"><strong>REINSTATE<\/strong><\/p>\n<p style=\"text-align: justify;\">J\u00e1 aviso com anteced\u00eancia que os pr\u00f3ximos logs s\u00e3o extensos. De qualquer forma eles est\u00e3o recheados de detalhes t\u00e9cnicos que merecem aten\u00e7\u00e3o e um olhar mais cuidadoso.<\/p>\n<p style=\"text-align: justify;\">Se voc\u00ea deixar tudo da forma como est\u00e1 agora voc\u00ea tem o banco \u201cmaastb\u201d atuando como primary e esperando que o banco \u201cmaa\u201d assuma seu lugar como standy. No log do Broker das inst\u00e2ncias do primary voc\u00ea ver\u00e1 a seguinte informa\u00e7\u00e3o (bem como nas sa\u00eddas do dgmgrl que mostrei acima):<\/p>\n<pre>05\/11\/2014 19:40:53\r\nError: The actual protection level 'RESYNCHRONIZATION' is different from the configured protection mode 'MAXIMUM AVAILABILITY'.\r\nData Guard Broker Status Summary:\r\n  Type                        Name                             Severity  Status\r\n  Configuration               dgrac                             Warning  ORA-16608\r\n  Primary Database            maastb                            Warning  ORA-16629\r\n  Physical Standby Database   maa                                 Error  ORA-16661\r\n<\/pre>\n<p style=\"text-align: justify;\">Al\u00e9m disso, voc\u00ea deve estar se perguntando o que acontecer\u00e1 se o meu antigo primary voltar e ficar dispon\u00edvel? Ser\u00e1 que vai dar problema? Hum&#8230; n\u00e3o.<\/p>\n<p style=\"text-align: justify;\">O simples fato de usarmos o Broker j\u00e1 nos ajuda tremendamente. Quando o antigo primary voltar ele precisar\u00e1 de um reinstate assim que retorne. Observe abaixo alertlog do antigo primary assim que ele foi religado (este log foi \u201ccortado\u201d, mas suas partes interessantes est\u00e3o mantidas):<\/p>\n<pre>Mon May 12 05:14:46 2014\r\nStarting ORACLE instance (normal)\r\n****************** Large Pages Information *****************\r\n\r\nTotal Shared Global Region in Large Pages = 0 KB (0%)\r\n\r\nLarge Pages used by this instance: 0 (0 KB)\r\nLarge Pages unused system wide = 0 (0 KB) (alloc incr 4096 KB)\r\nLarge Pages configured system wide = 0 (0 KB)\r\nLarge Page size = 2048 KB\r\n...\r\n...\r\nSYS auditing is disabled\r\nStarting up:\r\nOracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production\r\nWith the Partitioning and Real Application Clusters options.\r\nORACLE_HOME = \/u01\/app\/oracle\/product\/11.2.0.3\/db_1\r\nSystem name:    Linux\r\nNode name:      rac11pri01.tjsc.jus.br\r\nRelease:        2.6.39-400.17.1.el6uek.x86_64\r\nVersion:        #1 SMP Fri Feb 22 18:16:18 PST 2013\r\nMachine:        x86_64\r\nVM name:        VMWare Version: 6\r\n...\r\n...\r\n  fal_server               = \"MAASTB\"\r\n  log_archive_trace        = 0\r\n  log_archive_config       = \"DG_CONFIG=(maa,maastb)\"\r\n...\r\n...\r\nDBW0 started with pid=17, OS id=3509\r\nMon May 12 05:14:51 2014\r\nLGWR started with pid=18, OS id=3516\r\nMon May 12 05:14:51 2014\r\nCKPT started with pid=19, OS id=3519\r\nMon May 12 05:14:51 2014\r\nSMON started with pid=20, OS id=3521\r\nMon May 12 05:14:51 2014\r\nRECO started with pid=21, OS id=3523\r\n...\r\n...\r\nReconfiguration complete\r\nMon May 12 05:14:52 2014\r\nLCK0 started with pid=28, OS id=3558\r\nStarting background process RSMN\r\nMon May 12 05:14:52 2014\r\nRSMN started with pid=29, OS id=3562\r\nORACLE_BASE not set in environment. It is recommended\r\nthat ORACLE_BASE be set in the environment\r\nReusing ORACLE_BASE from an earlier startup = \/u01\/app\/oracle\r\nMon May 12 05:14:53 2014\r\n<strong>DMON started with pid=30, OS id=3565<\/strong>\r\nMon May 12 05:14:55 2014\r\nALTER SYSTEM SET local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.17.42.14)(PORT=1521))))' SCOPE=MEMORY SID='maa1';\r\n<strong>ALTER DATABASE MOUNT \/* db agent *\/\/* {1:51382:2} *\/<\/strong>\r\nThis instance was first to mount\r\nNOTE: Loaded library: \/opt\/oracle\/extapi\/64\/asm\/orcl\/1\/libasm.so\r\nNOTE: Loaded library: System\r\n...\r\n...\r\nDatabase mounted in Shared Mode (CLUSTER_DATABASE=TRUE)\r\nLost write protection disabled\r\n<strong>Completed: ALTER DATABASE MOUNT \/* db agent *\/\/* {1:51382:2} *\/<\/strong>\r\n<strong>ALTER DATABASE OPEN \/* db agent *\/\/* {1:51382:2} *\/<\/strong>\r\n<strong>Data Guard Broker initializing...<\/strong>\r\n<strong>Data Guard Broker initialization complete<\/strong>\r\n<strong>Data Guard: verifying database primary role...<\/strong>\r\n<strong>Mon May 12 05:15:06 2014<\/strong>\r\n<strong>Starting Data Guard Broker (DMON)<\/strong>\r\nMon May 12 05:15:06 2014\r\nINSV started with pid=35, OS id=3657\r\nMon May 12 05:15:10 2014\r\nNSV1 started with pid=36, OS id=3669\r\nMon May 12 05:15:16 2014\r\n<strong>Data Guard: version check completed<\/strong>\r\n<strong>Data Guard determines a failover has occurred - this is no longer a primary database<\/strong>\r\n<strong>ORA-16649 signalled during: ALTER DATABASE OPEN \/* db agent *\/\/* {1:51382:2} *\/...\r\n<\/strong><\/pre>\n<p style=\"text-align: justify;\">Observe acima que ao subir ele abriu o banco, mas logo em seguida que o processo do Broker foi iniciado ele detectou o <strong>ORA-16649<\/strong> ao fazer o \u201cverifying database primary role\u201d. Assim, ele detectou que \u201c<strong>this is no longer a primary database<\/strong>\u201d e deixou o banco em modo mount. No log do Broker da antiga primary n\u00f3s temos:<\/p>\n<pre>05\/12\/2014 05:15:06\r\n&gt;&gt; Starting Data Guard Broker bootstrap &lt;&lt;\r\nBroker Configuration File Locations:\r\n\t  dg_broker_config_file1 = \"+DATA\/maa\/dr1maa.dat\"\r\n\t  dg_broker_config_file2 = \"+FRA\/maa\/dr2maa.dat\"\r\n05\/12\/2014 05:15:10\r\nDMON Registering service maa_DGB with listener(s)\r\nBroker Configuration:       \"dgrac\"\r\n\t  Protection Mode:            Maximum Availability\r\n\t  Fast-Start Failover (FSFO): Disabled, flags=0x0, version=0\r\n\t  Primary Database:           maa (0x01010000)\r\n\t  Standby Database:           maastb, Enabled Physical Standby (0x02010000)\r\n05\/12\/2014 05:15:16\r\n<strong>Site maastb returned ORA-16623.<\/strong>\r\n<strong>Version Check Results:<\/strong>\r\n\t  <strong>Database maastb returned ORA-16623<\/strong>\r\n<strong>Disable redo transport to all standby databases<\/strong>\r\n<strong>RSM0 failed to remove all destinations, error ORA-16718\r\n<\/strong><\/pre>\n<p style=\"text-align: justify;\">Observe que tamb\u00e9m temos um \u201cORA-16623\u201d e \u201cORA-16718\u201d. Isso simplesmente nos diz que o banco atual n\u00e3o pode abrir e precisa de reinstate para mudar de papel. Outro detalhe interessante que pe\u00e7o que observe \u00e9 quem sinalizou o ORA-16623, se voc\u00ea notar foi a nova primary que fez isso e o erro nos diz que ocorreu uma troca de papeis.<\/p>\n<p style=\"text-align: justify;\">Para resolver tudo n\u00f3s precisamos fazer o reinstate do antigo primary para que ele se torne o novo standby. Para isso execute no dgmgrl o seguinte comando (estou conectando atrav\u00e9s de uma inst\u00e2ncia do standby):<\/p>\n<pre>DGMGRL&gt; <strong>REINSTATE DATABASE maa;<\/strong>\r\nReinstating database \"maa\", please wait...\r\n<strong>Operation requires shutdown of instance \"maa1\" on database \"maa\"<\/strong>\r\nShutting down instance \"maa1\"...\r\nORA-01109: database not open\r\n\r\nDatabase dismounted.\r\nORACLE instance shut down.\r\n<strong>Operation requires startup of instance \"maa1\" on database \"maa\"<\/strong>\r\nStarting instance \"maa1\"...\r\nORACLE instance started.\r\nDatabase mounted.\r\nContinuing to reinstate database \"maa\" ...\r\nReinstatement of database \"maa\" succeeded\r\nDGMGRL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\">Observe acima que ao chamar o reinstate do banco atrav\u00e9s do Broker ele conectou no antigo primary (maa), realizou o shutdown e abriu a inst\u00e2ncia em modo mount. Enquanto o comando acima era executado a seguinte informa\u00e7\u00e3o aparecia no log do Broker da inst\u00e2ncia do primary:<\/p>\n<pre>Log Broker instancia maastb1:\r\n\t05\/11\/2014 20:11:54\r\n\t<strong>REINSTATE DATABASE maa<\/strong>\r\n\tDatabase maa can be reinstated\r\n\t05\/11\/2014 20:13:02\r\n\tCommand REINSTATE DATABASE maa completed with warning ORA-16570\r\n\t05\/11\/2014 20:13:46\r\n\tREINSTATE DATABASE maa\r\n\tDatabase maa can be reinstated\r\n\t05\/11\/2014 20:14:06\r\n\tSuccessfully completed reinstatement of database 0x01001000; removing ReinstateContextArray property\r\n\t05\/11\/2014 20:14:47\r\n\t<strong>Command REINSTATE DATABASE maa completed<\/strong>\r\n\t<strong>EDIT DATABASE maa SET PROPERTY ActualApplyInstance = maa1<\/strong>\r\n\tApply Instance for database maa is maa1\r\n\tCommand EDIT DATABASE maa SET PROPERTY ActualApplyInstance = maa1 completed\r\n<\/pre>\n<p style=\"text-align: justify;\">A informa\u00e7\u00e3o \u00e9 praticamente a mesma que apareceu no dgmgrl. As informa\u00e7\u00f5es ficam mais interessantes no alertlog das inst\u00e2ncias do primary, observe abaixo:<\/p>\n<pre><strong>Alertlog da inst\u00e2ncia maastb1:<\/strong>\r\n\tSun May 11 20:12:28 2014\r\n\tALTER SYSTEM SET log_archive_dest_2='service=\"maa\"','LGWR SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=1 db_unique_name=\"maa\" net_timeout=30','valid_for=(all_logfiles,primary_role)' SCOPE=BOTH;\r\n\t<strong>ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;<\/strong>\r\n\tSun May 11 20:12:30 2014\r\n\t******************************************************************\r\n\tLGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2\r\n\t******************************************************************\r\n\tLGWR: Error 16009 disconnecting from destination LOG_ARCHIVE_DEST_2 standby host 'maa'\r\n\tError 16009 for archive log file 1 to 'maa'\r\n\tLGWR: Failed to archive log 1 thread 1 sequence 3 (16009)\r\n\tThread 1 advanced to log sequence 3 (LGWR switch)\r\n\t  Current log# 1 seq# 3 mem# 0: +DG01\/maastb\/onlinelog\/group_1.257.844716051\r\n\t  Current log# 1 seq# 3 mem# 1: +FRA\/maastb\/onlinelog\/group_1.568.844716053\r\n\tSun May 11 20:12:42 2014\r\n\tArchived Log entry 328 added for thread 1 sequence 2 ID 0x2b1de48e dest 1:\r\n\tSun May 11 20:12:51 2014\r\n\tALTER SYSTEM SET log_archive_dest_state_2='RESET' SCOPE=BOTH;\r\n\tSun May 11 20:13:48 2014\r\n\r\n\r\n\t***********************************************************************\r\n\r\n\tFatal NI connect error 12514, connecting to:\r\n\t (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac11pri-scan.tjsc.jus.br)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=maa_DGB)(CID=(PROGRAM=oracle)(HOST=rac11stb01.tjsc.jus.br)(USER=oracle))))\r\n\r\n\t  VERSION INFORMATION:\r\n\t\t\tTNS for Linux: Version 11.2.0.3.0 - Production\r\n\t\t\tTCP\/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production\r\n\t  Time: 11-MAY-2014 20:13:48\r\n\t  Tracing not turned on.\r\n\t  Tns error struct:\r\n\t\tns main err code: 12564\r\n\r\n\tTNS-12564: TNS:connection refused\r\n\t\tns secondary err code: 0\r\n\t\tnt main err code: 0\r\n\t\tnt secondary err code: 0\r\n\t\tnt OS err code: 0\r\n\r\n\r\n\t***********************************************************************\r\n\r\n\tFatal NI connect error 12514, connecting to:\r\n\t (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac11pri-scan.tjsc.jus.br)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=maa_DGB)(CID=(PROGRAM=oracle)(HOST=rac11stb01.tjsc.jus.br)(USER=oracle))))\r\n\r\n\t  VERSION INFORMATION:\r\n\t\t\tTNS for Linux: Version 11.2.0.3.0 - Production\r\n\t\t\tTCP\/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production\r\n\t  Time: 11-MAY-2014 20:13:48\r\n\t  Tracing not turned on.\r\n\t  Tns error struct:\r\n\t\tns main err code: 12564\r\n\r\n\tTNS-12564: TNS:connection refused\r\n\t\tns secondary err code: 0\r\n\t\tnt main err code: 0\r\n\t\tnt secondary err code: 0\r\n\t\tnt OS err code: 0\r\n\r\n\r\n\t***********************************************************************\r\n\r\n\tFatal NI connect error 12514, connecting to:\r\n\t (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac11pri-scan.tjsc.jus.br)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=maa_DGB)(CID=(PROGRAM=oracle)(HOST=rac11stb01.tjsc.jus.br)(USER=oracle))))\r\n\r\n\t  VERSION INFORMATION:\r\n\t\t\tTNS for Linux: Version 11.2.0.3.0 - Production\r\n\t\t\tTCP\/IP NT Protocol Adapter for Linux: Version 11.2.0.3.0 - Production\r\n\t  Time: 11-MAY-2014 20:13:48\r\n\t  Tracing not turned on.\r\n\t  Tns error struct:\r\n\t\tns main err code: 12564\r\n\r\n\tTNS-12564: TNS:connection refused\r\n\t\tns secondary err code: 0\r\n\t\tnt main err code: 0\r\n\t\tnt secondary err code: 0\r\n\t\tnt OS err code: 0\r\n\tSun May 11 20:13:53 2014\r\n\tALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;\r\n\tSun May 11 20:13:54 2014\r\n\tThread 1 cannot allocate new log, sequence 4\r\n\tCheckpoint not complete\r\n\t  Current log# 1 seq# 3 mem# 0: +DG01\/maastb\/onlinelog\/group_1.257.844716051\r\n\t  Current log# 1 seq# 3 mem# 1: +FRA\/maastb\/onlinelog\/group_1.568.844716053\r\n\tLGWR: Standby redo logfile selected to archive thread 1 sequence 4\r\n\tLGWR: Standby redo logfile selected for thread 1 sequence 4 for destination LOG_ARCHIVE_DEST_2\r\n\tThread 1 advanced to log sequence 4 (LGWR switch)\r\n\t  Current log# 2 seq# 4 mem# 0: +DG01\/maastb\/onlinelog\/group_2.268.844716057\r\n\t  Current log# 2 seq# 4 mem# 1: +FRA\/maastb\/onlinelog\/group_2.564.844716059\r\n\tSun May 11 20:13:59 2014\r\n\tArchived Log entry 330 added for thread 1 sequence 3 ID 0x2b1de48e dest 1:\r\n\tARC0: Standby redo logfile selected for thread 1 sequence 3 for destination LOG_ARCHIVE_DEST_2\r\n\tSun May 11 20:14:07 2014\r\n\tALTER SYSTEM SET log_archive_dest_2='service=\"maa\"','LGWR SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name=\"maa\" net_timeout=30','valid_for=(all_logfiles,primary_role)' SCOPE=BOTH;\r\n\tALTER SYSTEM ARCHIVE LOG\r\n\tSun May 11 20:14:07 2014\r\n\tThread 1 cannot allocate new log, sequence 5\r\n\tCheckpoint not complete\r\n\t  Current log# 2 seq# 4 mem# 0: +DG01\/maastb\/onlinelog\/group_2.268.844716057\r\n\t  Current log# 2 seq# 4 mem# 1: +FRA\/maastb\/onlinelog\/group_2.564.844716059\r\n\t******************************************************************\r\n\tLGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2\r\n\t******************************************************************\r\n\tLGWR: Standby redo logfile selected to archive thread 1 sequence 5\r\n\tLGWR: Standby redo logfile selected for thread 1 sequence 5 for destination LOG_ARCHIVE_DEST_2\r\n\tThread 1 advanced to log sequence 5 (LGWR switch)\r\n\t  Current log# 1 seq# 5 mem# 0: +DG01\/maastb\/onlinelog\/group_1.257.844716051\r\n\t  Current log# 1 seq# 5 mem# 1: +FRA\/maastb\/onlinelog\/group_1.568.844716053\r\n\tArchived Log entry 339 added for thread 1 sequence 4 ID 0x2b1de48e dest 1:\r\n\tArchived Log entry 342 added for thread 2 sequence 4 ID 0x2b1de48e dest 1:\r\n\tSun May 11 20:15:14 2014\r\n\t<strong>Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED<\/strong>\r\n\tLGWR: Standby redo logfile selected to archive thread 1 sequence 6\r\n\tLGWR: Standby redo logfile selected for thread 1 sequence 6 for destination LOG_ARCHIVE_DEST_2\r\n\tThread 1 advanced to log sequence 6 (LGWR switch)\r\n\t  Current log# 2 seq# 6 mem# 0: +DG01\/maastb\/onlinelog\/group_2.268.844716057\r\n\t  Current log# 2 seq# 6 mem# 1: +FRA\/maastb\/onlinelog\/group_2.564.844716059\r\n\tSun May 11 20:15:15 2014\r\n\tArchived Log entry 344 added for thread 1 sequence 5 ID 0x2b1de48e dest 1:\r\n\r\n<strong>Alertlog inst\u00e2ncia maastb2:<\/strong>\r\n\tMon May 12 02:12:33 2014\r\n\t******************************************************************\r\n\tLGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2\r\n\t******************************************************************\r\n\tLGWR: Error 16009 disconnecting from destination LOG_ARCHIVE_DEST_2 standby host 'maa'\r\n\tError 16009 for archive log file 3 to 'maa'\r\n\tLGWR: Failed to archive log 3 thread 2 sequence 3 (16009)\r\n\tThread 2 advanced to log sequence 3 (LGWR switch)\r\n\t  Current log# 3 seq# 3 mem# 0: +DG01\/maastb\/onlinelog\/group_3.269.844716063\r\n\t  Current log# 3 seq# 3 mem# 1: +FRA\/maastb\/onlinelog\/group_3.562.844716065\r\n\tMon May 12 02:12:36 2014\r\n\tDeleted Oracle managed file +FRA\/maastb\/flashback\/log_10.540.846646525\r\n\tArchived Log entry 327 added for thread 2 sequence 2 ID 0x2b1de48e dest 1:\r\n\tMon May 12 02:13:56 2014\r\n\tLGWR: Standby redo logfile selected to archive thread 2 sequence 4\r\n\tLGWR: Standby redo logfile selected for thread 2 sequence 4 for destination LOG_ARCHIVE_DEST_2\r\n\tThread 2 advanced to log sequence 4 (LGWR switch)\r\n\t  Current log# 4 seq# 4 mem# 0: +DG01\/maastb\/onlinelog\/group_4.270.844716067\r\n\t  Current log# 4 seq# 4 mem# 1: +FRA\/maastb\/onlinelog\/group_4.559.844716071\r\n\tMon May 12 02:13:59 2014\r\n\tArchived Log entry 329 added for thread 2 sequence 3 ID 0x2b1de48e dest 1:\r\n\tARC3: Standby redo logfile selected for thread 2 sequence 3 for destination LOG_ARCHIVE_DEST_2\r\n\tMon May 12 02:14:09 2014\r\n\tThread 2 cannot allocate new log, sequence 5\r\n\tCheckpoint not complete\r\n\t  Current log# 4 seq# 4 mem# 0: +DG01\/maastb\/onlinelog\/group_4.270.844716067\r\n\t  Current log# 4 seq# 4 mem# 1: +FRA\/maastb\/onlinelog\/group_4.559.844716071\r\n\tMon May 12 02:14:10 2014\r\n\tFAL[server, ARC0]: FAL archive failed, see trace file.\r\n\tMon May 12 02:14:12 2014\r\n\t<strong>ARC3: Archive log rejected (thread 1 sequence 1) at host 'maa'<\/strong>\r\n\tFAL[server, ARC3]: FAL archive failed, see trace file.\r\n\tARCH: FAL archive failed. Archiver continuing\r\n\tORACLE Instance maastb2 - Archival Error. Archiver continuing.\r\n\tARC0: Archive log rejected (thread 2 sequence 2) at host 'maa'\r\n\tFAL[server, ARC0]: FAL archive failed, see trace file.\r\n\tARCH: FAL archive failed. Archiver continuing\r\n\tORACLE Instance maastb2 - Archival Error. Archiver continuing.\r\n\t******************************************************************\r\n\tLGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2\r\n\t******************************************************************\r\n\tLGWR: Standby redo logfile selected to archive thread 2 sequence 5\r\n\tLGWR: Standby redo logfile selected for thread 2 sequence 5 for destination LOG_ARCHIVE_DEST_2\r\n\tThread 2 advanced to log sequence 5 (LGWR switch)\r\n\t  Current log# 3 seq# 5 mem# 0: +DG01\/maastb\/onlinelog\/group_3.269.844716063\r\n\t  Current log# 3 seq# 5 mem# 1: +FRA\/maastb\/onlinelog\/group_3.562.844716065\r\n\tMon May 12 02:15:14 2014\r\n\tThread 2 cannot allocate new log, sequence 6\r\n\tCheckpoint not complete\r\n\t  Current log# 3 seq# 5 mem# 0: +DG01\/maastb\/onlinelog\/group_3.269.844716063\r\n\t  Current log# 3 seq# 5 mem# 1: +FRA\/maastb\/onlinelog\/group_3.562.844716065\r\n\t<strong>Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED<\/strong>\r\n\tLGWR: Standby redo logfile selected to archive thread 2 sequence 6\r\n\tLGWR: Standby redo logfile selected for thread 2 sequence 6 for destination LOG_ARCHIVE_DEST_2\r\n\tThread 2 advanced to log sequence 6 (LGWR switch)\r\n\t  Current log# 4 seq# 6 mem# 0: +DG01\/maastb\/onlinelog\/group_4.270.844716067\r\n\t  Current log# 4 seq# 6 mem# 1: +FRA\/maastb\/onlinelog\/group_4.559.844716071\r\n\tMon May 12 02:15:19 2014\r\n\tArchived Log entry 346 added for thread 2 sequence 5 ID 0x2b1de48e dest 1:\r\n<\/pre>\n<p style=\"text-align: justify;\">Se voc\u00ea observar acima ver\u00e1 que o log_archive_dest_2 foi \u201creabilitado\u201d e passou a sincronizar com o seu destino. Observe que ele respeitou as mesmas informa\u00e7\u00f5es que hav\u00edamos definido desde o in\u00edcio da configura\u00e7\u00e3o do DG.<\/p>\n<p style=\"text-align: justify;\">Os logs mais interessantes ficam no antigo primary (e novo standby), primeiro observe abaixo o log do Broker:<\/p>\n<pre><strong>Log do Broker na maa1:<\/strong>\r\n\t05\/12\/2014 05:30:07\r\n\t<strong>Data Guard notifying Oracle Clusterware of database role change<\/strong>\r\n\t05\/12\/2014 05:30:29\r\n\tCreating process RSM0\r\n\t05\/12\/2014 05:30:47\r\n\t<strong>Physical RSM: Reinstatement... Converting old primary control file to physical standby control file<\/strong>\r\n\t05\/12\/2014 05:30:52\r\n\t<strong>Purging diverged redos on resetlogs branch 844762805, starting SCN 8878906<\/strong>\r\n\tPurged 0 archived logs\r\n\t05\/12\/2014 05:31:11\r\n\tData Guard Broker shutting down\r\n\tRSM0 successfully terminated\r\n\t05\/12\/2014 05:31:14\r\n\t&gt;&gt; DMON Process Shutdown &lt;&lt; \t05\/12\/2014 05:31:43 \t&gt;&gt; Starting Data Guard Broker bootstrap &lt;&lt;\r\n\tBroker Configuration File Locations:\r\n\t\t  dg_broker_config_file1 = \"+DATA\/maa\/dr1maa.dat\"\r\n\t\t  dg_broker_config_file2 = \"+FRA\/maa\/dr2maa.dat\"\r\n\t05\/12\/2014 05:31:47\r\n\t<strong>Database needs to be reinstated or re-created, Data Guard broker ready<\/strong>\r\n\t05\/12\/2014 05:31:49\r\n\tDMON Registering service maa_DGB with listener(s)\r\n\t05\/12\/2014 05:31:54\r\n\tApply Instance for Database maa set to maa1\r\n\tData Guard notifying Oracle Clusterware of database role change\r\n\tCreating process RSM0\r\n\t05\/12\/2014 05:32:23\r\n\t<strong>Notifying Oracle Clusterware to buildup after REINSTATEMENT<\/strong>\r\n\tData Guard notifying Oracle Clusterware to start services and other instances change\r\n\t05\/12\/2014 05:32:26\r\n\tCommand REINSTATE DATABASE maa completed\r\n\t05\/12\/2014 05:32:50\r\n\tCommand EDIT DATABASE maa SET PROPERTY ActualApplyInstance = maa1 completed\r\n<\/pre>\n<p style=\"text-align: justify;\">Se analisarmos com calma o log acima veremos que ele detectou qual o SCN necess\u00e1rio para o reinstate, realizou o reinstate e corrigiu o CRS tamb\u00e9m. No alertlog da inst\u00e2ncia do antigo primary n\u00f3s temos:<\/p>\n<pre><strong>Alertlog da maa1:<\/strong>\r\n\tMon May 12 05:30:29 2014\r\n\tRSM0 started with pid=39, OS id=3988\r\n\tMon May 12 05:30:32 2014\r\n\tUsing STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST\r\n\tRFS[1]: Assigned to RFS process 3990\r\n\tRFS[1]: Database mount ID mismatch [0x2b1de48e:0x2b44d48f] (723379342:725931151)\r\n\t<strong>FLASHBACK DATABASE TO SCN 8878905<\/strong>\r\n\tMon May 12 05:30:35 2014\r\n\tRFS[2]: Assigned to RFS process 3993\r\n\tRFS[2]: Database mount ID mismatch [0x2b1de48e:0x2b44d48f] (723379342:725931151)\r\n\t<strong>Flashback Restore Start<\/strong>\r\n\t<strong>Flashback Restore Complete<\/strong>\r\n\t<strong>Flashback Media Recovery Start<\/strong>\r\n\t started logmerger process\r\n\tParallel Media Recovery started with 2 slaves\r\n\tMon May 12 05:30:38 2014\r\n\tRecovery of Online Redo Log: Thread 2 Group 3 Seq 99 Reading mem 0\r\n\t  Mem# 0: +DATA\/maa\/onlinelog\/group_3.257.843489101\r\n\t  Mem# 1: +FRA\/maa\/onlinelog\/group_3.284.843489101\r\n\tRecovery of Online Redo Log: Thread 1 Group 1 Seq 139 Reading mem 0\r\n\t  Mem# 0: +DATA\/maa\/onlinelog\/group_1.272.843488553\r\n\t  Mem# 1: +FRA\/maa\/onlinelog\/group_1.286.843488555\r\n\tRecovery of Online Redo Log: Thread 1 Group 2 Seq 140 Reading mem 0\r\n\t  Mem# 0: +DATA\/maa\/onlinelog\/group_2.271.843488555\r\n\t  Mem# 1: +FRA\/maa\/onlinelog\/group_2.285.843488555\r\n\tIncomplete Recovery applied until change 8878906 time 05\/11\/2014 18:08:14\r\n\tMon May 12 05:30:47 2014\r\n\t<strong>Flashback Media Recovery Complete<\/strong>\r\n\t<strong>Completed: FLASHBACK DATABASE TO SCN 8878905<\/strong>\r\n\t<strong>alter database convert to physical standby<\/strong>\r\n\t<strong>ALTER DATABASE CONVERT TO PHYSICAL STANDBY (maa1)<\/strong>\r\n\tFlush standby redo logfile failed:1649\r\n\tClearing standby activation ID 723321957 (0x2b1d0465)\r\n\tThe primary database controlfile was created using the\r\n\t'MAXLOGFILES 192' clause.\r\n\tThere is space for up to 188 standby redo logfiles\r\n\tUse the following SQL commands on the standby database to create\r\n\tstandby redo logfiles that match the primary database:\r\n\tALTER DATABASE ADD STANDBY LOGFILE 'srl1.f' SIZE 52428800;\r\n\tALTER DATABASE ADD STANDBY LOGFILE 'srl2.f' SIZE 52428800;\r\n\tALTER DATABASE ADD STANDBY LOGFILE 'srl3.f' SIZE 52428800;\r\n\tALTER DATABASE ADD STANDBY LOGFILE 'srl4.f' SIZE 52428800;\r\n\tALTER DATABASE ADD STANDBY LOGFILE 'srl5.f' SIZE 52428800;\r\n\tWaiting for all non-current ORLs to be archived...\r\n\tAll non-current ORLs have been archived.\r\n\tClearing online redo logfile 1 +DATA\/maa\/onlinelog\/group_1.272.843488553\r\n\tClearing online log 1 of thread 1 sequence number 139\r\n\tClearing online redo logfile 1 complete\r\n\tClearing online redo logfile 2 +DATA\/maa\/onlinelog\/group_2.271.843488555\r\n\tClearing online log 2 of thread 1 sequence number 140\r\n\tClearing online redo logfile 2 complete\r\n\tClearing online redo logfile 3 +DATA\/maa\/onlinelog\/group_3.257.843489101\r\n\tClearing online log 3 of thread 2 sequence number 99\r\n\tClearing online redo logfile 3 complete\r\n\tClearing online redo logfile 4 +DATA\/maa\/onlinelog\/group_4.262.843489103\r\n\tClearing online log 4 of thread 2 sequence number 98\r\n\tClearing online redo logfile 4 complete\r\n\tCompleted: alter database convert to physical standby\r\n\tMon May 12 05:31:05 2014\r\n\t<strong>Shutting down instance (immediate)<\/strong>\r\n\tShutting down instance: further logons disabled\r\n\tStopping background process MMNL\r\n\tStopping background process MMON\r\n\tLicense high water mark = 6\r\n\talter database CLOSE NORMAL\r\n\tORA-1109 signalled during: alter database CLOSE NORMAL...\r\n\talter database DISMOUNT\r\n\tShutting down archive processes\r\n\tArchiving is disabled\r\n\t...\r\n\t...\r\n\tShutting down Data Guard Broker processes\r\n\tMon May 12 05:31:14 2014\r\n\tCompleted: Data Guard Broker shutdown\r\n\tNOTE: force a map free for map id 2\r\n\tMon May 12 05:31:15 2014\r\n\tARCH: Archival disabled due to shutdown: 1089\r\n\tShutting down archive processes\r\n\tArchiving is disabled\r\n\tMon May 12 05:31:15 2014\r\n\tStopping background process VKTM\r\n\t...\r\n\t...\r\n\t<strong>Instance shutdown complete<\/strong>\r\n\t<strong>Mon May 12 05:31:23 2014<\/strong>\r\n\t<strong>Starting ORACLE instance (normal)<\/strong>\r\n\t****************** Large Pages Information *****************\r\n\r\n\tTotal Shared Global Region in Large Pages = 0 KB (0%)\r\n\t...\r\n\t...\r\n\tStarting up:\r\n\tOracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production\r\n\tWith the Partitioning and Real Application Clusters options.\r\n\t...\r\n\t...\r\n\tDMON started with pid=30, OS id=4114\r\n\tMon May 12 05:31:31 2014\r\n\t<strong>alter database  mount<\/strong>\r\n\tThis instance was first to mount\r\n\tMon May 12 05:31:31 2014\r\n\tALTER SYSTEM SET local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.17.42.14)(PORT=1521))))' SCOPE=MEMORY SID='maa1';\r\n\tNOTE: Loaded library: \/opt\/oracle\/extapi\/64\/asm\/orcl\/1\/libasm.so\r\n\tNOTE: Loaded library: System\r\n\tSUCCESS: diskgroup DATA was mounted\r\n\tSUCCESS: diskgroup FRA was mounted\r\n\tNOTE: dependency between database maa and diskgroup resource ora.DATA.dg is established\r\n\tNOTE: dependency between database maa and diskgroup resource ora.FRA.dg is established\r\n\tMon May 12 05:31:37 2014\r\n\tARCH: STARTING ARCH PROCESSES\r\n\tNSS2 started with pid=33, OS id=4147\r\n\tMon May 12 05:31:37 2014\r\n\tARC0 started with pid=34, OS id=4149\r\n\tARC0: Archival started\r\n\t...\r\n\t...\t\r\n\tARC2: Becoming the 'no FAL' ARCH\r\n\tARC2: Becoming the 'no SRL' ARCH\r\n\tARC1: Becoming the heartbeat ARCH\r\n\tPhysical Standby Database mounted.\r\n\tLost write protection disabled\r\n\tARC1: Becoming the active heartbeat ARCH\r\n\tARC1: Becoming the active heartbeat ARCH\r\n\tARC3: Archival started\r\n\tARC0: STARTING ARCH PROCESSES COMPLETE\r\n\t<strong>Completed: alter database  mount<\/strong>\r\n\tMon May 12 05:31:43 2014\r\n\tStarting Data Guard Broker (DMON)\r\n\tMon May 12 05:31:43 2014\r\n\t...\r\n\t...\r\n\tUsing STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST\r\n\t<strong>Primary database is in MAXIMUM AVAILABILITY mode<\/strong>\r\n\t<strong>Changing standby controlfile to RESYNCHRONIZATION level<\/strong>\r\n\tStandby controlfile consistent with primary\r\n\tRFS[1]: Assigned to RFS process 4190\r\n\tRFS[1]: Selected log 8 for thread 2 sequence 4 dbid 722024964 branch 847284763\r\n\tMon May 12 05:31:59 2014\r\n\t<strong>Primary database is in MAXIMUM AVAILABILITY mode<\/strong>\r\n\t<strong>Standby controlfile consistent with primary<\/strong>\r\n\tStandby controlfile consistent with primary\r\n\tRFS[2]: Assigned to RFS process 4192\r\n\tRFS[2]: Selected log 5 for thread 1 sequence 4 dbid 722024964 branch 847284763\r\n\tALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='maa1';\r\n\tALTER SYSTEM SET log_archive_format='arch_%t_%s_%r.arc' SCOPE=SPFILE SID='maa1';\r\n\tALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET log_archive_max_processes=4 SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH SID='*';\r\n\tALTER SYSTEM SET db_file_name_convert='+DG01\/maastb','+DATA\/maa','+FRA\/maastb','+FRA\/maa' SCOPE=SPFILE;\r\n\tALTER SYSTEM SET log_file_name_convert='+DG01\/maastb','+DATA\/maa','+FRA\/maastb','+FRA\/maa' SCOPE=SPFILE;\r\n\tALTER SYSTEM SET fal_server='maastb' SCOPE=BOTH;\r\n\tALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  USING CURRENT LOGFILE\r\n\tAttempt to start background Managed Standby Recovery process (maa1)\r\n\tMon May 12 05:32:01 2014\r\n\tMRP0 started with pid=45, OS id=4198\r\n\tMRP0: Background Managed Standby Recovery process started (maa1)\r\n\tMon May 12 05:32:01 2014\r\n\tRFS[3]: Assigned to RFS process 4194\r\n\tRFS[3]: Selected log 9 for thread 2 sequence 3 dbid 722024964 branch 847284763\r\n\tMon May 12 05:32:01 2014\r\n\tRFS[4]: Assigned to RFS process 4196\r\n\tRFS[4]: Selected log 6 for thread 1 sequence 3 dbid 722024964 branch 847284763\r\n\t<strong>RFS[4]: New Archival REDO Branch(resetlogs_id): 847284763  Prior: 844762805<\/strong>\r\n\tRFS[4]: Archival Activation ID: 0x2b1de48e Current: 0x0\r\n\t<strong>RFS[4]: Effect of primary database OPEN RESETLOGS<\/strong>\r\n\tRFS[4]: Managed Standby Recovery process is active\r\n\tRFS[4]: Incarnation entry added for Branch(resetlogs_id): 847284763 (maa1)\r\n\tMon May 12 05:32:01 2014\r\n\tSetting recovery target incarnation to 3\r\n\tMon May 12 05:32:02 2014\r\n\tDeleted Oracle managed file +FRA\/maa\/flashback\/log_2.339.847184419\r\n\tMon May 12 05:32:02 2014\r\n\tArchived Log entry 632 added for thread 1 sequence 3 ID 0x2b1de48e dest 1:\r\n\tArchived Log entry 633 added for thread 2 sequence 3 ID 0x2b1de48e dest 1:\r\n\tMon May 12 05:32:04 2014\r\n\tRFS[5]: Assigned to RFS process 4212\r\n\t<strong>RFS[5]: Opened log for thread 2 sequence 99 dbid 722024964 branch 844762805<\/strong>\r\n\t<strong>RFS[4]: Opened log for thread 1 sequence 140 dbid 722024964 branch 844762805<\/strong>\r\n\tArchived Log entry 634 added for thread 2 sequence 99 rlc 844762805 ID 0x2b1d0465 dest 2:\r\n\t started logmerger process\r\n\tManaged Standby Recovery starting Real Time Apply\r\n\tRFS[3]: Opened log for thread 2 sequence 1 dbid 722024964 branch 847284763\r\n\tParallel Media Recovery started with 2 slaves\r\n\tMon May 12 05:32:07 2014\r\n\tMedia Recovery start incarnation depth : 1, target inc# : 3, irscn : 8878917\r\n\tArchived Log entry 635 added for thread 2 sequence 1 rlc 847284763 ID 0x2b1de48e dest 2:\r\n\tRFS[5]: Opened log for thread 2 sequence 2 dbid 722024964 branch 847284763\r\n\tWaiting for all non-current ORLs to be archived...\r\n\tAll non-current ORLs have been archived.\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_2_seq_99.603.847344725\r\n\t<strong>Identified End-Of-Redo (failover) for thread 2 sequence 99 at SCN 0x0.877b45<\/strong>\r\n\tArchived Log entry 636 added for thread 1 sequence 140 rlc 844762805 ID 0x2b1d0465 dest 2:\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_1_seq_140.605.847344725\r\n\tIdentified End-Of-Redo (failover) for thread 1 sequence 140 at SCN 0x0.877b45\r\n\tMon May 12 05:32:08 2014\r\n\t<strong>Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE  THROUGH ALL SWITCHOVER DISCONNECT  USING CURRENT LOGFILE<\/strong>\r\n\tResetting standby activation ID 723321957 (0x2b1d0465)\r\n\t<strong>Media Recovery End-Of-Redo indicator encountered<\/strong>\r\n\t<strong>Media Recovery Continuing<\/strong>\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_2_seq_1.592.847344727\r\n\tArchived Log entry 637 added for thread 1 sequence 4 ID 0x2b1de48e dest 1:\r\n\tMedia Recovery Waiting for thread 1 sequence 1\r\n\tFetching gap sequence in thread 1, gap sequence 1-2\r\n\tArchived Log entry 638 added for thread 2 sequence 2 rlc 847284763 ID 0x2b1de48e dest 2:\r\n\tMon May 12 05:32:10 2014\r\n\t<strong>Primary database is in MAXIMUM AVAILABILITY mode<\/strong>\r\n\tStandby controlfile consistent with primary\r\n\tStandby controlfile consistent with primary\r\n\tRFS[6]: Assigned to RFS process 4242\r\n\tRFS[6]: Selected log 5 for thread 1 sequence 5 dbid 722024964 branch 847284763\r\n\tMon May 12 05:32:11 2014\r\n\tRFS[7]: Assigned to RFS process 4234\r\n\tRFS[7]: Opened log for thread 1 sequence 1 dbid 722024964 branch 847284763\r\n\tMon May 12 05:32:11 2014\r\n\tRFS[8]: Assigned to RFS process 4238\r\n\tRFS[8]: Opened log for thread 1 sequence 2 dbid 722024964 branch 847284763\r\n\tArchived Log entry 639 added for thread 1 sequence 1 rlc 847284763 ID 0x2b1de48e dest 2:\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_1_seq_1.595.847344731\r\n\tMedia Recovery Waiting for thread 1 sequence 2 (in transit)\r\n\tMon May 12 05:32:14 2014\r\n\tArchived Log entry 640 added for thread 2 sequence 4 ID 0x2b1de48e dest 1:\r\n\tArchived Log entry 641 added for thread 1 sequence 2 rlc 847284763 ID 0x2b1de48e dest 2:\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_1_seq_2.593.847344731\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_2_seq_2.584.847344727\r\n\tMon May 12 05:32:15 2014\r\n\tPrimary database is in MAXIMUM AVAILABILITY mode\r\n\tStandby controlfile consistent with primary\r\n\tStandby controlfile consistent with primary\r\n\tRFS[9]: Assigned to RFS process 4250\r\n\tRFS[9]: Selected log 8 for thread 2 sequence 5 dbid 722024964 branch 847284763\r\n\tMon May 12 05:32:25 2014\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_1_seq_3.604.847344723\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_2_seq_3.339.847344723\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_2_seq_4.581.847344735\r\n\tMedia Recovery Log +FRA\/maa\/archivelog\/2014_05_12\/thread_1_seq_4.594.847344731\r\n\tMedia Recovery Waiting for thread 1 sequence 5 (in transit)\r\n\tRecovery of Online Redo Log: Thread 1 Group 5 Seq 5 Reading mem 0\r\n\t  Mem# 0: +DATA\/maa\/onlinelog\/group_5.263.843615365\r\n\t  Mem# 1: +FRA\/maa\/onlinelog\/group_5.289.843615367\r\n\tMedia Recovery Waiting for thread 2 sequence 5 (in transit)\r\n\tRecovery of Online Redo Log: Thread 2 Group 8 Seq 5 Reading mem 0\r\n\t  Mem# 0: +DATA\/maa\/onlinelog\/group_8.259.843615383\r\n\t  Mem# 1: +FRA\/maa\/onlinelog\/group_8.703.843615385\r\n\tMon May 12 05:33:16 2014\r\n\t<strong>Changing standby controlfile to MAXIMUM AVAILABILITY level<\/strong>\r\n\tRFS[6]: Selected log 6 for thread 1 sequence 6 dbid 722024964 branch 847284763\r\n\tMon May 12 05:33:16 2014\r\n\tDeleted Oracle managed file +FRA\/maa\/flashback\/log_3.259.843502613\r\n\tMon May 12 05:33:16 2014\r\n\tMedia Recovery Waiting for thread 1 sequence 6 (in transit)\r\n\tRecovery of Online Redo Log: Thread 1 Group 6 Seq 6 Reading mem 0\r\n\t  Mem# 0: +DATA\/maa\/onlinelog\/group_6.261.843615373\r\n\t  Mem# 1: +FRA\/maa\/onlinelog\/group_6.670.843615373\r\n\tArchived Log entry 642 added for thread 1 sequence 5 ID 0x2b1de48e dest 1:\r\n\tMon May 12 05:33:19 2014\r\n\tStandby controlfile consistent with primary\r\n\tRFS[9]: Selected log 9 for thread 2 sequence 6 dbid 722024964 branch 847284763\r\n\tMon May 12 05:33:19 2014\r\n\tArchived Log entry 643 added for thread 2 sequence 5 ID 0x2b1de48e dest 1:\r\n\tMedia Recovery Waiting for thread 2 sequence 6 (in transit)\r\n\tRecovery of Online Redo Log: Thread 2 Group 9 Seq 6 Reading mem 0\r\n\t  Mem# 0: +DATA\/maa\/onlinelog\/group_9.256.843615389\r\n\t  Mem# 1: +FRA\/maa\/onlinelog\/group_9.504.843615389\r\n<\/pre>\n<p style=\"text-align: justify;\">Fazendo uma an\u00e1lise detalhada n\u00f3s encontramos que o banco \u201cmaa\u201d sofreu um FLASHBACK para o SCN 8878905 e que foi conclu\u00eddo com sucesso. Ap\u00f3s, o banco foi convertido para PHYSICAL STANDBY e devido aos passos do procedimento ele foi fechado. Depois ele foi religado (automaticamente) e detectou que precisava de sincronia de archives com o seu primary (maastb). Ele detectou que ocorreu o End-Of-Redo e ap\u00f3s isso continuou aplicando os archives que ocorreram ap\u00f3s esse evento (via RFS &#8211; Media Recovery Continuing). Nesse caso, dependendo do tempo que seu antigo primary ficou \u201coff-line\u201d, a quantidade de archivelog necess\u00e1rio para replicar pode ser grande. Pode ocorrer inclusive a necessidade de recuperar do backup (do novo primary) os archives que foram apagados e necess\u00e1rios para fechar o gap existente entre os ambientes.<\/p>\n<p style=\"text-align: justify;\">Depois, o banco foi configurado para atuar como standby e usar o real-time apply (USING CURRENT LOGFILE). Aqui um detalhe, o Broker configura automaticamente o real-time apply se detectar que o nanco standby tem configurado os standbylog files. Observe que ele detectou a presen\u00e7a de uma nova incarna\u00e7\u00e3o devido ao RESETLOGS sofrido pelo flashback e pelo End-Of-Redo. Para finalizar, ao identificar que o primary opera em MAXIMUM AVAILABILITY ele sincroniza os archivelog e deixa tudo sincronizado.<\/p>\n<p style=\"text-align: justify;\"><strong>DETALHES<\/strong><\/p>\n<p style=\"text-align: justify;\">Se voc\u00ea notar todos os logs at\u00e9 aqui (principalmente os \u00faltimos) ir\u00e1 ver como eles se encaixam, todas estas informa\u00e7\u00f5es que aqui est\u00e3o apresentadas de forma serial acontecem em paralelo. O fluxo basicamente \u00e9 um comando reinstate detectado atrav\u00e9s que dgmgrl que \u00e9 comunicado ao Broker do primary e do standby. Durante o processo de reinstate o antigo primary sofre um flashback, \u00e9 reiniciado, sincronizado e configurado como novo standby. Como o banco primary est\u00e1 operando em MAXIMUM AVAILABILITY tudo fica sincronizado, primary e standby.<\/p>\n<p style=\"text-align: justify;\">Todos estes comandos que antes foram manuais (observe nos artigos de failover e de reinstate manual) agora foram realizados automaticamente pelo Broker. N\u00e3o precisamos detectar qual o SCN que ocorreu a troca de papeis, muito menos fazer o flashback e corrigir o CRS.<\/p>\n<p style=\"text-align: justify;\">Claro que tudo isso precisou de algumas configura\u00e7\u00f5es, voc\u00ea acha que o Broker iria conseguir conectar e reiniciar as inst\u00e2ncias sem o registro manual delas no listener? Lembra do <em>dbStaticCionnection<\/em> do Broker que configuramos no final do artigo anterior? Viu como alguns passos anteriores (que podem ter sido chatos) poupam algum tempo?<\/p>\n<p style=\"text-align: justify;\">Um detalhe ao religar outras inst\u00e2ncias do antigo primary. Ao subir ele ir\u00e1 detectar um \u201cORA-01153: an incompatible media recovery is active\u201d e \u201cORA-10458: standby database requires recovery\u201d, isso \u00e9 \u201cnormal\u201d e for\u00e7ar\u00e1 um shutdown abort da sua inst\u00e2ncia. Basta voc\u00ea religar a inst\u00e2ncia em modo mount para tudo voltar ao normal. Isso est\u00e1 ligado a um detalhe co CRS que explico no pr\u00f3ximo par\u00e1grafo.<\/p>\n<p style=\"text-align: justify;\">Como nem tudo s\u00e3o flores na vida de um DBA, voc\u00ea precisar\u00e1 ajustar o CRS das inst\u00e2ncias. O Broker ajusta o CRS do ambiente, mas em partes. Ele \u201cesquece\u201d de trocar o modo de abertuda das bases, assim o antigo primary e novo standby estar\u00e1 definido para iniciar em modo open e o novo primary estar\u00e1 em modo mount (por ser o antigo standby). Observe abaixo isso e a sua corre\u00e7\u00e3o:<\/p>\n<pre>No antigo primary e novo standby:\r\n\t[oracle@rac11pri02 ~]$ <strong>srvctl config database -d maa -v<\/strong>\r\n\tDatabase unique name: maa\r\n\tDatabase name: maa\r\n\tOracle home: \/u01\/app\/oracle\/product\/11.2.0.3\/db_1\r\n\tOracle user: oracle\r\n\tSpfile: +DATA\/maa\/spfilemaa.ora\r\n\tDomain:\r\n\t<strong>Start options: open<\/strong>\r\n\tStop options: immediate\r\n\t<strong>Database role: PHYSICAL_STANDBY<\/strong>\r\n\tManagement policy: AUTOMATIC\r\n\tServer pools: maa\r\n\tDatabase instances: maa1,maa2\r\n\tDisk Groups: DATA,FRA\r\n\tMount point paths:\r\n\tServices:\r\n\tType: RAC\r\n\tDatabase is administrator managed\r\n\t[oracle@rac11pri02 ~]$\r\n\t[oracle@rac11pri02 ~]$\r\n\t[oracle@rac11pri02 ~]$\r\n\t[oracle@rac11pri02 ~]$ <strong>srvctl modify database -d maa -s MOUNT<\/strong>\r\n\t[oracle@rac11pri02 ~]$\r\n\t[oracle@rac11pri02 ~]$\r\n\t[oracle@rac11pri02 ~]$\r\n\t[oracle@rac11pri02 ~]$ <strong>srvctl config database -d maa -v<\/strong>\r\n\tDatabase unique name: maa\r\n\tDatabase name: maa\r\n\tOracle home: \/u01\/app\/oracle\/product\/11.2.0.3\/db_1\r\n\tOracle user: oracle\r\n\tSpfile: +DATA\/maa\/spfilemaa.ora\r\n\tDomain:\r\n\t<strong>Start options: mount<\/strong>\r\n\tStop options: immediate\r\n\t<strong>Database role: PHYSICAL_STANDBY<\/strong>\r\n\tManagement policy: AUTOMATIC\r\n\tServer pools: maa\r\n\tDatabase instances: maa1,maa2\r\n\tDisk Groups: DATA,FRA\r\n\tMount point paths:\r\n\tServices:\r\n\tType: RAC\r\n\tDatabase is administrator managed\r\n\t[oracle@rac11pri02 ~]$\r\n<\/pre>\n<p style=\"text-align: justify;\">No novo primary (antigo standby):<\/p>\n<pre>[oracle@rac11stb02 ~]$ <strong>srvctl config database -d maastb -v<\/strong>\r\n\tDatabase unique name: maastb\r\n\tDatabase name:\r\n\tOracle home: \/u01\/app\/oracle\/product\/11.2.0.3\/db_1\r\n\tOracle user: oracle\r\n\tSpfile:\r\n\tDomain:\r\n\t<strong>Start options: mount<\/strong>\r\n\tStop options: immediate\r\n\t<strong>Database role: PRIMARY<\/strong>\r\n\tManagement policy: AUTOMATIC\r\n\tServer pools: maastb\r\n\tDatabase instances: maastb1,maastb2\r\n\tDisk Groups: DG01,FRA\r\n\tMount point paths:\r\n\tServices:\r\n\tType: RAC\r\n\tDatabase is administrator managed\r\n\t[oracle@rac11stb02 ~]$\r\n\t[oracle@rac11stb02 ~]$\r\n\t[oracle@rac11stb02 ~]$<strong> srvctl modify database -d maastb -s OPEN<\/strong>\r\n\t[oracle@rac11stb02 ~]$\r\n\t[oracle@rac11stb02 ~]$\r\n\t[oracle@rac11stb02 ~]$ <strong>srvctl config database -d maastb -v<\/strong>\r\n\tDatabase unique name: maastb\r\n\tDatabase name:\r\n\tOracle home: \/u01\/app\/oracle\/product\/11.2.0.3\/db_1\r\n\tOracle user: oracle\r\n\tSpfile:\r\n\tDomain:\r\n\t<strong>Start options: open<\/strong>\r\n\tStop options: immediate\r\n\t<strong>Database role: PRIMARY<\/strong>\r\n\tManagement policy: AUTOMATIC\r\n\tServer pools: maastb\r\n\tDatabase instances: maastb1,maastb2\r\n\tDisk Groups: DG01,FRA\r\n\tMount point paths:\r\n\tServices:\r\n\tType: RAC\r\n\tDatabase is administrator managed\r\n\t[oracle@rac11stb02 ~]$\r\n<\/pre>\n<p style=\"text-align: justify;\">Se voc\u00ea configurar o CRS antes de ligar as outras inst\u00e2ncias do standby, n\u00e3o sofrer\u00e1 dos ORA-XXXX listados antes.<\/p>\n<p style=\"text-align: justify;\">AMBIENTE FINAL<\/p>\n<p style=\"text-align: justify;\">Chegamos a um ambiente em que temos um DG com um banco primary chamado de maastb que come\u00e7ou a atuar assim ap\u00f3s failover do seu antigo primary. O antigo primary, banco maa, sofreu failover e um posterior reinstate para ser reintegrado ao ambiente como physical standby. Observe o ambiente final:<\/p>\n<pre>DGMGRL&gt; SHOW CONFIGURATION;\r\n\r\nConfiguration - dgrac\r\n\r\n  Protection Mode: MaxAvailability\r\n  Databases:\r\n\tmaastb - Primary database\r\n\tmaa    - Physical standby database\r\n\r\nFast-Start Failover: DISABLED\r\n\r\nConfiguration Status:\r\nSUCCESS\r\n\r\nDGMGRL&gt;\r\n<\/pre>\n<p style=\"text-align: justify;\">Todos os passos que seguimos at\u00e9 agora permitiram fazer isso atrav\u00e9s do Broker. O uso deste, comparado com o modo \u201cmanual\u201d, nos poupou e deu menos preocupa\u00e7\u00f5es. Ainda n\u00e3o estamos em um ambiente ideal, precisamos configurar o fast-start failover para ter um ambiente confort\u00e1vel e auto gerenci\u00e1vel.<\/p>\n<p style=\"text-align: justify;\">No fim recomendo ligar as outras inst\u00e2ncia do antigo primary e fazer um backup do ambiente.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neste artigo vamos ver como fazer um failover e reinstate em um ambiente que temos o Broker configurado. Se voc\u00ea est\u00e1 acompanhando a s\u00e9rie de artigos at\u00e9 ver\u00e1 que j\u00e1 passamos por failover manual, resintate, switchover (todos manuais e sem Broker) e no \u00faltimo n\u00f3s configuramos o Broker. De qualquer forma, ainda n\u00e3o chegamos a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[30,50,41,29,6,47,5],"tags":[],"class_list":["post-162","post","type-post","status-publish","format-standard","hentry","category-banco-de-dados","category-broker","category-data-guard","category-database","category-exadata","category-failover","category-oracle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker<\/title>\n<meta name=\"description\" content=\"Realizando o Failover com o Broker em um ambiente Oracle com Maximum Availability Architecture (MAA), Data Guard (DG) e RAC. Dicas, detalhes e truques\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker\" \/>\n<meta property=\"og:description\" content=\"Realizando o Failover com o Broker em um ambiente Oracle com Maximum Availability Architecture (MAA), Data Guard (DG) e RAC. Dicas, detalhes e truques\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/\" \/>\n<meta property=\"og:site_name\" content=\"Fernando Simon\" \/>\n<meta property=\"article:published_time\" content=\"2014-09-07T15:32:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-01-26T02:20:17+00:00\" \/>\n<meta name=\"author\" content=\"Simon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Simon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"43 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/\"},\"author\":{\"name\":\"Simon\",\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/386da956604bca0d5be5dd52210c1dd9\"},\"headline\":\"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker\",\"datePublished\":\"2014-09-07T15:32:55+00:00\",\"dateModified\":\"2015-01-26T02:20:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/\"},\"wordCount\":2483,\"commentCount\":2,\"articleSection\":[\"Banco de Dados\",\"Broker\",\"Data Guard\",\"Database\",\"Exadata\",\"Failover\",\"Oracle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/\",\"url\":\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/\",\"name\":\"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker\",\"isPartOf\":{\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/#website\"},\"datePublished\":\"2014-09-07T15:32:55+00:00\",\"dateModified\":\"2015-01-26T02:20:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/386da956604bca0d5be5dd52210c1dd9\"},\"description\":\"Realizando o Failover com o Broker em um ambiente Oracle com Maximum Availability Architecture (MAA), Data Guard (DG) e RAC. Dicas, detalhes e truques\",\"breadcrumb\":{\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.fernandosimon.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/#website\",\"url\":\"https:\/\/www.fernandosimon.com\/blog\/\",\"name\":\"Fernando Simon\",\"description\":\"Have you hugged your backup today?\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.fernandosimon.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/386da956604bca0d5be5dd52210c1dd9\",\"name\":\"Simon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a3dbc48de62fffb1829befb4a588d789ec6dc5e05977afabb3407a5f37a16482?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a3dbc48de62fffb1829befb4a588d789ec6dc5e05977afabb3407a5f37a16482?s=96&d=mm&r=g\",\"caption\":\"Simon\"},\"sameAs\":[\"http:\/\/www.fernandosimon.com\"],\"url\":\"https:\/\/www.fernandosimon.com\/blog\/author\/simon\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker","description":"Realizando o Failover com o Broker em um ambiente Oracle com Maximum Availability Architecture (MAA), Data Guard (DG) e RAC. Dicas, detalhes e truques","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/","og_locale":"en_US","og_type":"article","og_title":"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker","og_description":"Realizando o Failover com o Broker em um ambiente Oracle com Maximum Availability Architecture (MAA), Data Guard (DG) e RAC. Dicas, detalhes e truques","og_url":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/","og_site_name":"Fernando Simon","article_published_time":"2014-09-07T15:32:55+00:00","article_modified_time":"2015-01-26T02:20:17+00:00","author":"Simon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Simon","Est. reading time":"43 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#article","isPartOf":{"@id":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/"},"author":{"name":"Simon","@id":"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/386da956604bca0d5be5dd52210c1dd9"},"headline":"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker","datePublished":"2014-09-07T15:32:55+00:00","dateModified":"2015-01-26T02:20:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/"},"wordCount":2483,"commentCount":2,"articleSection":["Banco de Dados","Broker","Data Guard","Database","Exadata","Failover","Oracle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/","url":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/","name":"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker","isPartOf":{"@id":"https:\/\/www.fernandosimon.com\/blog\/#website"},"datePublished":"2014-09-07T15:32:55+00:00","dateModified":"2015-01-26T02:20:17+00:00","author":{"@id":"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/386da956604bca0d5be5dd52210c1dd9"},"description":"Realizando o Failover com o Broker em um ambiente Oracle com Maximum Availability Architecture (MAA), Data Guard (DG) e RAC. Dicas, detalhes e truques","breadcrumb":{"@id":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.fernandosimon.com\/blog\/oracle-e-maa-artigo-vi-failover-broker\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fernandosimon.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Oracle e MAA \u2013 Artigo VI \u2013 Failover Broker"}]},{"@type":"WebSite","@id":"https:\/\/www.fernandosimon.com\/blog\/#website","url":"https:\/\/www.fernandosimon.com\/blog\/","name":"Fernando Simon","description":"Have you hugged your backup today?","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.fernandosimon.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/386da956604bca0d5be5dd52210c1dd9","name":"Simon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fernandosimon.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a3dbc48de62fffb1829befb4a588d789ec6dc5e05977afabb3407a5f37a16482?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a3dbc48de62fffb1829befb4a588d789ec6dc5e05977afabb3407a5f37a16482?s=96&d=mm&r=g","caption":"Simon"},"sameAs":["http:\/\/www.fernandosimon.com"],"url":"https:\/\/www.fernandosimon.com\/blog\/author\/simon\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5ofTp-2C","_links":{"self":[{"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":0,"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fernandosimon.com\/blog\/wp-json\/wp\/v2\/tags?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}