Escolar Documentos
Profissional Documentos
Cultura Documentos
OVERVIEW...................................................................................................................................2
PREPARATION STEPS...............................................................................................................3
IMPLEMENTATION STEPS......................................................................................................4
STEPS TO BE DONE ON THE PRIMARY SERVER..............................................................4
STEP 1: BACKUP THE PRIMARY DATABASE DATAFILES .................................................................4
STEP 3: CONFIGURE ORACLE NET...............................................................................................5
STEP 4: CONFIGURE DATABASE INITIALISATION PARAMETER FILE...............................................5
STEPS TO BE DONE ON THE STANDBY SERVER..............................................................7
STEP 1: CONFIGURE ORACLE NET...............................................................................................7
STEP 2: CONFIGURE THE PHYSICAL STANDBY DATABASE INITIALISATION PARAMETER...............7
STEP 2: RESTORE DATABASE FILES FROM THE BACKUP LOCATION.............................................8
STEP 3: START AUTOMATIC STANDBY DATABASE RECOVERY......................................................9
SWITCHOVER DATABASE ROLE.........................................................................................10
STEP 1: CHECK THE PRIMARY DATABASE READINESS FOR SWITCHOVER...................................10
STEP 2: SWITCHING THE PRIMARY TO STANDBY........................................................................10
STEP 3: SWITCH FROM STANDBY TO PRIMARY...........................................................................11
STEP 4: START AUTOMATIC STANDBY DATABASE RECOVERY....................................................12
APPENDIX A: COMMANDS....................................................................................................13
APPENDIX B: PROTECTION MODES..................................................................................14
APPENDIX C: DATA GUARD USEFUL COMMANDS........................................................16
SWITCHOVER DATABASE ROLE..................................................................................................16
READ ONLY DATABASE ROLE....................................................................................................16
FAILOVER DATABASE ROLE IN CASE OF TOTAL DISASTER......................................................17
START STANDBY RECOVERY......................................................................................................17
Version 5
Document Name: 260215700.doc
Page 1
IBM P595
AIX 5.3 ML3
16x1.9GHz
32GB RAM
Private
Network
IBM P670
AIX 5.3 ML3
16x1500 MHz
16GB RAM
IBM P595
AIX 5.3 ML3
16x1.9GHz
32GB RAM
WAN
WAN
SAN
Switches
DS4800 Storage
28x36GB Disks
DS4800 Storage
28x36GB Disks
KFR Datacenter
Primary Site
OLAYA Datacenter
DR Site
Version 5
Document Name: 260215700.doc
SAN
Switches
Page 2
Preparation Steps
Before starting in the implementation steps make sure that the following setup exists,
Primary database must be running in ARCHIVELOG mode
Stop database (srvctl stop database d etrade)
Startup mount
Alter database archivelog;
alter system set LOG_ARCHIVE_FORMAT='etrade_%t_%s_%r.arc'
scope=spfile;
alter system set LOG_ARCHIVE_DEST_1='LOCATION=+DGARCH1
MANDATORY REOPEN=60';
The primary database must be in force logging mode.
SQL> ALTER DATABASE FORCE LOGGING;
Oracle Server installed on standby server software only
Version 5
Document Name: 260215700.doc
Page 3
Implementation Steps
Assumption:
1. We have 'etrade' database having two instances etrade1 and etrade2 running on two
different server on AIX 5.3 platform.
2. The RMAN directory for backup is /orahome/backup with enough space for the full
database backup
3. ASM database is created in the standby environment with similar names like productions
and the init.ora parameter "processes" equal to 150
4. hosts file is update in the primary and standby machines correctly
5. Create the standby database control file by issuing the following command,
SQL> ALTER DATABASE CREATE STANDBY CONTROLFILE AS
'/orahome/backup/etrade_stdbycf.ctl';
6. Transfer the datafiles and control files from /orahome/backup directory to the physical
standby machine/site with same directory path (so that the restore database step can
find it).
Version 5
Document Name: 260215700.doc
Page 4
Value
DB_UNIQUE_NAME
'etrade' RAC
*.LOG_ARCHIVE_DEST_STATE_1
ENABLE ALL
*.LOG_ARCHIVE_DEST_STATE_2
DEFER
( after standby database configuration complete convert
this value to enable) ALL
Version 5
Document Name: 260215700.doc
Page 5
*.LOG_ARCHIVE_DEST_2
*.LOG_ARCHIVE_FORMAT
etrade_%t_%s_%r.dbf ALL
*.REMOTE_ARCHIVE_ENABLE
TRUE ALL
*.LOG_ARCHIVE_CONFIG
'DG_CONFIG=(etrade,etradedr)'
*.FAL_SERVER
etradedr RAC
etrade1.FAL_CLIENT
etrade1_prim RAC
etrade2.FAL_CLIENT
etrade2_prim RAC
ALL
Make sure that LOG_ARCHIVE_FORMAT parameter is having the same value in the
parameter file for both the RAC instances and in standby parameter file.
Version 5
Document Name: 260215700.doc
Page 6
Value
DB_UNIQUE_NAME
Etradedr
DB_NAME
CONTROL_FILES
' /orahome/backup/etrade_stdbycf.ctl'
LOG_ARCHIVE_CONFIG
'DG_CONFIG=(etrade,etradedr)'
Version 5
Document Name: 260215700.doc
Page 7
LOG_ARCHIVE_DEST_STATE_1
ENABLE
LOG_ARCHIVE_FORMAT
FAL_SERVER
'etrade1_prim', 'etrade2_prim'
FAL_CLIENT
'etradedr'
STANDBY_ARCHIVE_DEST
STANDBY_FILE_MANAGEMENT
AUTO
RMAN>Restore Database;
13. Add a new standby redo log file group to a standby database using the following formula
(in our case the it will be 6)
(number of log files per thread + 1) * number of threads
Version 5
Document Name: 260215700.doc
Page 8
Version 5
Document Name: 260215700.doc
Page 9
Version 5
Document Name: 260215700.doc
Page 10
Version 5
Document Name: 260215700.doc
Page 11
Note: The standby database must have been in managed recovery mode prior to starting the
switchover operation, so that the primary database switchover operation request can be
coordinated. If managed recovery was not active, or the primary database switchover
notification was unable to be processed, the switchover operation will not be allowed to
proceed.
Remarks
A failover should not be performed except in case of emergencies. After failover the standby
becomes primary and loses standby functionality. A new standby databse has to be setup.
Version 5
Document Name: 260215700.doc
Page 12
APPENDIX A: Commands
Command
Description
STARTUP NOMOUNT
Version 5
Document Name: 260215700.doc
Page 13
This protection mode ensures that no data loss will occur if the primary database fails. To
provide this level of protection, the redo data needed to recover each transaction must be
written to both the local online redo log and to the standby redo log on at least one standby
database before the transaction commits. To ensure data loss cannot occur, the primary
database shuts down if a fault prevents it from writing its redo stream to at least one remote
standby redo log. For multiple-instance RAC databases, Data Guard shuts down the primary
database if it is unable to write the redo records to at least one properly configured database
instance. The maximum protection mode requires that at least one standby instance has a
standby redo log and the LGWR, SYNC, and AFFIRM attributes be used on the
LOG_ARCHIVE_DEST_n parameter for this destination.
Maximum Availability Mode
This protection mode provides the highest level of data protection that is possible without
compromising the availability of the primary database. Like maximum protection mode, a
transaction will not commit until the redo needed to recover that transaction is written to the
local online redo log and to at least one remote standby redo log. Unlike maximum protection
mode, the primary database does not shut down if a fault prevents it from writing its redo stream
to a remote standby redo log. Instead, the primary database operates in maximum performance
mode until the fault is corrected and all gaps in redo log files are resolved. When all gaps are
resolved, the primary database automatically resumes operating in maximum availability mode.
This mode ensures that no data loss will occur if the primary database fails, but only if a second
fault does not prevent a complete set of redo data from being sent from the primary database to
at least one standby database.
Like maximum protection mode, the maximum availability mode requires that you:
Configure standby redo log files on at least one standby database.
Set the SYNC, LGWR, and AFFIRM attributes of the LOG_ARCHIVE_DEST_n
parameter for at least 1 standby database.
Maximum Performance Mode
This protection mode (the default) provides the highest level of data protection that is possible
without affecting the performance of the primary database. This is accomplished by allowing a
transaction to commit as soon as the redo data needed to recover that transaction is written to
the local online redo log. The primary databases redo data stream is also written to at least one
standby database, but that redo stream is written asynchronously with respect to the
commitment of the transactions that create the redo data.
When network links with sufficient bandwidth are used, this mode provides a level of data
protection that approaches that of maximum availability mode with minimal impact on primary
database performance.
Version 5
Document Name: 260215700.doc
Page 14
Version 5
Document Name: 260215700.doc
Page 15
shutdown immediate;
d. Startup nomount
e. alter database mount standby database;
f.
2) ON STANDBY
a. SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
-----------------TO PRIMARY
b. ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY; - Add to init file
c.
startup
3) ON PRIMARY
a. ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM
SESSION;
4) ON STANDBY
a. ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
B. ALTER DATABASE OPEN READ ONLY;
Version 5
Document Name: 260215700.doc
Page 16
SHUTDOWN IMMEDIATE;
d. STARTUP MOUNT
e. ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;
f.
Version 5
Document Name: 260215700.doc
Page 17