Dataguard Fsfo Implementation
Dataguard Fsfo Implementation
INDEX
Summary................................................................................................................................................................................3
The environment....................................................................................................................................................................3
Database Checkup.................................................................................................................................................................4
1/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
2/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Summary
This document describes the implementation of a Dataguard Environment on Windows using Oracle RDBMS
10.2.0.4. The setup includes 3 servers: Primary, Physical Standby and Observer.
The Configuration was setup in maximum availability mode and Fast Start Failover was configured with a 30
seconds threshold.
The observer was setup to be started at server boot and was set to be run by system so that no user can shutdown
it. A watchdog process run by a central control application takes care of restarting the observer process in case
that is shutdown; the observer process is also configured with the scheduler to be started up at boot time.
The environment
The environment is setup of 3 Windows Server 2003 with 4 cpus and 2GB memory each.
Server DGONE
IP 192.168.2.12
Oracle Home C:\oracle\product\10.2.0\db_1
Database SATI
Main Role Primary
Server DGTWO
IP 192.168.2.14
Oracle Home C:\oracle\product\10.2.0\db_1
Database SATISTD
Main Role Standby
Server DGTHREE
IP 192.168.2.16
3/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database Checkup
The Database is a standalone partial copy of the main production database, it is updated with specific information
at regular intervals and serves as a front end repository for a web application open to the general public so it does
require very high availability. In case of primary site crash the time to failover is about 40 seconds.
The database access is read only mostly, except for the periodic uploads of data that maintain it updated.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Configuring a Dataguard environment starts by preparing an Spfile that contains specific parameters that define
and control Dataguard operation. When Dataguard Broker is used to manage the environment an spfile must be
used because the broker will take over the responsibility to setup and change specific parameters under specific
circumstances, like manual switchover, fast start failover, add or remove a standby, reinstate a failed primary, etc.
The Dataguard related parameters could be confusing at the beginning so it is convenient to use some time to
become familiar with their meaning and use.
The next table explains the parameters required for configuring Dataguard, they are divided in groups to better
explain their functionality.
5/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Instance_name has the value of the System Identifier; The SID identifies the
instance's shared memory on a host. On Dataguard is important to take care that
the instance_name is correctly defined on the physical standby with the same
value as the db_unique_name, because the broker to establish communications uses
this value. A possible error here is to have correctly defined db_unique_name,
instance_name but because the parameter file was copied from the primary instance name can
remain set as the database name, that will make fail the automatic startup of the
standby on switchover or failover.
fal_client specifies the FAL (fetch archive log) client name that is
used by the FAL_SERVER, to refer to the FAL client. The fal_client
will point to the same database where it is configured, and will be
active only when this database will be mounted on the standby role.
6/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
A 0 value is used for real time apply. The recommended value, when
not using real time apply is 1800 (30 minutes).
archive_lag_target
Primary database : *.archive_lag_target=0
Physical standby : *.archive_lag_target=0
7/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
9/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
SATI.__db_cache_size=754974720
SATI.__java_pool_size=8388608
SATI.__large_pool_size=16777216
SATI.__shared_pool_size=209715200
SATI.__streams_pool_size=50331648
*.archive_lag_target=0
*.background_dump_dest='Z:\oracle\admin\SATI\bdump'
*.compatible='10.2.0.4.0'
*.control_files='Z:\oracle\oradata\SATI\control01.ctl','X:\oracle\oradata\SATI\control02.ctl','G:\orac
le\oradata\SATI\control03.ctl'
*.core_dump_dest='Z:\oracle\admin\SATI\cdump'
*.db_block_size=8192
*.db_cache_size=0
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_files=1024
*.db_name='SATI'
*.db_recovery_file_dest_size=26843545600
*.db_recovery_file_dest='G:\FRA'
*.db_unique_name='SATI'
*.dg_broker_start=TRUE
*.fal_client='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522)))(CONNECT_DATA
=(SERVICE_NAME=SATI_XPT)(INSTANCE_NAME=SATI)(SERVER=dedicated)))'
10/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
*.fal_server='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522)))(CONNECT_DATA
=(SERVICE_NAME=SATISTD_XPT)(SERVER=dedicated)))'
*.fast_start_mttr_target=300
*.instance_name='SATI'
*.java_pool_size=0
*.job_queue_processes=50
*.large_pool_size=0
SATI.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))'
SATISTD.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))'
*.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522))'
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(SATI,SATISTD)'
*.LOG_ARCHIVE_DEST_1='LOCATION=G:\oracle\oradata\SATI\archive
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=SATI'
SATI.log_archive_dest_1='location="G:\oracle\oradata\SATI\archive"','valid_for=(ONLINE_LOGFILE,ALL_ROL
ES)'
*.log_archive_dest_2=''
SATI.log_archive_dest_2='location="dgsby"','valid_for=(STANDBY_LOGFILE,STANDBY_ROLE)'
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
SATI.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
SATI.log_archive_dest_state_2='ENABLE'
*.LOG_ARCHIVE_FORMAT='%t_%s_%r.arc'
SATI.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=2
*.log_archive_min_succeed_dest=1
SATI.log_archive_trace=0
*.open_cursors=1000
*.pga_aggregate_target=524288000
*.processes=150
*.query_rewrite_enabled='TRUE'
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
*.remote_os_authent=TRUE
*.session_max_open_files=20
*.sessions=500
*.sga_max_size=1258291200
*.sga_target=1048576000
*.shared_pool_size=0
11/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
SATI.standby_archive_dest='dgsby'
*.standby_file_management='AUTO'
*.star_transformation_enabled='TRUE'
*.streams_pool_size=50331648
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=3600
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='Z:\oracle\admin\SATI\udump'
*.utl_file_dir='Z:\oracle\admin\SATI\bdump'
*.workarea_size_policy='AUTO'
12/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
In order to assure that all transactions are written to the online redologs we enable force logging, that option
prevents the execution of nologging operations.
By working in force logging mode there is a performance penalty that we must pay. In some circumstances where
we would like to run massive changes that require nologging mode we can stop log apply and at the end of the
batch close the gap on the standby using an incremental backup.
For details on this technique please check chapter 12.7 of the Oracle® Data Guard Concepts and Administration
10g Release 2 (10.2), Part Number B14239-05
http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/scenarios.htm#CIHEGFEG
12.7 Using RMAN Incremental Backups to Roll Forward a Physical Standby Database
In some situations, RMAN incremental backups can be used to synchronize a physical standby database
with the primary database. Using the RMAN BACKUP INCREMENTAL FROM SCN command, you can
create a backup on the primary database that starts at the standby database's current SCN, which can then
be used to roll the standby database forward in time.
13/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
It is important to create the password file on the primary site and copy the generated file to the standby server. The
password file at both sites must be same one. Even creating the password file on the standby site in the same way
that was created on the primary site will not work.
C: >orapwd
UsagZ: orapwd file=<fname> password=<password> entries=<users> force=<y/n>
ignorecase=<y/n> nosysdba=<y/n>
where
file - name of password file (required),
password - password for SYS (optional),
entries - maximum number of distinct DBA (required),
force - whether to overwrite existing file (optional),
ignorecase - passwords are case-insensitive (optional),
nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
When configuring FSFO we will use the synchronous redo transport mod, LogXptMode=SYNC, this mode does
require to use standby redo logs. Redo received via redo transport is written on the Standby Database to the
current standby redo log group by a RFS background process. When a log switch occurs on the Primary database,
14/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
the new redo is written to the next standby redo log group, and the previously used standby redo log group is
archived by an ARCn background process.
The process of filling and archiving redo log file groups at the Primary database is mirrored at the Standby
destination by the sequential filling and archiving of standby redo log groups.
Each standby redo log file must be the same size as the online logs of the Primary database, and in addition the
standby redo log must have at least one more group than the online redo logs on the Primary database.
On this case we have 3 online redo log groups with 2 members each on the primary
SQL> select * from v$log;
6 rows selected.
We will add another 4 standby redo log groups with 2 members each on the primary, when the database will be
copied to create the standby the standby redologs will be already there.
15/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database altered.
Database altered.
Database altered.
Database altered.
16/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Enable Archiving
On 10g we jaut need to mout the database and execute the command
Setup the network using netca or netmgr, edit the tnsnames.ora to register the listeners
One important aspect of preparing the Dataguard environment is to configure the network appropriately. A default
configuration can be created and then both the listener.ora and the tnsnames.ora will need to be edited to match
the standard requirements of Dataguard
On the listener.ora of each server you will need to manually register the corresponding database using the
following syntax:
On the Primary
SID_LIST_LISTENER_DGONE =
(SID_LIST =
(SID_DESC =
17/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
(SID_NAME = SATI)
(GLOBAL_DBNAME=SATI_DGMGRL)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
)
)
On the Standby
SID_LIST_LISTENER_DGTWO =
(SID_LIST =
(SID_DESC =
(SID_NAME = SATISTD)
(GLOBAL_DBNAME=SATISTD_DGMGRL)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
)
)
LISTENER_DGONE =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
)
)
SID_LIST_LISTENER_DGONE =
(SID_LIST =
(SID_DESC =
(SID_NAME = SATI)
(GLOBAL_DBNAME=SATI_DGMGRL)
18/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
)
)
LISTENER_DGTWO =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
)
)
SID_LIST_LISTENER_DGTWO =
(SID_LIST =
(SID_DESC =
(SID_NAME = SATISTD)
(GLOBAL_DBNAME=SATISTD_DGMGRL)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
)
)
LISTENER_DGONE =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
)
)
19/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
SATI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SATI_DGMGRL)
)
)
SATISTD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SATISTD_DGMGRL)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
LISTENER_DGTWO =
20/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
)
)
SATI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SATI_DGMGRL)
)
)
SATISTD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SATISTD_DGMGRL)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
21/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Shutdown the Primary Database and copy it Over to the Standby Server
On windows I just shared the directories and dragged the directories to the standby site.
On Linux I use ftp or rman.
When implementing Dataguard on Windows, after installing Oracle server on the server that will host the physical
standby database, a service needs to be created to for the clone. Startmode is set to manual, because the main
role of the database is to be physical standby on which case we will mount it only. In case that the database will
assume the primary role, the broker will take care of starting it up and change the role.
22/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database altered.
Database altered.
Create a copy of the primary spfile and modify it for the standby
File created.
Edited FilZ:
SATISTD.__db_cache_size=545259520
SATISTD.__java_pool_size=8388608
SATISTD.__large_pool_size=8388608
SATISTD.__shared_pool_size=427819008
SATISTD.__streams_pool_size=50331648
*.archive_lag_target=0
*.background_dump_dest='Z:\oracle\admin\SATI\bdump'
*.compatible='10.2.0.4.0'
23/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
*.control_files='Z:\oracle\oradata\SATI\control01.ctl','X:\oracle\oradata\SATI\control02.ctl','G:\orac
le\oradata\SATI\control03.ctl'
*.core_dump_dest='Z:\oracle\admin\SATI\cdump'
*.db_block_size=8192
*.db_cache_size=0
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_files=1024
*.db_name='SATI'
*.db_recovery_file_dest_size=26843545600
*.db_recovery_file_dest='G:\FRA'
*.db_unique_name='SATISTD'
*.dg_broker_start=TRUE
*.fal_client='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522)))(CONNECT_DATA
=(SERVICE_NAME=SATISTD_XPT)(INSTANCE_NAME=SATISTD)(SERVER=dedicated)))'
*.fal_server='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522)))(CONNECT_DATA
=(SERVICE_NAME=SATI_XPT)(SERVER=dedicated)))'
*.fast_start_mttr_target=300
*.instance_name='SATISTD'
*.java_pool_size=0
*.job_queue_processes=50
*.large_pool_size=0
*.local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522))'
*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(SATI,SATISTD)'
*.LOG_ARCHIVE_DEST_1='LOCATION=G:\oracle\oradata\SATI\archive
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=SATISTD'
SATISTD.log_archive_dest_1='location="G:\oracle\oradata\SATI\archive"','valid_for=(ONLINE_LOGFILE,ALL_
ROLES)'
*.log_archive_dest_2='service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=152
2)))(CONNECT_DATA=(SERVICE_NAME=SATI_XPT)(INSTANCE_NAME=SATI)(SERVER=dedicated)))"',' LGWR SYNC
AFFIRM delay=0 OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="SATI" register
net_timeout=180 valid_for=(online_logfile,primary_role)'
*.log_archive_dest_3=''
*.LOG_ARCHIVE_DEST_STATE_1='ENABLE'
SATISTD.log_archive_dest_state_1='ENABLE'
*.log_archive_dest_state_2='ENABLE'
*.log_archive_dest_state_3='ENABLE'
24/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
*.LOG_ARCHIVE_FORMAT='%t_%s_%r.arc'
SATI.log_archive_format='%t_%s_%r.arc'
SATISTD.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=2
*.log_archive_min_succeed_dest=1
SATISTD.log_archive_trace=0
*.open_cursors=1000
*.pga_aggregate_target=524288000
*.processes=150
*.query_rewrite_enabled='TRUE'
*.REMOTE_LOGIN_PASSWORDFILE='EXCLUSIVE'
*.remote_os_authent=TRUE
*.session_max_open_files=20
*.sessions=500
*.sga_max_size=1258291200
*.sga_target=1048576000
*.shared_pool_size=0
SATISTD.standby_archive_dest=''
*.standby_file_management='auto'
*.star_transformation_enabled='TRUE'
*.streams_pool_size=50331648
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=3600
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='Z:\oracle\admin\SATI\udump'
*.utl_file_dir='Z:\oracle\admin\SATI\bdump'
*.workarea_size_policy='AUTO'
25/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
On windows I just shared the directories and dragged the directories to the standby site.
On Linux I usually use ftp.
Generate the standby spfile from the pfile you prepared before
To generate the Physical Standby spfile, we start the database in nomount mode with the pfile we created from the
primary and edited for the standby database, and we execute the create spfile command.
SQL> STARTUP NOMOUNT PFILE='C:\standby_pfile.txt';
ORACLE instance started.
File created.
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
29/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
30/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
10 rows selected.
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
21 rows selected.
SEQUENCE# APP
---------- ---
300 YES
301 YES
302 YES
303 YES
304 YES
305 YES
306 YES
307 YES
308 YES
309 YES
310 YES
311 YES
312 YES
313 YES
314 YES
315 YES
316 YES
317 YES
318 YES
319 YES
320 YES
21 rows selected.
34/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
NAME DB_UNIQUE_NAME
--------- ------------------------------
SATI SATI
System altered.
System altered.
Database altered.
35/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
On The Standby
NAME DB_UNIQUE_NAME
--------- ------------------------------
SATI SATISTD
System altered.
System altered.
Database altered.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;
Database altered.
36/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
The broker configuration files are automatically created when the broker is started using ALTER SYSTEM
SET DG_BROKER_START=TRUE.
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;
System altered.
System altered.
37/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
System altered.
System altered.
Setup the Tnsnames.ora and Listener.ora parameter files on the Primary Database
The listener.ora needs to include a service named global_db_name_DGMGRL to enable the broker
to start the databases on the event of switchover. This configuration needs to be included
on both servers. To setup shutdown the listener, make the changes and restart the listener.
38/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Listener.ora
LISTENER_DGONE =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
)
)
SID_LIST_LISTENER_DGONE =
(SID_LIST =
(SID_DESC =
(SID_NAME = SATI)
(GLOBAL_DBNAME=SATI_DGMGRL)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
)
)
Tnsnames.ora
SATI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SATI_DGMGRL)
)
)
SATISTD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
39/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
(SERVICE_NAME = SATISTD_DGMGRL)
)
)
Check
C:\Documents and Settings\AV>lsnrctl status LISTENER_DGONE
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER_DGONE
Version TNSLSNR for 32-bit Windows: Version 10.2.0.4.0 - Production
Start Date 08-DEC-2008 18:22:44
Uptime 5 days 15 hr. 56 min. 42 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
Listener Log File C:\oracle\product\10.2.0\db_1\network\log\listener_DGONE.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DGONE)(PORT=1522)))
Services Summary...
Service "SATI" has 1 instance(s).
Instance "SATI", status READY, has 1 handler(s) for this service...
Service "SATI_DGB" has 1 instance(s).
Instance "SATI", status READY, has 1 handler(s) for this service...
Service "SATI_DGMGRL" has 1 instance(s).
Instance "SATI", status UNKNOWN, has 1 handler(s) for this service...
Service "SATI_XPT" has 1 instance(s).
Instance "SATI", status READY, has 1 handler(s) for this service...
The command completed successfully
TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 14-DEC-2008 10:20:13
40/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 14-DEC-2008 10:20:17
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Setup the Tnsmanes.ora and Listener.ora parameter files on the Standby Database
The listener.ora needs to include a service named global_db_name_DGMGRL to enable the broker
to start the databases on the event of switchover. This configuration needs to be included
on both servers. To setup shutdown the listener, make the changes and restart the listener.
Listener.ora
LISTENER_DGTWO =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
)
)
SID_LIST_LISTENER_DGTWO =
(SID_LIST =
(SID_DESC =
(SID_NAME = SATISTD)
(GLOBAL_DBNAME=SATISTD_DGMGRL)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
)
)
42/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Tnsnames.ora
SATI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SATI_DGMGRL)
)
)
SATISTD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SATISTD_DGMGRL)
)
)
Check
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias listener_DGTWO
Version TNSLSNR for 32-bit Windows: Version 10.2.0.4.0 - Production
Start Date 08-DEC-2008 18:22:36
Uptime 5 days 16 hr. 17 min. 46 sec
Trace Level off
43/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 14-DEC-2008 10:41:28
TNS Ping Utility for 32-bit Windows: Version 10.2.0.4.0 - Production on 14-DEC-2008 10:41:31
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Enter password:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
45/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
From within the Broker Command Line interface, DGMGRL create the configuration
C:\oracle\product\agent10g\BIN>dgmgrl
DGMGRL for 32-bit Windows: Version 10.2.0.3.0 - Production
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Connected.
Configuration
NamZ: fsfodg
Enabled: NO
Protection ModZ: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
SATI - Primary database
SATISTD - Physical standby database
Database
NamZ: SATISTD
RolZ: PHYSICAL STANDBY
Enabled: NO
Intended StatZ: ONLINE
Instance(s):
SATISTD
Properties:
47/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
InitialConnectIdentifier = 'SATISTD'
LogXptMode = 'SYNC'
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 = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = 'SATI'
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'DGTWO'
SidName = 'SATISTD'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522))'
StandbyArchiveLocation = 'G:\ORACLE\ORADATA\SATI\ARCHIVE'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database
NamZ: SATI
RolZ: PRIMARY
Enabled: NO
Intended StatZ: ONLINE
Instance(s):
SATI
Properties:
InitialConnectIdentifier = 'SATI'
LogXptMode = 'SYNC'
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 = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = ''
LogFileNameConvert = ''
FastStartFailoverTarget = 'SATISTD'
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
49/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
HostName = 'DGONE'
SidName = 'SATI'
LocalListenerAddress = '(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522))'
StandbyArchiveLocation = 'G:\oracle\oradata\SATI\archive'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Configuration
NamZ: fsfodg
Enabled: YES
Protection ModZ: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
SATI - Primary database
SATISTD - Physical standby database
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Configuration
NamZ: fsfodg
Enabled: YES
Protection ModZ: MaxPerformance
Fast-Start Failover: DISABLED
Databases:
SATI - Primary database
SATISTD - Physical standby database
First Check that the configuration is healthy, show database must return success
DGMGRL> show database SATI;
Database
NamZ: SATI
RolZ: PRIMARY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATI
Database
NamZ: SATISTD
RolZ: PHYSICAL STANDBY
Enabled: YES
51/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Set the “FastStartFailoverTarget” Property for Both the Primary and Physical Databases
DGMGRL> EDIT DATABASE SATI SET PROPERTY FastStartFailoverTarget='SATISTD';
Property "faststartfailovertarget" updated
DGMGRL> EDIT DATABASE SATISTD SET PROPERTY FastStartFailoverTarget='SATI';
Property "faststartfailovertarget" updated
Note that the observer process needs to be run on the background of a third productions server all
the time in order to provide automatic fast start failover.
C:\oracle\product\agent10g\BIN>dgmgrl
DGMGRL for 32-bit Windows: Version 10.2.0.3.0 - Production
52/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Configuration
NamZ: fsfodg
Enabled: YES
Protection ModZ: MaxAvailability
Fast-Start Failover: ENABLED
Databases:
SATI - Primary database
SATISTD - Physical standby database
- Fast-Start Failover target
53/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
SUCCESS
Test Switchover
Switchover is used for maintenance on the primary, downtime is required to switch roles between primary
and standby databases.
Before starting a switchover is convenient to check that the configuration and the managed databases are
healthy
DGMGRL> show configuration
Configuration
NamZ: fsfodg
Enabled: YES
Protection ModZ: MaxAvailability
Fast-Start Failover: ENABLED
Databases:
SATISTD - Physical standby database
- Fast-Start Failover target
SATI - Primary database
54/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database
NamZ: SATI
RolZ: PRIMARY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATI
Database
NamZ: SATISTD
RolZ: PHYSICAL STANDBY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATISTD
Database dismounted.
ORACLE instance shut down.
Operation requires shutdown of instance "SATISTD" on database "SATISTD"
Shutting down instance "SATISTD"...
ORA-01109: database not open
Database dismounted.
55/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
After a successful switchover the primary and the standby needs to be synchronized
56/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Once the failed Primary site became available again the Broker will convert it to the standby site and will resume
normal activity.
The observer process needs to be run on a productions server that will provide assurance of continuous
availability. A watchdog process needs to be put in place to restart the observer immediately in the event that is
stopped.
On most productions systems it is possible to define a script that will both check and restart the process in case of
failure.
#!/bin/ksh
# startobserver
export ORACLE_BASE=/vmractst3/app01/oracle
export ORACLE_HOME=/vmractst3/app01/oracle/product/10.2
export
BASE_PATH=/vmractst3/app01/oracle/scripts/general:/opt/CTEact/bin:/usr/local/sbi
n:/usr/local/bin:/sbin:/bin:/usr/bin:/etc:/usr/local/maint/oraclZ:/usr/ccs/bin:/
usr/openwin/bin:/usr/dt/bin:/usr/local/bin:.
export PATH=$ORACLE_HOME/bin:$BASE_PATH
dgmgrl << eof
connect sys/oracle@whiteowl
STOP OBSERVER;
START OBSERVER;
eof
On windows a script can be used to start the Observer process at server startup using the Windows Scheduler.
The same script can be invoked in case that the observer process crash to restart the Observer
set ORACLE_HOME=C:\oracle\product\10.2.0\db_1
call dgmgrl -silent sys/xxxxxx@SATI "stop observer"
57/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
The FSFO can be tested by either shutting down the server where the primary database run or by shutting down
the database with the abort option.
The progress and efficiency of the FSFO can be monitored by doing tail to the Primary and Standby databases
alert logs. The whole process is also reflected on the Observer window if running on foreground.
1. At 17:36:32 the Observer detected a failure on the Primary database SATI and initiated failover
to the Standby database SATISTD
2. At 17:37:19 SATISTD is up and running as the Primary, total downtime was 47 seconds.
3. At 17:38:33 the Observer detected that the failed database SATI was mounted and initiates the
reinstatement, the database is shut down to perform flashback and recovery until it is
synchronized with the new Primary
4. at 17:40:01 SATI is up and synchronized
58/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
The new primary is up and ready in seconds, the new FSFO target is the failed database SATI and its status is
“Reinstate Required”
DB_UNIQUE_NAME DATABASE_ROLE OPEN_MODE FS_FAILOVER_STATUS FS_FAILOVER_CURRENT_TARGET
------------------------------ ---------------- ---------- ------------------ -------------------------------
SATISTD PRIMARY READ WRITE REINSTATE REQUIRED SATI
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Immediately after the database is mounted the broker shuts it down and initiates reinstate, that’s why we got ora-
3113 when trying to check status:
select DB_UNIQUE_NAME,DATABASE_ROLE,OPEN_MODE,FS_FAILOVER_STATUS,FS_FAILOVER_CURRENT_TARGET from v$database
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Once the database is mounted by the broker it is flashed back and synchronized with the new primary
SQL> connect / as sysdba
Connected.
SQL> @chkstat
The alert logs provide the best information to monitor both the FSFO and the Reinstate processes; if available you
can use the command “tail -f <alert.log>” to monitor the progress.
This is a summary of the commands executed by the broker at both databases during the FSFO and the Reinstate
processes.
60/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Mem# 1: X:\ORACLE\ORADATA\SATI\STDBYREDOG5_02.LOG
Identified End-Of-Redo for thread 1 sequence 721
Terminal Recovery: Updated next available block for thread 1 sequence 721 lno 5 to value 74605
Wed Dec 10 17:39:49 2008
Incomplete recovery applied all redo ever generated.
Recovery completed through change 4134609709
Terminal Recovery: successful completion
Begin: Standby Redo Logfile archival
End: Standby Redo Logfile archival
Resetting standby activation ID 1481388743 (0x584c32c7)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE
Wed Dec 10 17:39:57 2008
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
If media recovery active, switchover will wait 900 seconds
Standby terminal recovery start SCN: 4134609708
RESETLOGS after complete recovery through change 4134609709
Online log Z:\ORACLE\ORADATA\SATI\REDO01.LOG: Thread 1 Group 1 was previously cleared
Online log X:\ORACLE\ORADATA\SATI\REDO02.LOG: Thread 1 Group 1 was previously cleared
Online log Z:\ORACLE\ORADATA\SATI\REDO11.LOG: Thread 1 Group 2 was previously cleared
Online log X:\ORACLE\ORADATA\SATI\REDO12.LOG: Thread 1 Group 2 was previously cleared
Online log Z:\ORACLE\ORADATA\SATI\REDO21.LOG: Thread 1 Group 3 was previously cleared
Online log X:\ORACLE\ORADATA\SATI\REDO22.LOG: Thread 1 Group 3 was previously cleared
Standby became primary SCN: 4134609707
Wed Dec 10 17:39:58 2008
Setting recovery target incarnation to 3
Wed Dec 10 17:39:58 2008
Converting standby mount to primary mount.
Completed: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
Wed Dec 10 17:39:58 2008
ARC0: STARTING ARCH PROCESSES
ARC2: Archival started
ARC2 started with pid=20, OS id=2744
Wed Dec 10 17:39:58 2008
ARC0: STARTING ARCH PROCESSES COMPLETE
ARC0: Becoming the 'no SRL' ARCH
Wed Dec 10 17:40:00 2008
ALTER SYSTEM SET standby_archive_dest='' SCOPE=BOTH SID='SATISTD';
Wed Dec 10 17:40:00 2008
62/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
__shared_pool_size = 209715200
shared_pool_size = 0
__large_pool_size = 16777216
large_pool_size = 0
__java_pool_size = 8388608
java_pool_size = 0
__streams_pool_size = 50331648
streams_pool_size = 50331648
sga_target = 1048576000
control_files = Z:\ORACLE\ORADATA\SATI\CONTROL01.CTL,
X:\ORACLE\ORADATA\SATI\CONTROL02.CTL, G:\ORACLE\ORADATA\SATI\CONTROL03.CTL
db_block_size = 8192
__db_cache_size = 754974720
db_cache_size = 0
compatible = 10.2.0.4.0
log_archive_config = DG_CONFIG=(SATI,SATISTD)
log_archive_dest_1 = location="G:\oracle\oradata\SATI\archive",
valid_for=(ONLINE_LOGFILE,ALL_ROLES)
log_archive_dest_2 =
service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522)))(CONNECT_DATA=(SER
VICE_NAME=SATISTD_XPT)(INSTANCE_NAME=SATISTD)(SERVER=dedicated)))", LGWR SYNC AFFIRM delay=0
OPTIONAL max_failure=0 max_connections=1 reopen=300 db_unique_name="SATISTD" register
net_timeout=180 valid_for=(online_logfile,primary_role)
log_archive_dest_state_1 = ENABLE
log_archive_dest_state_2 = ENABLE
log_archive_max_processes= 2
log_archive_min_succeed_dest= 1
standby_archive_dest =
log_archive_trace = 0
log_archive_format = %t_%s_%r.arc
fal_client =
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME
=SATI_XPT)(INSTANCE_NAME=SATI)(SERVER=dedicated)))
fal_server =
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME
=SATISTD_XPT)(SERVER=dedicated)))
archive_lag_target = 0
db_files = 1024
67/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
db_file_multiblock_read_count= 16
db_recovery_file_dest = G:\FRA
db_recovery_file_dest_size= 26843545600
standby_file_management = AUTO
fast_start_mttr_target = 300
undo_management = AUTO
undo_tablespace = UNDOTBS1
undo_retention = 3600
remote_os_authent = TRUE
remote_login_passwordfile= EXCLUSIVE
db_domain =
instance_name = SATI
local_listener = (ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
utl_file_dir = Z:\oracle\admin\SATI\bdump
job_queue_processes = 50
background_dump_dest = Z:\ORACLE\ADMIN\SATI\BDUMP
user_dump_dest = Z:\ORACLE\ADMIN\SATI\UDUMP
core_dump_dest = Z:\ORACLE\ADMIN\SATI\CDUMP
session_max_open_files = 20
db_name = SATI
db_unique_name = SATI
open_cursors = 1000
star_transformation_enabled= TRUE
query_rewrite_enabled = TRUE
pga_aggregate_target = 524288000
workarea_size_policy = AUTO
dg_broker_start = TRUE
PMON started with pid=2, OS id=488
PSP0 started with pid=3, OS id=548
MMAN started with pid=4, OS id=3920
DBW0 started with pid=5, OS id=2408
LGWR started with pid=6, OS id=2440
CKPT started with pid=7, OS id=2756
SMON started with pid=8, OS id=3620
RECO started with pid=9, OS id=3128
CJQ0 started with pid=10, OS id=3800
MMON started with pid=11, OS id=1144
MMNL started with pid=12, OS id=3068
68/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Archiving is disabled
Archive process shutdown avoided: 0 active
Shutting down Data Guard Broker processes
Wed Dec 10 17:42:53 2008
Completed: Data Guard Broker shutdown
Wed Dec 10 17:42:55 2008
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Wed Dec 10 17:42:56 2008
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 2
Autotune of undo retention is turned on.
IMODE=BR
ILAT =55
LICENSE_MAX_USERS = 0
SYS auditing is disabled
ksdpec: called for event 13740 prior to event group initialization
Starting up ORACLE RDBMS Version: 10.2.0.4.0.
System parameters with non-default values:
processes = 150
sessions = 500
timed_statistics = TRUE
sga_max_size = 1258291200
__shared_pool_size = 209715200
shared_pool_size = 0
__large_pool_size = 16777216
large_pool_size = 0
__java_pool_size = 8388608
java_pool_size = 0
__streams_pool_size = 50331648
streams_pool_size = 50331648
sga_target = 1048576000
control_files = Z:\ORACLE\ORADATA\SATI\CONTROL01.CTL,
X:\ORACLE\ORADATA\SATI\CONTROL02.CTL, G:\ORACLE\ORADATA\SATI\CONTROL03.CTL
71/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
db_block_size = 8192
__db_cache_size = 754974720
db_cache_size = 0
compatible = 10.2.0.4.0
log_archive_config = DG_CONFIG=(SATI,SATISTD)
log_archive_dest_1 = location="G:\oracle\oradata\SATI\archive",
valid_for=(ONLINE_LOGFILE,ALL_ROLES)
log_archive_dest_2 =
log_archive_dest_state_1 = ENABLE
log_archive_dest_state_2 = ENABLE
log_archive_max_processes= 2
log_archive_min_succeed_dest= 1
standby_archive_dest =
log_archive_trace = 0
log_archive_format = %t_%s_%r.arc
fal_client =
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME
=SATI_XPT)(INSTANCE_NAME=SATI)(SERVER=dedicated)))
fal_server =
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME
=SATISTD_XPT)(SERVER=dedicated)))
archive_lag_target = 0
db_files = 1024
db_file_multiblock_read_count= 16
db_recovery_file_dest = G:\FRA
db_recovery_file_dest_size= 26843545600
standby_file_management = AUTO
fast_start_mttr_target = 300
undo_management = AUTO
undo_tablespace = UNDOTBS1
undo_retention = 3600
remote_os_authent = TRUE
remote_login_passwordfile= EXCLUSIVE
db_domain =
instance_name = SATI
local_listener = (ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
utl_file_dir = Z:\oracle\admin\SATI\bdump
job_queue_processes = 50
72/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
background_dump_dest = Z:\ORACLE\ADMIN\SATI\BDUMP
user_dump_dest = Z:\ORACLE\ADMIN\SATI\UDUMP
core_dump_dest = Z:\ORACLE\ADMIN\SATI\CDUMP
session_max_open_files = 20
db_name = SATI
db_unique_name = SATI
open_cursors = 1000
star_transformation_enabled= TRUE
query_rewrite_enabled = TRUE
pga_aggregate_target = 524288000
workarea_size_policy = AUTO
dg_broker_start = TRUE
PMON started with pid=2, OS id=2172
PSP0 started with pid=3, OS id=2320
MMAN started with pid=4, OS id=3324
DBW0 started with pid=5, OS id=3820
LGWR started with pid=6, OS id=3244
CKPT started with pid=7, OS id=3984
SMON started with pid=8, OS id=1872
RECO started with pid=9, OS id=3768
CJQ0 started with pid=10, OS id=3988
MMON started with pid=11, OS id=2016
MMNL started with pid=12, OS id=3840
DMON started with pid=13, OS id=3280
Wed Dec 10 17:42:56 2008
alter database mount
Wed Dec 10 17:43:00 2008
Setting recovery target incarnation to 2
ARCH: STARTING ARCH PROCESSES
ARC0 started with pid=15, OS id=888
Wed Dec 10 17:43:00 2008
ARC0: Archival started
ARC1 started with pid=16, OS id=756
Wed Dec 10 17:43:00 2008
ARC1: Archival started
ARCH: STARTING ARCH PROCESSES COMPLETE
Wed Dec 10 17:43:00 2008
ARC0: Becoming the 'no FAL' ARCH
73/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Recovery interrupted!
Wed Dec 10 17:43:49 2008
Errors in file Z:\oracle\admin\SATI\bdump\SATI_mrp0_2548.trc:
ORA-19906: recovery target incarnation changed during recovery
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
DGMGRL CHECKUPS
There are several checkup commands that can be executed from within DGMGRL to obtain the status of each one
of the Dataguard components. If at the last line of the output of any acomponent there is a line having SUCCESS
status, that means the component is healthy.
Configuration
NamZ: fsfodg
Enabled: YES
Protection ModZ: MaxAvailability
Fast-Start Failover: ENABLED
Databases:
SATISTD - Primary database
SATI - Physical standby database
- Fast-Start Failover target
78/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database
NamZ: SATI
RolZ: PHYSICAL STANDBY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATI
Database
NamZ: SATISTD
RolZ: PRIMARY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATISTD
Database
NamZ: SATISTD
RolZ: PRIMARY
79/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATISTD
Database
NamZ: SATI
RolZ: PHYSICAL STANDBY
Enabled: YES
Intended StatZ: ONLINE
80/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Instance(s):
SATI
Properties:
InitialConnectIdentifier = 'SATI'
ObserverConnectIdentifier = ''
LogXptMode = 'SYNC'
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 = 'SATISTD'
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
81/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
HostName = 'DGONE'
SidName = 'SATI'
LocalListenerAddress =
'(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522))'
StandbyArchiveLocation = 'dgsby'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
Database
NamZ: SATISTD
RolZ: PRIMARY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATISTD
Properties:
InitialConnectIdentifier = 'SATISTD'
ObserverConnectIdentifier = ''
LogXptMode = 'SYNC'
Dependency = ''
DelayMins = '0'
Binding = 'OPTIONAL'
82/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
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 = 'SATI'
StatusReport = '(monitor)'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
HostName = 'DGTWO'
SidName = 'SATISTD'
LocalListenerAddress =
'(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522))'
StandbyArchiveLocation = 'G:\oracle\oradata\SATI\archive'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
83/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Properties:
HostName = 'DGONE'
SidName = 'SATI'
LocalListenerAddress =
'(ADDRESS=(PROTOCOL=TCP)(HOST=DGONE)(PORT=1522))'
StandbyArchiveLocation = 'dgsby'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
84/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Properties:
HostName = 'DGTWO'
SidName = 'SATISTD'
LocalListenerAddress =
'(ADDRESS=(PROTOCOL=TCP)(HOST=DGTWO)(PORT=1522))'
StandbyArchiveLocation = 'G:\oracle\oradata\SATI\archive'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
LatestLog = '(monitor)'
TopWaitEvents = '(monitor)'
85/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
On the client side it is very important to set on the ‘sqlnet.ora’ file the parameter
SQLNET.OUTBOUND_CONNECT_TIMEOUT = 3, to assure that the failed connections will not wait for TCP
timeout but will immediately proceed to the next host if the primary is unavailable
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Trigger created.
fsfo =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = DGONE)(PORT = 1522))
(ADDRESS = (PROTOCOL = TCP)(HOST = DGTWO)(PORT = 1522))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA=
(SERVICE_NAME=fsfo)
)
)
SQLNET.OUTBOUND_CONNECT_TIMEOUT = 3
87/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
1. from dgmgrl check that configuration and database status return SUCCESS
DGMGRL> connect sys@SATI
Password:
Connected.
Configuration
NamZ: fsfodg
Enabled: YES
Protection ModZ: MaxAvailability
Fast-Start Failover: ENABLED
Databases:
SATISTD - Physical standby database
- Fast-Start Failover target
SATI - Primary database
Current status for "fsfodg":
SUCCESS
Database
NamZ: SATI
RolZ: PRIMARY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATI
88/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database
NamZ: SATISTD
RolZ: PHYSICAL STANDBY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATISTD
Current status for "SATISTD":
SUCCESS
Database
NamZ: SATI
RolZ: PRIMARY
Enabled: YES
Intended StatZ: ONLINE
Instance(s):
SATI
Current status for "SATI":
SUCCESS
2. Connect from a client server using the ‘fsfo’ service, check the instance namZ:
89/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
INSTANCE_NAME
----------------
SATI
3. From the client server, connected throug the ‘fsfo’ service start a long running query, i.e. ‘select 1,2,3 from
dba_source’ and check how long it takes to complete, you may repeat a couple of times to get it cached and
get the best time.
Elapsed: 00:0:30.12
4. From the client server, connected throug the ‘fsfo’ service issue again the same long running query,
immediately move to the primary database and shut down it using the abort option.
5. The ‘shutdown abort’ triggers a FSFO that will complete in about 30 seconds
90/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
6. At the client screen you will notice that the output from ‘select 1,2,3 from dba_source’ stops and then continue
until finished
INSTANCE_NAME
----------------
SATISTD <<<<<
Elapsed: 00:00:00.07
8. Connect to the failed primary, mount it up and check the FSFO status
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
SQL> /
SQL> /
SQL> /
92/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Database dismounted.
ORACLE instance shut down.
Operation requires shutdown of instance "SATI" on database "SATI"
Shutting down instance "SATI"...
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "SATISTD" on database "SATISTD"
Starting instance "SATISTD"...
ORACLE instance started.
Database mounted.
Operation requires startup of instance "SATI" on database "SATI"
Starting instance "SATI"...
ORACLE instance started.
Database mounted.
Switchover succeeded, new primary is "SATI"
94/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Enter password:
Connected.
SQL> /
95/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
Command Description
alter database force logging; Switch off no logging operations at the database
level
orapwd file=orapwSATI password=<sys_password> Create the password file on the primary database
force=y
alter database add standby logfile group 4 ( Create standby redologs, they need to be the same
'Z:\ORACLE\ORADATA\SATI\STDBYREDOG4_01.LOG', size as online logs, we need to create at least
'X:\ORACLE\ORADATA\SATI\STDBYREDOG4_02.LOG') one standby group more than total number of online
SIZE 104857600; groups.
startup mount; Mount the database, enable archive log mode and
alter database archivelog; open the database
alter database open;
oradim –NEW –SID SATISTD –STARTMODE Create a database service on Windows
manual
alter database create standby Create a stnadby controlfile on the primary
controlfile as 'c:\SATISTD.ctl'; database, to be copied to the standby
create pfile='c:\standby_pfile.ora' from Create a pfile from the primary database to be
spfile; edited for the physical standby
create spfile from pfile='c:\standby_pfile.txt'; Create an spfile on the default location,
?/database on windows
alter database recover managed standby database Start recovery on the physical standby
disconnect from session;
select sequence#, first_time, next_time from Check redo apply on the physical standby
v$archived_log order by sequence#;
alter system set dg_broker_start=true Enable the dataguard broker
scope=both;
dgmgrl sys/<passwd>@SATISTD Connect to the broker command line utility dgmgrl
96/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
create configuration fsfodg as primary database Create Dataguard configuration form dgmngrl
is SATI connect identifier is SATI;
add database SATISTD as connect identifier is Add database to the broker configuration
SATISTD maintained as physical;
show configuration; show broker configuration and status
show database verbose SATISTD; Show broker database configuration
show instance verbose SATISTD; Show broker instance configuration
enable configuration; Enable broker configuration
enable database SATISTD; Enable database in broker configuration
edit database SATI set property Set database property logxptmode to sync on
'logxptmode'='sync'; broker, to enable FSFO
edit configuration set protection mode as Change configuration protection mode to max
maxavailability; availability, to enable FSFO
enable fast_start failover; Enable FSFO
select db_unique_name, database_role, open_mode, Check FSFO status on both Primary and Standby
fs_failover_status, fs_failover_current_target Databases
from v$database;
switchover to SATISTD; From within DGMGRL start switchover
97/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
References
1. Switchover and Failover Best Practices: Oracle Data Guard 10g Release 2
http://www.oracle.com/technology/deploy/availability/pdf/MAA_WP_10gR2_FastStartFailoverBestPractices.pdf
7. Oracle Database Oracle Clusterware and Oracle Real Application Clusters Administration and Deployment
Guide (Part #14197)
http://download-west.oracle.com/docs/cd/B19306_01/rac.102/b14197/toc.htm
8. Workload Management with Oracle Real Application Clusters 10g (Provides a detailed explanation of the
implementation of Services, FAN and Fast Connection Failover in a RAC environment.):
http://www.oracle.com/technology/products/database/clustering/pdf/twpracwkldmgmt.pdf
98/99
/
DATAGUARD FAST START FAILOVER IMPLEMENTATION
10. Oracle Database PL/SQL Packages and Types Reference (Part #B14261)
http://otn.oracle.com/pls/db102/db102.to_toc?partno=b14261
99/99