/*
|| Oracle 11g DataGuard Listing 2
||
|| Demonstrates how to set up and utilize Data Guard Broker features
|| in Oracle Database 11g, including:
|| - Configuration of standby redo logs on the standby database
|| - Configuration of the primary and standby databases to ensure successful 
||   setup of Data Guard Broker
|| - Data Guard Broker configuration on primary and standby database servers
|| - Using Data Guard Broker to perform a switchover operation
|| - Using Data Guard Broker to perform a switchback operation
||
|| Author: Jim Czuprynski
||
|| Usage Notes:
|| These examples are provided to demonstrate various features of Oracle 11gR1
|| Data Guard features, and they should be carefully proofread before being executed 
|| against any existing Oracle database to avoid potential damage!
*/

/* 
|| Listing 2.1:
|| Completing standby redo logs configuration
*/

----- 
-- Add standby redo logs on the standby site ...
-----
ALTER DATABASE
    ADD STANDBY LOGFILE
    '/u01/app/oracle/oradata/stdby/srl01.log'
    SIZE 50M 
    REUSE;

ALTER DATABASE
    ADD STANDBY LOGFILE
    '/u01/app/oracle/oradata/stdby/srl02.log'
    SIZE 50M 
    REUSE;

ALTER DATABASE
    ADD STANDBY LOGFILE
    '/u01/app/oracle/oradata/stdby/srl03.log'
    SIZE 50M 
    REUSE;

ALTER DATABASE
    ADD STANDBY LOGFILE
    '/u01/app/oracle/oradata/stdby/srl04.log'
    SIZE 50M 
    REUSE;

----- 
-- ...and add one more standby redo log group on the primary site....
-----
ALTER DATABASE
    ADD STANDBY LOGFILE
    '/u01/app/oracle/oradata/orcl/srl04.log'
    SIZE 50M 
    REUSE;

/* 
|| Listing 2.2:
|| Reconfiguring the primary and standby servers
*/

-----
-- Primary database initialization parameter changes
-----

ALTER SYSTEM SET dg_broker_start = TRUE;
ALTER SYSTEM SET log_archive_config='(DG_CONFIG=(primary_db,stdby_db)';
ALTER SYSTEM SET log_archive_dest_1 = 
    'LOCATION=/u01/app/oracle/flash_recovery_area/ORCL/ DB_UNIQUE_NAME=primary_db VALID_FOR=(ALL_LOGFILES,ALL_ROLES)';
ALTER SYSTEM SET log_archive_dest_2 = 
    'SERVICE=stdby ASYNC DB_UNIQUE_NAME=stdby_db VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE)';

-----
-- Standby database initialization parameter changes
-----

ALTER SYSTEM SET dg_broker_start = TRUE;
ALTER SYSTEM SET log_archive_config='(DG_CONFIG=(primary_db,stdby_db)';
ALTER SYSTEM SET log_archive_dest_1 = 
    'LOCATION=/u01/app/oracle/flash_recovery_area/STDBY/ DB_UNIQUE_NAME=stdby_db VALID_FOR=(ALL_LOGFILES,ALL_ROLES)';
ALTER SYSTEM SET log_archive_dest_2 = 
    'SERVICE=stdby ASYNC DB_UNIQUE_NAME=primary_db VALID_FOR=(ONLINE_LOGFILE,PRIMARY_ROLE)';

-----
-- Primary database LISTENER.ORA changes
-----

SID_LIST_LISTENER =
    (SID_LIST =
        (SID_DESC =
            (GLOBAL_DBNAME = primary_db_DGMGRL)
            (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
            (SID_NAME = orcl)
        )
    )

-----
-- Standby database LISTENER.ORA changes
-----

SID_LIST_LISTENER =
    (SID_LIST =
        (SID_DESC =
            (GLOBAL_DBNAME = standby_db_DGMGRL)
            (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
            (SID_NAME = stdby)
        )
    )

-----
-- Primary and standby database TNSNAMES.ORA changes
-----

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 11gPrimary)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = primary_db)
    )
  )

STDBY =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 11gStdby)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = stdby_db)
    )
  )


/* 
|| Listing 2.3:
|| Enabling the Data Guard Broker configuration
*/

-----
-- Results of enabling the MAA_ORCL Data Guard Broker configuration on the primary database ...
-----
. . .
NSV1 started with pid=29, OS id=20923 
Tue May 12 19:31:24 2009
RSM0 started with pid=36, OS id=21129 
ALTER SYSTEM SET log_archive_dest_2='service="stdby"','   ARCH SYNC NOAFFIRM delay=0 OPTIONAL compression=DISABLE max_failure=0 max_connections=1   reopen=0 db_unique_name="stdby_db" net_timeout=30  valid_for=(online_logfile,primary_role)' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_1='location="/u01/app/oracle/flash_recovery_area/ORCL/"','valid_for=(ALL_LOGFILES,ALL_ROLES)' SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_dest_state_1='ENABLE' SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_format='log_%s_%t_%r.arc' SCOPE=SPFILE SID='orcl';
ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH SID='*';
ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_archive_max_processes=4 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_archive_dest_2='service="stdby"','   ARCH SYNC NOAFFIRM delay=0 OPTIONAL compression=DISABLE max_failure=0 max_connections=1   reopen=0 db_unique_name="stdby_db" net_timeout=30  valid_for=(online_logfile,primary_role)' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
. . .

-----
-- ... and on the standby database.
-----
. . .
Starting Data Guard Broker (DMON)
Tue May 12 19:40:56 2009
NSV0 started with pid=24, OS id=6193 
Tue May 12 19:41:00 2009
INSV started with pid=25, OS id=6195 
Tue May 12 19:41:09 2009
alter database recover managed standby database disconnect
Attempt to start background Managed Standby Recovery process (orcl)
Tue May 12 19:41:09 2009
MRP0 started with pid=26, OS id=6197 
MRP0: Background Managed Standby Recovery process started (orcl)
Fast Parallel Media Recovery enabled
Managed Standby Recovery not using Real Time Apply
 parallel recovery started with 2 processes
Waiting for all non-current ORLs to be archived...
Media Recovery Waiting for thread 1 sequence 126
Completed: alter database recover managed standby database disconnect
Tue May 12 19:43:21 2009
RSM0 started with pid=30, OS id=6209 
Using STANDBY_ARCHIVE_DEST parameter default value as /u01/app/oracle/flash_recovery_area/STDBY/
ALTER SYSTEM SET log_archive_dest_3='location="/u01/app/oracle/product/11.1.0/db_1/dbs/arch"','valid_for=(STANDBY_LOGFILE,STANDBY_ROLE)' SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_dest_state_3='ENABLE' SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_format='log_%s_%t_%r.arc' SCOPE=SPFILE SID='orcl';
ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH SID='*';
ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_archive_max_processes=4 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_file_name_convert='/u01/app/oracle/oradata/orcl/','/u01/app/oracle/oradata/stdby/' SCOPE=SPFILE;
ALTER SYSTEM SET fal_server='orcl' SCOPE=BOTH;
ALTER SYSTEM SET fal_client='stdby' SCOPE=BOTH;
. . .

/* 
|| Listing 2.4:
|| Performing a switchover using Data Guard Broker
*/

-----
-- Results of the switchover operation from the "original" primary database's alert log ...
-----
. . .
Tue May 12 21:06:49 2009
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY (orcl)
Tue May 12 21:06:50 2009
Thread 1 advanced to log sequence 129
  Current log# 3 seq# 129 mem# 0: /u01/app/oracle/oradata/orcl/redo03.log
Waiting for all non-current ORLs to be archived...
Tue May 12 21:07:21 2009
ARC3: Standby redo logfile selected for thread 1 sequence 128 for destination LOG_ARCHIVE_DEST_2
Tue May 12 21:07:31 2009
Stopping background process CJQ0
Tue May 12 21:07:31 2009
SMON: disabling tx recovery
Tue May 12 21:07:31 2009
Stopping background process QMNC
Tue May 12 21:08:51 2009
ORA-1089 : opidrv aborting process W000 ospid (26920_3083204288)
All dispatchers and shared servers shutdown
Active process 17194 user 'oracle' program 'oracle@11gPrimary (FBDA)'
Active process 17194 user 'oracle' program 'oracle@11gPrimary (FBDA)'
Active process 16978 user 'oracle' program 'oracle@11gPrimary (TNS V1-V3)'
CLOSE: waiting for server sessions to complete.
Stopping background process FBDA
CLOSE: all sessions shutdown successfully.
SMON: disabling cache recovery
. . .
<< results truncated for brevity's sake >>
. . .
Switchover: Complete - Database shutdown required (orcl)
Completed: ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN
. . .
<< results truncated for brevity's sake >>
. . .
Tue May 12 21:20:10 2009
Starting ORACLE instance (normal)
Tue May 12 21:20:21 2009
alter database recover managed standby database
Media Recovery Start: Managed Standby Recovery (orcl)
Fast Parallel Media Recovery NOT enabled
Managed Standby Recovery not using Real Time Apply
Media Recovery Log /u01/app/oracle/flash_recovery_area/ORCL/log_130_1_682541003.arc
Media Recovery Log /u01/app/oracle/flash_recovery_area/ORCL/log_131_1_682541003.arc
Media Recovery Waiting for thread 1 sequence 132 (in transit)
Tue May 12 21:22:44 2009
Recovery interrupted!
Media Recovery user canceled with status 1013
ORA-16043 signalled during: alter database recover managed standby database...
Shutting down instance: further logons disabled
Stopping background process MMNL
Stopping background process MMON
Shutting down instance (immediate)
License high water mark = 9
Tue May 12 21:23:09 2009
ORA-1089 : opidrv aborting process unknown ospid (1964_3086882496)
Tue May 12 21:23:24 2009
ORA-1089 : opidrv aborting process unknown ospid (1235_3086882496)
Tue May 12 21:23:40 2009
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL
ORA-1109 signalled during: ALTER DATABASE CLOSE NORMAL...
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Shutting down Data Guard Broker processes
Tue May 12 21:23:45 2009
Completed: Data Guard Broker shutdown
ARCH: Archival disabled due to shutdown: 1089
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Tue May 12 21:23:47 2009
Stopping background process VKTM: 
Tue May 12 21:23:51 2009
Instance shutdown complete
Tue May 12 21:24:11 2009
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 =18
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Tue May 12 21:24:24 2009
Starting up ORACLE RDBMS Version: 11.1.0.6.0.
Using parameter settings in server-side spfile /u01/app/oracle/product/11.1.0/db_1/dbs/spfileorcl.ora
System parameters with non-default values:
  processes                = 150
  sga_target               = 400M
  control_files            = "/u01/app/oracle/oradata/orcl/control01.ctl"
  control_files            = "/u01/app/oracle/oradata/orcl/control02.ctl"
  control_files            = "/u01/app/oracle/oradata/orcl/control03.ctl"
. . .
<< results truncated for brevity's sake >>
. . .
Tue May 12 21:24:44 2009
ARC3 started with pid=23, OS id=3141 
ARC3: Thread not mounted
ARC2: Thread not mounted
Successful mount of redo thread 1, with mount id 1214475032
Physical Standby Database mounted.
Lost write protection disabled
Completed: ALTER DATABASE   MOUNT
Starting Data Guard Broker (DMON)
Tue May 12 21:24:46 2009
NSV1 started with pid=24, OS id=3205 
Tue May 12 21:25:21 2009
INSV started with pid=26, OS id=3353 
Tue May 12 21:26:42 2009
RSM0 started with pid=27, OS id=3355 
Using STANDBY_ARCHIVE_DEST parameter default value as /u01/app/oracle/flash_recovery_area/ORCL/
Tue May 12 21:26:48 2009
NSV1 started with pid=28, OS id=3357 
. . .

-----
-- ... and from the alert log of the "original" standby database, now the new primary database.
-----
. . .
Tue May 12 21:09:42 2009
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
RFS[6]: Assigned to RFS process 6386
RFS[6]: Identified database type as 'physical standby'
Tue May 12 21:09:48 2009
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
Tue May 12 21:09:49 2009
MRP0: Background Media Recovery cancelled with status 16037
Errors in file /u01/app/oracle/diag/rdbms/stdby_db/orcl/trace/orcl_mrp0_6211.trc:
ORA-16037: user requested cancel of managed recovery operation
Managed Standby Recovery not using Real Time Apply
Shutting down recovery slaves due to error 16037
Recovery interrupted!
Waiting for MRP0 pid 6211 to terminate
Errors in file /u01/app/oracle/diag/rdbms/stdby_db/orcl/trace/orcl_mrp0_6211.trc:
ORA-16037: user requested cancel of managed recovery operation
MRP0: Background Media Recovery process shutdown (orcl)
Managed Standby Recovery Canceled (orcl)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH LAST SWITCHOVER NODELAY
Media Recovery Start: Managed Standby Recovery (orcl)
Fast Parallel Media Recovery enabled
Managed Standby Recovery not using Real Time Apply
Media Recovery Log /u01/app/oracle/flash_recovery_area/STDBY/log_129_1_682541003.arc
Identified End-Of-Redo for thread 1 sequence 129
Resetting standby activation ID 1210295112 (0x4823a348)
Media Recovery End-Of-Redo indicator encountered
Media Recovery Applied through change 4101766
Media Recovery Complete: End-Of-REDO (orcl)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH LAST SWITCHOVER NODELAY
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
ALTER DATABASE SWITCHOVER TO PRIMARY (orcl)
Maximum wait for role transition is 15 minutes.
Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/stdby_db/orcl/trace/orcl_rsm0_6209.trc
SwitchOver after complete recovery through change 4101766
Online log /u01/app/oracle/oradata/stdby/redo01.log: Thread 1 Group 1 was previously cleared
Online log /u01/app/oracle/oradata/stdby/redo02.log: Thread 1 Group 2 was previously cleared
Online log /u01/app/oracle/oradata/stdby/redo03.log: Thread 1 Group 3 was previously cleared
Standby became primary SCN: 4101764
Converting standby mount to primary mount.
Switchover: Complete - Database mounted as primary (orcl)
Completed: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
. . .

/* 
|| Listing 2.5:
|| Performing a switchback using Data Guard Broker
*/

-----
-- Results of the switchover operation from the "new" primary database's alert log ...
-----
. . .
Tue May 12 21:33:20 2009
Redo Shipping Client Connected as PUBLIC
-- Connected User is Valid
Tue May 12 21:34:52 2009
LOG_ARCHIVE_DEST_2 is a potential switchover target
Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/stdby_db/orcl/trace/orcl_rsm0_6209.trc
Clearing standby activation ID 1214508480 (0x4863edc0)
The primary database controlfile was created using the
'MAXLOGFILES 16' clause.
There is space for up to 13 standby redo logfiles
Use the following SQL commands on the standby database to create
standby redo logfiles that match the primary database:
ALTER DATABASE ADD STANDBY LOGFILE 'srl1.f' SIZE 52428800;
ALTER DATABASE ADD STANDBY LOGFILE 'srl2.f' SIZE 52428800;
ALTER DATABASE ADD STANDBY LOGFILE 'srl3.f' SIZE 52428800;
ALTER DATABASE ADD STANDBY LOGFILE 'srl4.f' SIZE 52428800;
Archivelog for thread 1 sequence 136 required for standby recovery
Tue May 12 21:34:52 2009
MRP0 started with pid=19, OS id=6512 
MRP0: Background Managed Standby Recovery process started (orcl)
Fast Parallel Media Recovery NOT enabled
Managed Standby Recovery not using Real Time Apply
 parallel recovery started with 2 processes
Online logfile pre-clearing operation disabled by switchover
Media Recovery Log /u01/app/oracle/flash_recovery_area/STDBY/log_136_1_682541003.arc
Identified End-Of-Redo for thread 1 sequence 136
Resetting standby activation ID 1214508480 (0x4863edc0)
Media Recovery End-Of-Redo indicator encountered
Media Recovery Applied until change 4102948
MRP0: Media Recovery Complete: End-Of-REDO (orcl)
MRP0: Background Media Recovery process shutdown (orcl)
Waiting for MRP0 pid 6512 to terminate
Switchover: Complete - Database shutdown required (orcl)
Completed: ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY WITH SESSION SHUTDOWN
ALTER SYSTEM SET log_archive_dest_2='' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
Tue May 12 21:35:44 2009
Shutting down instance: further logons disabled
. . .
<< results truncated for brevity's sake >>
. . .
Tue May 12 21:36:24 2009
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 =18
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Tue May 12 21:36:36 2009
Starting up ORACLE RDBMS Version: 11.1.0.6.0.
Using parameter settings in server-side pfile /u01/app/oracle/product/11.1.0/db_1/dbs/initorcl.ora
System parameters with non-default values:
  processes                = 150
  spfile                   = "/u01/app/oracle/product/11.1.0/db_1/dbs/spfilestdby.ora"
  sga_target               = 400M
  control_files            = "/u01/app/oracle/oradata/orcl/control01.ctl"
  log_file_name_convert    = "/u01/app/oracle/oradata/orcl/"
  log_file_name_convert    = "/u01/app/oracle/oradata/stdby/"
. . .
<< results truncated for brevity's sake >>
. . .

DMON started with pid=18, OS id=6589 
Tue May 12 21:36:49 2009
ALTER DATABASE   MOUNT
Setting recovery target incarnation to 2
ARCH: STARTING ARCH PROCESSES
Tue May 12 21:36:53 2009
ARC0 started with pid=20, OS id=6596 
Tue May 12 21:36:53 2009
ARC1 started with pid=21, OS id=6598 
Tue May 12 21:36:53 2009
ARC2 started with pid=22, OS id=6600 
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
ARC3: Archival started
ARCH: STARTING ARCH PROCESSES COMPLETE
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC1: Thread not mounted
ARC2: Becoming the heartbeat ARCH
ARC0: Thread not mounted
Tue May 12 21:36:54 2009
ARC3 started with pid=23, OS id=6602 
ARC2: Thread not mounted
Successful mount of redo thread 1, with mount id 1214531057
Physical Standby Database mounted.
Lost write protection disabled
Completed: ALTER DATABASE   MOUNT
Starting Data Guard Broker (DMON)
Tue May 12 21:36:57 2009
NSV0 started with pid=25, OS id=6607 
. . .

-----
-- ... and from the alert log of the "original" primary database.
-----

. . .
Tue May 12 21:33:43 2009
Media Recovery Log /u01/app/oracle/flash_recovery_area/ORCL/log_136_1_682541003.arc
Identified End-Of-Redo for thread 1 sequence 136
Resetting standby activation ID 1214508480 (0x4863edc0)
Media Recovery End-Of-Redo indicator encountered
Media Recovery Continuing
Resetting standby activation ID 1214508480 (0x4863edc0)
Media Recovery Waiting for thread 1 sequence 137
Tue May 12 21:33:48 2009
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
MRP0: Background Media Recovery cancelled with status 16037
Errors in file /u01/app/oracle/diag/rdbms/primary_db/orcl/trace/orcl_mrp0_3458.trc:
ORA-16037: user requested cancel of managed recovery operation
Managed Standby Recovery not using Real Time Apply
Shutting down recovery slaves due to error 16037
Recovery interrupted!
Waiting for MRP0 pid 3458 to terminate
Errors in file /u01/app/oracle/diag/rdbms/primary_db/orcl/trace/orcl_mrp0_3458.trc:
ORA-16037: user requested cancel of managed recovery operation
MRP0: Background Media Recovery process shutdown (orcl)
Managed Standby Recovery Canceled (orcl)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
ALTER DATABASE SWITCHOVER TO PRIMARY (orcl)
Maximum wait for role transition is 15 minutes.
Backup controlfile written to trace file /u01/app/oracle/diag/rdbms/primary_db/orcl/trace/orcl_rsm0_3355.trc
SwitchOver after complete recovery through change 4102948
Online log /u01/app/oracle/oradata/orcl/redo01.log: Thread 1 Group 1 was previously cleared
Online log /u01/app/oracle/oradata/orcl/redo02.log: Thread 1 Group 2 was previously cleared
Online log /u01/app/oracle/oradata/orcl/redo03.log: Thread 1 Group 3 was previously cleared
Standby became primary SCN: 4102946
Converting standby mount to primary mount.
Switchover: Complete - Database mounted as primary (orcl)
Completed: ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WAIT WITH SESSION SHUTDOWN
Tue May 12 21:33:49 2009
ARC1: STARTING ARCH PROCESSES
ARC4: Archival started
ARC1: STARTING ARCH PROCESSES COMPLETE
ARC1: Becoming the 'no SRL' ARCH
Tue May 12 21:33:49 2009
ARC4 started with pid=24, OS id=4526 
Tue May 12 21:35:50 2009
ALTER SYSTEM SET log_archive_dest_2='service="stdby"','   ARCH SYNC NOAFFIRM delay=0 OPTIONAL compression=DISABLE max_failure=0 max_connections=1   reopen=0 db_unique_name="stdby_db" net_timeout=30  valid_for=(online_logfile,primary_role)' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
ALTER DATABASE OPEN
Tue May 12 21:35:50 2009
Assigning activation ID 1214475032 (0x48636b18)
Thread 1 opened at log sequence 137
  Current log# 1 seq# 137 mem# 0: /u01/app/oracle/oradata/orcl/redo01.log
Successful open of redo thread 1
MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set
Tue May 12 21:35:51 2009
SMON: enabling cache recovery
Successfully onlined Undo Tablespace 2.
Dictionary check beginning
Dictionary check complete
Verifying file header compatibility for 11g tablespace encryption..
Verifying 11g file header compatibility for tablespace encryption completed
SMON: enabling tx recovery
Database Characterset is AL32UTF8
Opening with internal Resource Manager plan
Starting background process FBDA
Starting background process SMCO
Tue May 12 21:35:54 2009
FBDA started with pid=29, OS id=4627 
Tue May 12 21:35:55 2009
SMCO started with pid=30, OS id=4629 
replication_dependency_tracking turned off (no async multimaster replication found)
Starting background process QMNC
Tue May 12 21:35:57 2009
QMNC started with pid=31, OS id=4631 
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
Tue May 12 21:36:08 2009
db_recovery_file_dest_size of 8192 MB is 40.51% used. This is a
user-specified limit on the amount of space that will be used by this
database for recovery-related files, and does not reflect the amount of
space available in the underlying filesystem or ASM diskgroup.
Tue May 12 21:36:26 2009
Completed: ALTER DATABASE OPEN
Tue May 12 21:36:26 2009
Shutting down archive processes
ALTER SYSTEM SET log_archive_dest_1='location="/u01/app/oracle/flash_recovery_area/ORCL/"','valid_for=(ALL_LOGFILES,ALL_ROLES)' SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_dest_state_1='ENABLE' SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='orcl';
ALTER SYSTEM SET log_archive_format='log_%s_%t_%r.arc' SCOPE=SPFILE SID='orcl';
ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH SID='*';
ALTER SYSTEM SET archive_lag_target=0 SCOPE=BOTH SID='*';
ARCH shutting down
ARC4: Archival stopped
ALTER SYSTEM SET log_archive_max_processes=4 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_archive_min_succeed_dest=1 SCOPE=BOTH SID='*';
ALTER SYSTEM SET log_archive_dest_2='service="stdby"','   ARCH SYNC NOAFFIRM delay=0 OPTIONAL compression=DISABLE max_failure=0 max_connections=1   reopen=0 db_unique_name="stdby_db" net_timeout=30  valid_for=(online_logfile,primary_role)' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
Tue May 12 21:36:32 2009
Thread 1 advanced to log sequence 138
  Current log# 2 seq# 138 mem# 0: /u01/app/oracle/oradata/orcl/redo02.log
Tue May 12 21:37:51 2009
ARC2: Standby redo logfile selected for thread 1 sequence 137 for destination LOG_ARCHIVE_DEST_2
Tue May 12 21:37:57 2009
NSV1 started with pid=25, OS id=5055 
. . .