Blog do Marcio Portes: Broker, Dataguard e Real-Time Apply - 10g

Page 1 of 10

Broker, Dataguard e Real-Time Apply - 10g
Este é o complemento do artigo anterior, onde discutimos como montar um Data Guard usando o RMAN. A seguir, farei da mesma forma, ou seja, não haverá explicações específicas para os comandos, já que o melhor source para isso é o próprio manual. Então começamos com as instâncias criadas no artigo anterior (n1dg e n2dg), a princípio definidas como n1dg = nó primário e n2dg = nó standby físico. Vamos então aos copies e pastes. Garantia que não havia nenhuma instance viva.

[marcio@anakin ~]$ ps -ef | grep pmon_ marcio 6175 6044 0 00:07 pts/1 00:00:00 grep pmon_ [marcio@anakin ~]$ [marcio@anakin ~]$ [marcio@anakin ~]$ su - oracle Password: [oracle@anakin ~]$ [oracle@anakin ~]$ [oracle@anakin ~]$ cd /oracle/admin/ [oracle@anakin admin]$ ll -tr total 20 drwxr-x--- 6 oracle dba 4096 Feb 15 14:22 +ASM drwxr-x--- 8 oracle dba 4096 Feb 15 14:28 lx10g drwxr-xr-x 7 ora92 dba 4096 Mar 27 16:48 lx92 drwxr-x--- 9 oracle dba 4096 Jun 3 23:06 n1dg drwxr-xr-x 9 oracle dba 4096 Jun 3 23:58 n2dg [oracle@anakin admin]$

Levantando nó primário.

[oracle@anakin admin]$ export ORACLE_SID=n1dg [oracle@anakin admin]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.3.0 - Production on Tue Jun 12 00:08:17 2007 Copyright (c) 1982, 2006, Oracle. All Rights Reserved. Connected to an idle instance. idle> startup ORACLE instance started. Total System Global Area 608174080 bytes Fixed Size 1263200 bytes Variable Size 205523360 bytes Database Buffers 394264576 bytes Redo Buffers 7122944 bytes Database mounted. Database opened. idle>

Checando os parâmetros pré-configurados no artigo anterior.

idle> show parameter archive NAME -----------------------------------archive_lag_target log_archive_config log_archive_dest log_archive_dest_1 log_archive_dest_10 log_archive_dest_2 log_archive_dest_3 log_archive_dest_4 log_archive_dest_5 log_archive_dest_6 log_archive_dest_7 log_archive_dest_8 log_archive_dest_9 log_archive_dest_state_1 log_archive_dest_state_10 log_archive_dest_state_2 log_archive_dest_state_3 log_archive_dest_state_4 log_archive_dest_state_5 log_archive_dest_state_6 log_archive_dest_state_7 log_archive_dest_state_8 log_archive_dest_state_9 log_archive_duplex_dest log_archive_format log_archive_local_first log_archive_max_processes log_archive_min_succeed_dest log_archive_start log_archive_trace remote_archive_enable standby_archive_dest idle> show parameter db_name NAME -----------------------------------db_name idle> show parameter db_unique_name NAME

TYPE ----------integer string string string string string string string string string string string string string string string string string string string string string string string string boolean integer integer boolean integer string string

VALUE ----------------------------0 DG_CONFIG=(n1, n2) LOCATION=/backup/n1/arch

enable enable enable enable enable enable enable enable enable enable %t_%s_%r.dbf TRUE 2 1 FALSE 0 true /backup/n1/arch

TYPE VALUE ----------- --------------------------string N1DG TYPE VALUE

http://mportes.blogspot.com/2007/06/broker-dataguard-e-real-time-apply-10g.html

7/8/2010

html 7/8/2010 . ou seja. Por exemplo. poderíamos deixar de configurar o DEST_2 e criar somente os standby logfiles.2. Total System Global Area 608174080 bytes Fixed Size 1263200 bytes Variable Size 167774624 bytes Database Buffers 432013312 bytes Redo Buffers 7122944 bytes Database mounted.--------------------------string n1 TYPE ----------string string VALUE --------------------------N1 N2 Page 2 of 10 No nó primário./init. Essa configuração é importante em emergências de rede.ora ORACLE instance started. Da mesma forma. File created. idle> startup mount pfile=. é importante para aplicação via archives. etc.3. idle> startup mount ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/oracle/10g/dbs/initn2dg. Dataguard e Real-Time Apply . Então vamos levantar a instância com o pfile já usado anteriormente e a partir dele criar o spfile.2.ora'.0. All Rights Reserved. 4 / System altered. OLAP and Data Mining options [oracle@anakin admin]$ [oracle@anakin admin]$ [oracle@anakin admin]$ echo $ORACLE_SID n1dg [oracle@anakin admin]$ export ORACLE_SID=n2dg Passo 2: Configurar o standby (n2dg) .Production on Tue Jun 12 00:17:43 2007 Copyright (c) 1982.Production on Tue Jun 12 00:17:21 2007 Copyright (c) 1982.PRIMARY_ROLE) 3 DB_UNIQUE_NAME=n2'.----------.Blog do Marcio Portes: Broker.0. [oracle@anakin admin]$ cd n2dg/scripts/ [oracle@anakin scripts]$ ll -tr total 8 -rw-r--r-. idle> show parameter db_name http://mportes. idle> alter system set LOG_ARCHIVE_DEST_2='SERVICE=n2 2 VALID_FOR=(ONLINE_LOGFILES. Oracle.1 oracle dba 482 Jun 3 23:57 n2dg.0.10g -----------------------------------db_unique_name idle> show parameter fal NAME -----------------------------------fal_client fal_server idle> ----------. [oracle@anakin admin]$ sqlplus / as sysdba SQL*Plus: Release 10. setar o DEST_1 com o novo parâmetro VALID_FOR Dataguard na versão 10g juntamente com o db_unique_name.Não esquecer que a parte de rede foi previamente definida no artigo anterior.1 oracle dba 646 Jun 4 00:04 init. Connected to an idle instance. Nessa configuração. idle> !pwd /oracle/admin/n2dg/scripts idle> create spfile from pfile='/oracle/admin/n2dg/scripts/init. Total System Global Area 608174080 bytes Fixed Size 1263200 bytes Variable Size 167774624 bytes Database Buffers 432013312 bytes Redo Buffers 7122944 bytes Database mounted. o erro acima aconteceu porque eu esqueci de criar o spfile no artigo anterior. Connected to an idle instance.0 .2. 2006. idle> show parameter LOG_ARCHIVE_MAX_PROCESSES NAME TYPE VALUE -----------------------------------.3.0 .com/2007/06/broker-dataguard-e-real-time-apply-10g.blogspot. porém desta vez vamos configurar o DEST_2.ALL_ROLES) 3 DB_UNIQUE_NAME=n1' 4 / System altered.0 .ora' idle> exit Disconnected Acho interessante deixar os problemas que tive durante a configuração.ora [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10. Oracle. 2006. porque faremos real-time apply. idle> startup mount force ORACLE instance started.sh -rw-r--r-.-------------------log_archive_max_processes integer 2 idle> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10. onde será entregue o archive para o standby. idle> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/backup/n1/arch 2 VALID_FOR=(ALL_LOGFILES.3. All Rights Reserved. porém não obrigatório para nosso exemplo.Production With the Partitioning.

System altered. idle> alter system set log_archive_config='DG_CONFIG=(n1.------------------------standby_archive_dest string ?/dbs/arch idle> alter system set STANDBY_ARCHIVE_DEST='/backup/n2/arch'. All Rights Reserved.3.Production With the Partitioning.------------.10g Page 3 of 10 NAME -----------------------------------db_name idle> show parameter db_unique_name NAME -----------------------------------db_unique_name TYPE VALUE ----------. idle> ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 ('/backup/n2/n2dg/srl03.------------1 1 0 52428800 1 NO CURRENT 485605 3 1 0 52428800 1 YES UNUSED 456954 2 1 0 52428800 1 YES UNUSED 0 3 rows selected.------------.--1 1 2 52428800 1 NO 3 1 1 52428800 1 YES 2 1 0 52428800 1 YES 3 rows selected.------------. sys:N1DG> alter system switch logfile. System altered. Database altered. System altered.log') SIZE 50M. idle> alter system set fal_client=n2. GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# ------------.log') SIZE 50M. idle> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 ('/backup/n2/n2dg/srl02. n2)'.2. idle> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.------------.0.------------. Database altered.html 7/8/2010 .PRIMARY_ROLE) 3 DB_UNIQUE_NAME=n1' 4 / System altered.3.Production on Tue Jun 12 00:28:15 2007 Copyright (c) 1982. porque faremos a aplicação das modificações através dos standby lofiles. sys:N1DG> select * from v$log. idle> select * from v$log. Database altered. Connected to: Oracle Database 10g Enterprise Edition Release 10. Database altered. FIRST_TIM --------03-JUN-07 03-JUN-07 FIRST_TIME ------------------05/06/2007 00:00:55 12/06/2007 00:08:28 09/06/2007 19:53:50 http://mportes. idle> select * from v$log. GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC ------------. Database altered.blogspot. Server do standby é o nó principal (N1) e client é o (N2) o inverso do nó primário.------------.--------CURRENT 485605 03-JUN-07 INACTIVE 456954 03-JUN-07 UNUSED 0 Os próximos passos são a chave para o Real-Time Apply.0 .2. idle> alter system set LOG_ARCHIVE_DEST_2='SERVICE=n1 2 VALID_FOR=(ONLINE_LOGFILES.2. idle> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/backup/n2/arch 2 VALID_FOR=(ALL_LOGFILES.------------. System altered. OLAP and Data Mining options [oracle@anakin scripts]$ export ORACLE_SID=n1dg [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10. Database altered.log') SIZE 50M.Blog do Marcio Portes: Broker.com/2007/06/broker-dataguard-e-real-time-apply-10g.------------------------string n2 Hora das modificações do standby idle> show parameter STANDBY_ARCHIVE_DEST NAME TYPE VALUE -----------------------------------. sys:N1DG> alter system switch logfile. idle> ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 ('/backup/n2/n2dg/srl01.--. STATUS FIRST_CHANGE# FIRST_TIM ---------------. GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# ------------. System altered.0. sys:N1DG> ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 ('/backup/n1/n1dg/srl03.log') SIZE 50M.------------. idle> alter system set fal_server=n1.--.0 .---------------.------------1 1 5 52428800 1 YES INACTIVE 528846 3 1 7 52428800 1 NO CURRENT 602414 2 1 6 52428800 1 YES INACTIVE 574349 3 rows selected.log') SIZE 50M. sys:N1DG> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 ('/backup/n1/n1dg/srl02.log') SIZE 50M.---------------. OLAP and Data Mining options sys:N1DG> ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 ('/backup/n1/n1dg/srl01.Production With the Partitioning. Database altered. Oracle. Dataguard e Real-Time Apply .------------.------------------------string n1dg TYPE VALUE ----------.0 .------------.ALL_ROLES) 3 DB_UNIQUE_NAME=n2' 4 / System altered.------------. Há necessidade criar tanto no physical standby como no primário.------------.----------.------------. idle> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT.0. System altered. 2006.3.

3. sys:N1DG> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10. porque o broker se conecta nos nós e faz shutdown e startup quando necessário. OLAP and Data Mining options [oracle@anakin scripts]$ export ORACLE_SID=n2dg [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10.Production With the Partitioning. 2006.3.0 .0 . Connected to: Oracle Database 10g Enterprise Edition Release 10. nunca mais vai achar difícil fazer switchover.------------. nesse ponto vejo qual foi o problema consultando o código de erro online.Production on Tue Jun 12 00:30:24 2007 Copyright (c) 1982. Agora entra a parte da configuração do Data Guard Broker através do parâmetro DG_BROKER_START.2.0.--. DGMGRL> exit Importante o erro acima.2.------------.3. GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS ------------.0 . GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS ------------.0 . System altered.3.0.com/2007/06/broker-dataguard-e-real-time-apply-10g.2. (Obs: Depois que voce conhece o broker.2. não esquecer de mudar para TRUE em todos os nós que serão controlados pelo BROKER.----------.------------. 2006.3.dat dg_broker_config_file2 string /oracle/10g/dbs/dr2n1. All rights reserved. OLAP and Data Mining options idle> alter system set dg_broker_start=true.0 . Dataguard e Real-Time Apply . Oracle. type "help" for information. OLAP and Data Mining options sys:N1DG> show parameter dg NAME TYPE VALUE -----------------------------------. System altered. agora que os serviços do Broker estão no ar. All Rights Reserved. sys:N1DG> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10. nada de aplicação de redos ainda.3. 2005. Connected to: Oracle Database 10g Enterprise Edition Release 10.0.Production Copyright (c) 2000. Configuration "mportes_dg" created with primary database "n1" DGMGRL> ADD DATABASE n2 AS CONNECT IDENTIFIER IS n2 MAINTAINED AS PHYSICAL.Production With the Partitioning.Production With the Partitioning.0.blogspot.3. isso facilita na manutenção.2.0. Neste ponto não esqueça de ter criado os arquivos de senha e colocado a mesma senha do sys para todos os nós.------------. failover ou qualquer outra manutenção no seu dataguard).0.---------------1 1 8 52428800 1 NO ACTIVE 3 1 7 52428800 1 NO ACTIVE 2 1 9 52428800 1 NO CURRENT 3 rows selected.Production With the Partitioning.0.Production on Tue Jun 12 00:30:48 2007 Copyright (c) 1982. Welcome to DGMGRL. note que o seu standby já está montado. vamos ao client para criar a configuração do dataguard.0 . 2006. Oracle. OLAP and Data Mining options [oracle@anakin scripts]$ export ORACLE_SID=n2dg [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10.Production on Tue Jun 12 00:29:55 2007 Copyright (c) 1982. http://mportes. Connected to: Oracle Database 10g Enterprise Edition Release 10.0. DGMGRL> connect sys/oracle Connected.3. All Rights Reserved.0.2.------------.html 7/8/2010 .2.---------------1 1 0 52428800 1 NO CURRENT 3 1 0 52428800 1 YES UNUSED 2 1 0 52428800 1 YES UNUSED 3 rows selected. DGMGRL> DGMGRL> create configuration mportes_dg as > primary database is n1 > connect identifier is n1. portanto o broker irá herdar a maioria de suas configurações quando o database for adicionado.10g Page 4 of 10 sys:N1DG> select * from v$log.dat dg_broker_start boolean FALSE sys:N1DG> alter system set dg_broker_start=true.0 .3.------------.Production With the Partitioning.0. Oracle.0 .-------------------------------------------------dg_broker_config_file1 string /oracle/10g/dbs/dr1n1.2.Production With the Partitioning. Error: ORA-16796: one or more properties could not be imported from the database Failed.0 .Production With the Partitioning. OLAP and Data Mining options [oracle@anakin scripts]$ export ORACLE_SID=n1dg [oracle@anakin scripts]$ Ok. idle> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.------------.Blog do Marcio Portes: Broker. idle> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10. Oracle.2.0 . OLAP and Data Mining options FIRST_CHANGE# ------------604660 602414 604662 FIRST_TIME ------------------12/06/2007 00:29:30 12/06/2007 00:08:28 12/06/2007 00:29:32 FIRST_CHANGE# ------------485605 456954 0 FIRST_TIME ------------------03/06/2007 23:23:05 03/06/2007 23:10:55 Como notado acima. OLAP and Data Mining options idle> select * from v$log.------------.--.3.2. [oracle@anakin scripts]$ dgmgrl DGMGRL for Linux: Version 10.0 .2.0. All Rights Reserved.3. [oracle@anakin scripts]$ export ORACLE_SID=n1dg [oracle@anakin scripts]$ [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10.

3. DGMGRL> ADD DATABASE n2 AS CONNECT IDENTIFIER IS n2 MAINTAINED AS PHYSICAL. has 1 handler(s) for this service. status UNKNOWN.blogspot.0 . Starting /oracle/10g/bin/tnslsnr: please wait. [oracle@anakin scripts]$ tnsping n2 TNS Ping Utility for Linux: Version 10.2.2.mportes.0 .0 . [oracle@anakin scripts]$ lsnrctl start LSNRCTL for Linux: Version 10. Service "PLSExtProc" has 1 instance(s). Primeira coisa que vem a cabeça é testar a conectividade entre os servidores. porém em estado disable. has 1 handler(s) for this service.0..Production Start Date 12-JUN-2007 00:32:25 Uptime 0 days 0 hr. "one or more properties could not be imported from the database" // *Cause: The broker was unable to import property values for the database // being added to the broker configuration... Instance "n2dg".log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=anakin.Physical standby database Current status for "mportes_dg": DISABLED http://mportes. Oracle. então temos nossa configuração de dataguard criada. or // . Instance "n1dg".ora Log messages written to /oracle/10g/network/log/listener.Primary database n2 . Dataguard e Real-Time Apply . Instance "PLSExtProc". Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = anakin. 0 min. The command completed successfully Vamos tentar de novo! [oracle@anakin scripts]$ dgmgrl DGMGRL for Linux: Version 10.. 2006. has 1 handler(s) for this service.3.. has 1 handler(s) for this service.. All rights reserved.com/2007/06/broker-dataguard-e-real-time-apply-10g. Oracle.3. 2006. (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=anakin. type "help" for information..the net-service-name specified in DGMGRL's CREATE CONFIGURATION // or ADD DATABASE command is not one that provides access to the // database being added. Service "n2_DGMGRL" has 1 instance(s). Welcome to DGMGRL.Blog do Marcio Portes: Broker. 2005. Instance "lx10g".3.0. Database "n2" added Agora sim. // *Action: Remove the database from the configuration using the REMOVE // CONFIGURATION or REMOVE DATABASE command.. Make sure that the // database to be added has at least one instance running and that the // net-service-name provides access to the running instance..0 .Production Copyright (c) 2000.local)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=anakin. Then // reissue the CREATE CONFIGURATION or ADD DATABASE command.ora Listener Log File /oracle/10g/network/log/listener.local)(PORT=1521))) STATUS of the LISTENER -----------------------Alias LISTENER Version TNSLSNR for Linux: Version 10.mportes.0 .0.3. All rights reserved.local)(PORT=1521))) Services Summary.0. 0000..Production System parameter file is /oracle/10g/network/admin/listener.html 7/8/2010 ..log Listening Endpoints Summary.Production on 12-JUN-2007 00:32:25 Copyright (c) 1991.2.0. status UNKNOWN. O comando show configuration mostra o status da sua configuração..Production on 12-JUN-2007 00:32:20 Copyright (c) 1997.. DGMGRL> show configuration Configuration Name: mportes_dg Enabled: NO Protection Mode: MaxPerformance Fast-Start Failover: DISABLED Databases: n1 .10g Page 5 of 10 [oracle@anakin scripts]$ oerr ora 16796 16796.mportes.mportes. This error indicates: // . Service "n1_DGMGRL" has 1 instance(s).local)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SI TNS-12541: TNS:no listener Bingo! Esqueci de subir o listener. Oracle. Service "lx10g" has 1 instance(s). status UNKNOWN. status UNKNOWN.. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oracle/10g/network/admin/listener.2. TNSLSNR for Linux: Version 10.there are no instances running for the database being added. DGMGRL> connect sys/oracle Connected. All rights reserved.2.

DGMGRL> alter configuration set protection mode as maxavailability..Primary database n2 .10g Habilite a configuração. Ele fará várias modificações e no momento que voce habilita. database. sem perda de dados com máximo de performance (possível). DGMGRL> show database verbose n1 Database Name: n1 Role: PRIMARY Enabled: YES Intended State: ONLINE Instance(s): n1dg Properties: InitialConnectIdentifier = 'n1' LogXptMode = 'ASYNC' Dependency = '' DelayMins = '0' Binding = 'OPTIONAL' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '180' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '2' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '' LogFileNameConvert = '' FastStartFailoverTarget = '' StatusReport = '(monitor)' InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' SendQEntries = '(monitor)' LogXptStatus = '(monitor)' RecvQEntries = '(monitor)' HostName = 'anakin. eu quero que seja MAXAVAILABILITY.blogspot. DGMGRL> show configuration verbose Configuration Name: mportes_dg Enabled: YES Protection Mode: MaxPerformance Fast-Start Failover: DISABLED Databases: n1 .Blog do Marcio Portes: Broker. DGMGRL> help show Display information about a configuration. Faltou alterar o LogXptMode de ASYNC para SYNC.. Os helps abaixo ajudam muito na medida em que não é frequente o uso do client do broker e ninguem aqui está participando do campionato mundial de "saber tudo de cabeça". SHOW INSTANCE [VERBOSE] [] [ON DATABASE ]. Page 6 of 10 DGMGRL> enable configuration Enabled. Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode Failed.Physical standby database Current status for "mportes_dg": Warning: ORA-16610: command 'ENABLE DATABASE n2' in progress E tenha certa paciência! :-) Aqui é interessante uma dica: abra duas sessões extras e vá ao diretório do alert e faça um "tail -f alert_. Neste ponto faremos a configuração para que o protection mode seja maxavailability. Ok.com/2007/06/broker-dataguard-e-real-time-apply-10g. Dataguard e Real-Time Apply ." e veja o broker em ação.Primary database n2 . ainda falta configurar o modo de aplicação.. or instance Syntax: SHOW CONFIGURATION..mportes.Physical standby database Current status for "mportes_dg": SUCCESS Perfeito.html 7/8/2010 . SHOW DATABASE [VERBOSE] []. ou seja. ok.local' SidName = 'n1dg' http://mportes. ele começa a aplicar os archives e sincronizar os redologs. DGMGRL> show configuration verbose Configuration Name: mportes_dg Enabled: YES Protection Mode: MaxPerformance Fast-Start Failover: DISABLED Databases: n1 .

2005. EDIT DATABASE RENAME TO . EDIT INSTANCE [ON DATABASE ] SET PROPERTY = .Physical standby database Current status for "mportes_dg": SUCCESS DGMGRL> exit Uma vez habilitada a configuração.10g LocalListenerAddress = '(ADDRESS=(PROTOCOL=tcp)(HOST=anakin.Production With the Partitioning.Blog do Marcio Portes: Broker.3.------------.0 . database.0 . EDIT DATABASE SET PROPERTY = .2.------------------1 1 14 52428800 1 YES CLEARING_CURRENT 604871 12/06/2007 00:38:10 3 1 14 52428800 1 YES CLEARING 604871 12/06/2007 00:38:10 2 1 13 52428800 1 YES CLEARING 604838 12/06/2007 00:37:00 3 rows selected.Production on Tue Jun 12 00:38:37 2007 Copyright (c) 1982. [oracle@anakin scripts]$ dgmgrl DGMGRL for Linux: Version 10.com/2007/06/broker-dataguard-e-real-time-apply-10g. OLAP and Data Mining options Hora das manutenções.0 . Connected to: Oracle Database 10g Enterprise Edition Release 10. Oracle. Vamos a alguns testes.Production Copyright (c) 2000.mportes. protection mode alterado! O maxavailability é nosso preferido.------------.3. os bancos já deverão estar sincronizados. [oracle@anakin scripts]$ export ORACLE_SID=n2dg [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10.0. DGMGRL> edit database n1 set property LogXptMode='SYNC'.0.------------.html 7/8/2010 .0.---------------. Succeeded.------------. Page 7 of 10 Alterar nos dois databases. or instance Syntax: EDIT CONFIGURATION SET PROTECTION MODE AS {MaxProtection|MaxAvailability|MaxPerformance}.------------.Primary database n2 .Physical standby database Current status for "mportes_dg": http://mportes. Ok.local)(PORT=1521))' StandbyArchiveLocation = '/backup/n1/arch' AlternateLocation = '' LogArchiveTrace = '0' LogArchiveFormat = '%t_%s_%r. :-) Olha como é difícil fazer SWITCHOVER. Dataguard e Real-Time Apply . DGMGRL> show configuration Configuration Name: mportes_dg Enabled: YES Protection Mode: MaxAvailability Fast-Start Failover: DISABLED Databases: n1 . Property "logxptmode" updated DGMGRL> edit database n2 set property LogXptMode='SYNC'.0 . DGMGRL> connect sys/oracle Connected. Property "logxptmode" updated DGMGRL> alter configuration set protection mode as maxavailability.blogspot. GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIME ------------.3. EDIT INSTANCE [ON DATABASE ] SET AUTO PFILE [ = {|OFF} ].2.. idle> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.--. All rights reserved. EDIT DATABASE SET STATE = [WITH APPLY INSTANCE = ]. OLAP and Data Mining options idle> select * from v$log. Welcome to DGMGRL.0. type "help" for information.2.2. 2006. Oracle.. All Rights Reserved.Primary database n2 .dbf' LatestLog = '(monitor)' TopWaitEvents = '(monitor)' Current status for "n1": SUCCESS DGMGRL> help alter Edit a configuration. DGMGRL> show configuration verbose Configuration Name: mportes_dg Enabled: YES Protection Mode: MaxAvailability Fast-Start Failover: DISABLED Databases: n1 .Production With the Partitioning.3. EDIT CONFIGURATION SET PROPERTY = .

sys:N1DG> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.0. applied.2. new primary is "n2" DGMGRL> show configuration Configuration Name: mportes_dg Enabled: YES Protection Mode: MaxAvailability Fast-Start Failover: DISABLED Databases: n1 . 2 SWITCHOVER_STATUS.Production With the Partitioning. All Rights Reserved.3. DATAGUARD_BROKER.-------.3. OLAP and Data Mining options idle> select sequence#.0 . DATABASE_ROLE..0 . PROTECTION_MODE.------------. please wait.---------------. ORACLE instance started..0 . Operation requires shutdown of instance "n2dg" on database "n2" Shutting down instance "n2dg". Database mounted. OLAP and Data Mining options [oracle@anakin scripts]$ export ORACLE_SID=n1dg [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10. Operation requires shutdown of instance "n1dg" on database "n1" Shutting down instance "n1dg".2.0. Switchover succeeded. archived..Production With the Partitioning.-------. Database mounted.0.Physical standby database n2 . Operation requires startup of instance "n1dg" on database "n1" Starting instance "n1dg".Production on Tue Jun 12 00:44:02 2007 Copyright (c) 1982. Oracle..-------------------. REMOTE_ARCHIVE. ORACLE instance started. registrar. Dataguard e Real-Time Apply .0 .. ORA-01109: database not open Database dismounted.3. creator. 2006.0 . SEQUENCE# DEST_ID CREATOR REGISTR ARC APP S ------------. dest_id.3.10g SUCCESS DGMGRL> switchover to n2 Performing switchover NOW.Blog do Marcio Portes: Broker.2 2 ARCH ARCH YES NO A 3 2 ARCH ARCH YES NO A 4 2 ARCH ARCH YES NO A 5 1 ARCH ARCH YES YES A 5 2 ARCH ARCH YES NO A 6 1 ARCH ARCH YES YES A 6 2 ARCH ARCH YES NO A 7 1 ARCH ARCH YES YES A 7 2 ARCH ARCH YES NO A 8 1 ARCH ARCH YES YES A 8 2 ARCH ARCH YES NO A 9 2 ARCH ARCH YES NO A 9 1 FGRD FGRD YES YES A 10 1 ARCH ARCH YES YES A 10 2 ARCH ARCH YES NO A 11 1 ARCH ARCH YES YES A 11 2 ARCH ARCH YES YES A 12 1 ARCH ARCH YES YES A 12 2 ARCH ARCH YES YES A 13 2 LGWR LGWR YES YES A 13 1 FGRD FGRD YES YES A 14 2 LGWR LGWR YES NO A 14 1 FGRD FGRD YES YES A 15 2 LGWR LGWR YES NO A 15 1 FGRD FGRD YES YES A 16 1 FGRD RFS YES YES A 16 2 FGRD FGRD YES NO A http://mportes.0.blogspot. Operation requires startup of instance "n2dg" on database "n2" Starting instance "n2dg".com/2007/06/broker-dataguard-e-real-time-apply-10g.-------------------. Oracle. ORACLE instance shut down.---------.2. ORA-01109: database not open Database dismounted.--.2.html 7/8/2010 .3. OLAP and Data Mining options sys:N1DG> select NAME.--.Primary database Current status for "mportes_dg": SUCCESS DGMGRL> exit Page 8 of 10 Pronto! Viu só? Bastou "switchover to " e ele faz tudo.2. Connected to: Oracle Database 10g Enterprise Edition Release 10.Production With the Partitioning..------. FORCE_LOGGING 3 from v$database 4 / NAME OPEN_MODE PROTECTION_MODE PROTECTION_LEVEL REMOTE_A DATABASE_ROLE SWITCHOVER_STATUS DATAGUAR FOR --------.--N1DG READ WRITE MAXIMUM AVAILABILITY MAXIMUM AVAILABILITY ENABLED PRIMARY SESSIONS ACTIVE ENABLED YES 1 row selected...------. All Rights Reserved.. Vamos verificar! [oracle@anakin scripts]$ echo $ORACLE_SID n2dg [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10.. 2006. status from v$archived_log order by 1.Production on Tue Jun 12 00:45:25 2007 Copyright (c) 1982. Não deixe de ver os alerts logs com o tail -f. PROTECTION_LEVEL.0. ORACLE instance shut down.-------------------. Connected to: Oracle Database 10g Enterprise Edition Release 10. OPEN_MODE.

Physical standby database n2 .-----------. Dataguard e Real-Time Apply .0..BLOCKS. Operation requires startup of instance "n2dg" on database "n2" Starting instance "n2dg". ORA-01109: database not open Database dismounted.. DELAY_MINS FROM 2 V$MANAGED_STANDBY.Blog do Marcio Portes: Broker. Database mounted.------------. Connected to: Oracle Database 10g Enterprise Edition Release 10..-----------.0 .Physical standby database Current status for "mportes_dg": SUCCESS DGMGRL> exit [oracle@anakin scripts]$ echo $ORACLE_SID n1dg [oracle@anakin scripts]$ export ORACLE_SID=n2dg [oracle@anakin scripts]$ sqlplus / as sysdba SQL*Plus: Release 10.3. [oracle@anakin scripts]$ dgmgrl DGMGRL for Linux: Version 10.Primary database Current status for "mportes_dg": SUCCESS DGMGRL> switchover to n1 Performing switchover NOW.. ORACLE instance started. Operation requires shutdown of instance "n1dg" on database "n1" Shutting down instance "n1dg".3.Primary database n2 .Production With the Partitioning.------------. 2006.10g 17 1 ARCH RFS YES YES A 18 1 ARCH RFS YES YES A 29 rows selected.2.2.0 . All Rights Reserved..------------ARCH CLOSING 23 1 67 0 ARCH CLOSING 22 1 1 0 MRP0 APPLYING_LOG 24 17 102400 0 RFS IDLE 24 18 1 0 RFS IDLE 0 0 0 0 RFS IDLE 0 0 0 0 6 rows selected.3.. OLAP and Data Mining options Page 9 of 10 Voltando para o nó N1.. ORA-01109: database not open Database dismounted. 2005. Oracle..blogspot. Welcome to DGMGRL. Oracle. new primary is "n1" DGMGRL> DGMGRL> show configuration Configuration Name: mportes_dg Enabled: YES Protection Mode: MaxAvailability Fast-Start Failover: DISABLED Databases: n1 .Production With the Partitioning. please wait.Production Copyright (c) 2000.. Operation requires startup of instance "n1dg" on database "n1" Starting instance "n1dg". ORACLE instance shut down..0. Switchover succeeded. idle> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10. Operation requires shutdown of instance "n2dg" on database "n2" Shutting down instance "n2dg".------------.2. ORACLE instance shut down. OLAP and http://mportes. DGMGRL> connect sys/oracle Connected.com/2007/06/broker-dataguard-e-real-time-apply-10g.0. idle> / PROCESS STATUS SEQUENCE# BLOCK# BLOCKS DELAY_MINS --------.0.Production on Tue Jun 12 00:54:16 2007 Copyright (c) 1982.------------ARCH CLOSING 23 1 67 0 ARCH CLOSING 22 1 1 0 MRP0 APPLYING_LOG 24 14 102400 0 RFS IDLE 24 15 1 0 RFS IDLE 0 0 0 0 RFS IDLE 0 0 0 0 6 rows selected.html 7/8/2010 .0 .------------. Database mounted.------------. OLAP and Data Mining options idle> SELECT PROCESS.Production With the Partitioning. STATUS.SEQUENCE#.BLOCK#. type "help" for information.0 .0. All rights reserved.------------. DGMGRL> show configuration Configuration Name: mportes_dg Enabled: YES Protection Mode: MaxAvailability Fast-Start Failover: DISABLED Databases: n1 .3. idle> exit Disconnected from Oracle Database 10g Enterprise Edition Release 10.0 . ORACLE instance started.2.3.2. PROCESS STATUS SEQUENCE# BLOCK# BLOCKS DELAY_MINS --------.

html 7/8/2010 .10g Page 10 of 10 Uma última consideração. é possível somente levantar os nós em NOMOUNT que ele faz o resto. New Feature # posted by Marcio : 7:48 PM http://mportes. não há necessidade de abrir o banco.blogspot. Um lembrete: Use as instruções acima para exercício em ambiente TESTE e por sua conta e risco! Labels: how to. quando configuramos o broker para gerenciar o Dataguard.com/2007/06/broker-dataguard-e-real-time-apply-10g. é necessário MONTAR o banco para que o broker levante e sincronize os nós. Dataguard e Real-Time Apply . até a versão 9i.Blog do Marcio Portes: Broker. Já na versão 10g.

Sign up to vote on this title
UsefulNot useful