Data Guard
11G New Feature : Active Dataguard Create a Data Guard Broker Configuration with a read only physical standby
User Rating: / 1
- Details
-
Parent Category: Articles
-
Created on Friday, 23 September 2011 17:08
-
Last Updated on Monday, 12 March 2012 13:54
-
Published on Friday, 23 September 2011 17:08
-
Written by Guy Lambregts
-
Hits: 6103
11G New Feature : Active Dataguard Create a Data Guard Broker Configuration with a read only physical standby.
1. Move password file and spfile towards standby database server %ORACLE_HOME%\database ( or $ORACLE_HOME/dbs )
2. Configure tnsnames to primary database and standby database on both primary database server and standby database server
3. Create a full backup of your primary database using RMAN on a file system also accessible from your standby database server
4. Create a backup standby control file using RMAN on a file system also accessible from your standby database server ( see below )
5. Restore the database on the standby server as a standby database
6. Configure dg_broker_start and db_unique_name
7. Create a Data Guard Broker Conifguration
8. Monitor and troubleshoot replication initialization
9. Post configuration tasks.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 626327552 bytes
Fixed Size 2229080 bytes
Variable Size 369101992 bytes
Database Buffers 247463936 bytes
Redo Buffers 7532544 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@pcguy dbs]$ rman target sys/palladium@SILVER
Recovery Manager: Release 11.2.0.2.0 - Production on Fri Sep 23 16:00:57 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: SILVER (DBID=2121303953)
RMAN> connect auxiliary /
connected to auxiliary database: SILVER (not mounted)
RMAN> run {
2> allocate auxiliary channel ch1 device type disk;
3> allocate auxiliary channel ch2 device type disk;
4> duplicate target database for standby;
5> }
using target database control file instead of recovery catalog
allocated channel: ch1
channel ch1: SID=134 device type=DISK
allocated channel: ch2
channel ch2: SID=10 device type=DISK
Starting Duplicate Db at 23-SEP-11
contents of Memory Script:
{
restore clone standby controlfile;
}
executing Memory Script
Starting restore at 23-SEP-11
channel ch1: starting datafile backup set restore
channel ch1: restoring control file
channel ch1: reading from backup piece /opt/flash_recovery_area/backup/SILVER/CT_STANDBY_SILVER_59mn9ddf_1_1
channel ch1: piece handle=/opt/flash_recovery_area/backup/SILVER/CT_STANDBY_SILVER_59mn9ddf_1_1 tag=TAG20110923T155007
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:01
output file name=/opt/oradata/GOLD/control01.ctl
Finished restore at 23-SEP-11
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of Memory Script:
{
set newname for tempfile 1 to
"/opt/oradata/GOLD/temp01.dbf";
switch clone tempfile all;
set newname for datafile 1 to
"/opt/oradata/GOLD/system01.dbf";
set newname for datafile 2 to
"/opt/oradata/GOLD/sysaux01.dbf";
set newname for datafile 3 to
"/opt/oradata/GOLD/undotbs01.dbf";
set newname for datafile 4 to
"/opt/oradata/GOLD/users01.dbf";
restore
clone database
;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /opt/oradata/GOLD/temp01.dbf in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 23-SEP-11
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00001 to /opt/oradata/GOLD/system01.dbf
channel ch1: restoring datafile 00003 to /opt/oradata/GOLD/undotbs01.dbf
channel ch1: reading from backup piece /opt/flash_recovery_area/backup/SILVER/DB_SILVER_51mn9cpr_1_1
channel ch2: starting datafile backup set restore
channel ch2: specifying datafile(s) to restore from backup set
channel ch2: restoring datafile 00002 to /opt/oradata/GOLD/sysaux01.dbf
channel ch2: restoring datafile 00004 to /opt/oradata/GOLD/users01.dbf
channel ch2: reading from backup piece /opt/flash_recovery_area/backup/SILVER/DB_SILVER_50mn9cpr_1_1
channel ch1: piece handle=/opt/flash_recovery_area/backup/SILVER/DB_SILVER_51mn9cpr_1_1 tag=TAG20110923T153938
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:02:55
channel ch2: piece handle=/opt/flash_recovery_area/backup/SILVER/DB_SILVER_50mn9cpr_1_1 tag=TAG20110923T153938
channel ch2: restored backup piece 1
channel ch2: restore complete, elapsed time: 00:04:55
Finished restore at 23-SEP-11
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=762624406 file name=/opt/oradata/GOLD/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=762624406 file name=/opt/oradata/GOLD/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=762624406 file name=/opt/oradata/GOLD/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=762624406 file name=/opt/oradata/GOLD/users01.dbf
Finished Duplicate Db at 23-SEP-11
released channel: ch1
released channel: ch2
RMAN> exit.
At level of both primary and standby database we enable the DG Broker
SQL> alter system set dg_broker_start=true scope=both;
System altered.
ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH;
Starting Data Guard Broker (DMON)
Fri Sep 23 16:13:02 2011
INSV started with pid=34, OS id=9914
Fri Sep 23 16:13:04 2011
ALTER SYSTEM SET dg_broker_start=TRUE SCOPE=BOTH;
We create a Data Guard Broker Configuration.
[oracle@pcguy dbs]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> create configuration 'SILVER_STANDBY' as primary database is 'SILVER' connect identifier is SILVER;
Configuration "SILVER_STANDBY" created with primary database "SILVER"
DGMGRL> add database 'GOLD' as connect identifier is GOLD maintained as physical;
Database "GOLD" added
DGMGRL> show configuration;
Configuration - SILVER_STANDBY
Protection Mode: MaxPerformance
Databases:
SILVER - Primary database
GOLD - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
DISABLED
DGMGRL> enable configuration;
Enabled.
Using STANDBY_ARCHIVE_DEST parameter default value as USE_DB_RECOVERY_FILE_DEST
Fri Sep 23 16:17:34 2011
ALTER SYSTEM SET log_archive_config='dg_config=(GOLD,SILVER)' SCOPE=BOTH;
Fri Sep 23 16:17:34 2011
NSV0 started with pid=20, OS id=10026
Fri Sep 23 16:17:37 2011
RSM0 started with pid=25, OS id=10038
ALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='GOLD';
ALTER SYSTEM SET log_archive_format='%t_%s_%r.dbf' SCOPE=SPFILE SID='GOLD';
ALTER SYSTEM SET standby_file_management='MANUAL' 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 db_file_name_convert='/opt/oradata/SILVER','/opt/oradata/GOLD' SCOPE=SPFILE;
ALTER SYSTEM SET log_file_name_convert='/opt/oradata/SILVER','/opt/oradata/GOLD' SCOPE=SPFILE;
ALTER SYSTEM SET fal_server='silver' SCOPE=BOTH;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT NODELAY
Attempt to start background Managed Standby Recovery process (GOLD)
Fri Sep 23 16:17:42 2011
MRP0 started with pid=26, OS id=10044
MRP0: Background Managed Standby Recovery process started (GOLD)
Fri Sep 23 16:17:47 2011
Primary database is in MAXIMUM PERFORMANCE mode
started logmerger process
RFS[1]: Assigned to RFS process 10048
RFS[1]: No standby redo logfiles created
Fri Sep 23 16:17:47 2011
Managed Standby Recovery not using Real Time Apply
RFS[1]: Opened log for thread 1 sequence 263 dbid 2121303953 branch 751381589
Parallel Media Recovery started with 2 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Fri Sep 23 16:17:48 2011
RFS[2]: Assigned to RFS process 10060
RFS[2]: Opened log for thread 1 sequence 262 dbid 2121303953 branch 751381589
Media Recovery Waiting for thread 1 sequence 259
Fetching gap sequence in thread 1, gap sequence 259-261
Fri Sep 23 16:17:49 2011
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT NODELAY
Archived Log entry 1 added for thread 1 sequence 262 rlc 751381589 ID 0x7ecb6aa4 dest 2:
Archived Log entry 2 added for thread 1 sequence 263 rlc 751381589 ID 0x7ecb6aa4 dest 2:
RFS[1]: No standby redo logfiles created
RFS[1]: Opened log for thread 1 sequence 264 dbid 2121303953 branch 751381589
Fri Sep 23 16:17:58 2011
Fetching gap sequence in thread 1, gap sequence 259-261
Fri Sep 23 16:18:08 2011
Fetching gap sequence in thread 1, gap sequence 259-261
Fri Sep 23 16:18:18 2011
Fetching gap sequence in thread 1, gap sequence 259-261
Fri Sep 23 16:18:28 2011
Fetching gap sequence in thread 1, gap sequence 259-261
Fri Sep 23 16:18:38 2011
Fetching gap sequence in thread 1, gap sequence 259-261
Fri Sep 23 16:18:48 2011
Fetching gap sequence in thread 1, gap sequence 259-261.
On the primary database we restore the missing log sequences using RMAN.
[oracle@pcguy dbs]$ rman target /
Recovery Manager: Release 11.2.0.2.0 - Production on Fri Sep 23 16:19:13 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: SILVER (DBID=2121303953)
RMAN> restore archivelog from sequence 259 until sequence 261;
Starting restore at 23-SEP-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=259
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=260
channel ORA_DISK_1: reading from backup piece /opt/flash_recovery_area/backup/SILVER/AL_SILVER_55mn9d3c_1_1
channel ORA_DISK_1: piece handle=/opt/flash_recovery_area/backup/SILVER/AL_SILVER_55mn9d3c_1_1 tag=TAG20110923T154443
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=261
channel ORA_DISK_1: reading from backup piece /opt/flash_recovery_area/backup/SILVER/AL_SILVER_56mn9d3r_1_1
channel ORA_DISK_1: piece handle=/opt/flash_recovery_area/backup/SILVER/AL_SILVER_56mn9d3r_1_1 tag=TAG20110923T154443
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 23-SEP-11.
RFS[2]: Opened log for thread 1 sequence 260 dbid 2121303953 branch 751381589
Archived Log entry 3 added for thread 1 sequence 260 rlc 751381589 ID 0x0 dest 2:
Fri Sep 23 16:19:53 2011
RFS[3]: Assigned to RFS process 10064
RFS[3]: Opened log for thread 1 sequence 259 dbid 2121303953 branch 751381589
Archived Log entry 4 added for thread 1 sequence 259 rlc 751381589 ID 0x0 dest 2:
Fri Sep 23 16:20:01 2011
Media Recovery Log /opt/flash_recovery_area/GOLD/archivelog/2011_09_23/o1_mf_1_259_77s5d944_.arc
Media Recovery Log /opt/flash_recovery_area/GOLD/archivelog/2011_09_23/o1_mf_1_260_77s5d7n7_.arc
Fri Sep 23 16:20:14 2011
Media Recovery Waiting for thread 1 sequence 261
Fetching gap sequence in thread 1, gap sequence 261-261
Fri Sep 23 16:20:15 2011
RFS[4]: Assigned to RFS process 10133
RFS[4]: Opened log for thread 1 sequence 261 dbid 2121303953 branch 751381589
Archived Log entry 5 added for thread 1 sequence 261 rlc 751381589 ID 0x0 dest 2:
Fri Sep 23 16:20:25 2011
Media Recovery Log /opt/flash_recovery_area/GOLD/archivelog/2011_09_23/o1_mf_1_261_77s5dz3n_.arc
Media Recovery Log /opt/flash_recovery_area/GOLD/archivelog/2011_09_23/o1_mf_1_262_77s58dg4_.arc
Media Recovery Log /opt/flash_recovery_area/GOLD/archivelog/2011_09_23/o1_mf_1_263_77s58cdd_.arc
Media Recovery Waiting for thread 1 sequence 264 (in transit).
Adding standby redo logs and standby file management auto. On the primary database server, verify standby file management.
[oracle@pcguy dbs]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> edit database 'GOLD' set state = 'LOG-APPLY-OFF';
Succeeded.
On the standby database
[oracle@pcguy dbs]$ export ORACLE_SID=GOLD
[oracle@pcguy dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 23 16:25:56 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select bytes/(1024*1024) from v$log;
BYTES/(1024*1024)
-----------------
50
50
50
SQL> alter database add standby logfile group 10 size 50M;
Database altered.
SQL> alter database add standby logfile group 11 size 50M;
Database altered.
SQL> alter database add standby logfile group 12 size 50M;
Database altered.
SQL> alter database add standby logfile group 13 size 50M;
Database altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options.
On the primary database.
[oracle@pcguy dbs]$ export ORACLE_SID=SILVER
[oracle@pcguy dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 23 16:27:20 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database add standby logfile group 10 size 50M;
Database altered.
SQL> alter database add standby logfile group 11 size 50M;
Database altered.
SQL> alter database add standby logfile group 12 size 50M;
Database altered.
SQL> alter database add standby logfile group 13 size 50M;
Database altered.
[oracle@pcguy dbs]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> show database verbose 'GOLD';
Database - GOLD
Role: PHYSICAL STANDBY
Intended State: APPLY-OFF
Transport Lag: 11 minutes 3 seconds
Apply Lag: 11 minutes 3 seconds
Real Time Query: OFF
Instance(s):
GOLD
Properties:
DGConnectIdentifier = 'gold'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'MANUAL'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/opt/oradata/SILVER, /opt/oradata/GOLD'
LogFileNameConvert = '/opt/oradata/SILVER, /opt/oradata/GOLD'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'GOLD'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=pcguy)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=GOLD_DGMGRL)(INSTANCE_NAME=GOLD)(SERVER=DEDICATED)))'
StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
DGMGRL> edit database 'GOLD' set property StandbyFileManagement=AUTO;
Property "standbyfilemanagement" updated
DGMGRL> edit database 'GOLD' set state=ONLINE;
Succeeded.
DGMGRL> edit database 'SILVER' set property StandbyFileManagement=AUTO;
Property "standbyfilemanagement" updated.
MRP0: Background Media Recovery process shutdown (GOLD)
Managed Standby Recovery Canceled (GOLD)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL
Fri Sep 23 16:26:32 2011
alter database add standby logfile group 10 size 50M
Completed: alter database add standby logfile group 10 size 50M
Fri Sep 23 16:26:43 2011
alter database add standby logfile group 11 size 50M
Completed: alter database add standby logfile group 11 size 50M
Fri Sep 23 16:26:55 2011
alter database add standby logfile group 12 size 50M
Completed: alter database add standby logfile group 12 size 50M
Fri Sep 23 16:27:07 2011
alter database add standby logfile group 13 size 50M
Completed: alter database add standby logfile group 13 size 50M
Fri Sep 23 16:29:51 2011
ALTER SYSTEM SET standby_file_management='auto' SCOPE=BOTH SID='*';
Fri Sep 23 16:30:05 2011
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE
Attempt to start background Managed Standby Recovery process (GOLD)
Fri Sep 23 16:30:05 2011
MRP0 started with pid=26, OS id=10261
MRP0: Background Managed Standby Recovery process started (GOLD)
started logmerger process
Fri Sep 23 16:30:10 2011
Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 2 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 264 (in transit)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE.
We are now ready to setup the Active Data Guard Configuration.
DGMGRL> edit database 'GOLD' set state='LOG-APPLY-OFF';
Succeeded.
Recovery interrupted!
Fri Sep 23 16:32:37 2011
MRP0: Background Media Recovery process shutdown (GOLD)
Managed Standby Recovery Canceled (GOLD)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL.
[oracle@pcguy dbs]$ export ORACLE_SID=GOLD
[oracle@pcguy dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 23 16:33:58 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
GOLD
SQL> alter database open read only;
Database altered.
AUDIT_TRAIL initialization parameter is changed to OS, as DB is NOT compatible for database opened with read-only access
Fri Sep 23 16:34:17 2011
SMON: enabling cache recovery
Dictionary check beginning
Fri Sep 23 16:34:18 2011
Errors in file /opt/oracle/diag/rdbms/gold/GOLD/trace/GOLD_dbw0_9572.trc:
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/opt/oradata/GOLD/temp01.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
Errors in file /opt/oracle/diag/rdbms/gold/GOLD/trace/GOLD_dbw0_9572.trc:
ORA-01186: file 201 failed verification tests
ORA-01157: cannot identify/lock data file 201 - see DBWR trace file
ORA-01110: data file 201: '/opt/oradata/GOLD/temp01.dbf'
File 201 not verified due to error ORA-01157
Dictionary check complete
Re-creating tempfile /opt/oradata/GOLD/temp01.dbf
Database Characterset is AL32UTF8
No Resource Manager plan active
**********************************************************
WARNING: Files may exists in db_recovery_file_dest
that are not known to the database. Use the RMAN command
CATALOG RECOVERY AREA to re-catalog any such files.
If files cannot be cataloged, then manually delete them
using OS command.
One of the following events caused this:
1. A backup controlfile was restored.
2. A standby controlfile was restored.
3. The controlfile was re-created.
4. db_recovery_file_dest had previously been enabled and
then disabled.
**********************************************************
replication_dependency_tracking turned off (no async multimaster replication found)
Physical standby database opened for read only access.
Completed: alter database open read only.
[oracle@pcguy dbs]$ dgmgrl /
DGMGRL for Linux: Version 11.2.0.2.0 - 64bit Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
Connected.
DGMGRL> edit database 'GOLD' set state='APPLY-ON';
Succeeded.
Fri Sep 23 16:36:12 2011
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE
Attempt to start background Managed Standby Recovery process (GOLD)
Fri Sep 23 16:36:12 2011
MRP0 started with pid=26, OS id=10358
MRP0: Background Managed Standby Recovery process started (GOLD)
started logmerger process
Fri Sep 23 16:36:17 2011
Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 2 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Media Recovery Waiting for thread 1 sequence 264 (in transit)
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE.
[oracle@pcguy dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 23 16:37:59 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select name,database_role,open_mode from v$database;
NAME DATABASE_ROLE OPEN_MODE
--------- ---------------- --------------------
SILVER PHYSICAL STANDBY READ ONLY WITH APPLY
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
GOLD OPEN
[oracle@pcguy dbs]$ export ORACLE_SID=SILVER
[oracle@pcguy dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 23 16:39:11 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create user YORICK identified by YORICK default tablespace users temporary tablespace TEMP;
User created.
SQL> grant create session,create table to YORICK;
Grant succeeded.
SQL> alter user YORICK quota unlimited on users;
User altered.
SQL> connect YORICK/YORICK;
Connected.
SQL> create table T_REPLICA (PK_REPLICA number,DATA varchar2(1000));
Table created.
SQL> insert into T_REPLICA values (1,dbms_random.string('U',1000));
1 row created.
SQL> commit;
We check whether the redo is recovered. ( and it is recovered in almost real time )
[oracle@pcguy dbs]$ export ORACLE_SID=GOLD
[oracle@pcguy dbs]$ sqlplus YORICK/YORICK
SQL*Plus: Release 11.2.0.2.0 Production on Fri Sep 23 16:43:03 2011
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from T_REPLICA;
COUNT(*)
----------
1