Professional Documents
Culture Documents
11g Active Data Guard More Than Just DR .: Gavin Soorma Senior Oracle DBA, Bankwest
11g Active Data Guard More Than Just DR .: Gavin Soorma Senior Oracle DBA, Bankwest
• Prior to Oracle 11g, read access to standby database required Redo Apply
to be stopped.
• Queries on read only standby databases could potentially return stale
results as changes occurring on the primary database are not applied.
• This backlog of unapplied redo data could potentially increase failover times
• Traditional reporting sites based on MV's
• MV's need administrative overhead for setup and maintenance.
• MV refresh times can be lengthy for complex queries - while complete
refresh happens no rows returned for queries
Data Guard
Broker
Transactions
Oracle Net
LGWR RFS MRP
Standby
Redo
Online Logs Standby
Redo
Primary Logs Database
ARCH
Database
ARCH
Archived
Archived Redo Logs
Redo Logs AUSOUG National Conference Series 2009
What is Active Data Guard?
• Introduced in 11g Release 1
• Available in the database server Enterprise Edition as an additional license
option
• Real time replica of a production database which is open in read only mode
while changes transmitted from the primary database are being simultaneously
applied to it.
• Applies to physical and not logical standby database
• Can offload reporting, queries and fast incremental backups from the primary
site to the standby site improving the performance and adding to the scalability
of the primary site
• Performs its primary Data Guard objective of preventing data loss and
downtime due to data corruptions, database and site failures, human error, or
natural disaster.
AUSOUG National Conference Series 2009
Active Data Guard Usage
• Redirect read only portions of application to Standby site - online order and
shipping application will have a read only component where the catalogue is
searched by customer before the shopping cart activity commences
• Read mostly applications can use redirection to Active DG site
• Redirect complex adhoc queries like year end or month end reports to DR
site
• Redirect Business Intelligence tools like Discoverer to the standby site
• Use optimized incremental backups with RMAN block change tracking in
11g now on standby sites to make backups up to 20 times faster
• Extends basic Data guard functionality – switchovers/failovers
• Data Guard is free - Active Data Guard is a licensed option
Primary Database
(Two Node RAC Cluster)
AUSOUG National Conference Series 2009
Active Data Guard – Operations Permitted
What we cannot do ….
GETSAL('KING')
--------------
5000
SQL> select getsal_remote ('KING') from dual; -- getsal_remote is synonym for getsal@dblink
GETSAL_REMOTE('KING')
---------------------
5000
DATABASE_ROLE
----------------
PHYSICAL STANDBY
OPEN_MODE
--------------------
READ ONLY WITH APPLY
1 row created.
SQL> commit;
Commit complete.
1 row updated.
SQL> STARTUP
DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
------------------------------------
188
apex:/u01/oracle/scripts> ./corrupt.sh
0+0 records in
0+0 records out
System altered.
Session altered.
ON PRIMARY
ON STANDBY
ERROR at line 1:
ORA-03172: STANDBY_MAX_DATA_DELAY of 0 seconds exceeded
SQL> /
PROD_ID
----------
1 >>>> QUERY REDIRECTED TO PRIMARY
DATABASE_ROLE
----------------
PRIMARY
SQL> commit;
Commit complete.
TO_CHAR(SYSDATE,'DD-
--------------------
04-NOV-2009 10:26:12
PROD_ID
----------
1
DATABASE_ROLE
----------------
PHYSICAL STANDBY
TO_CHAR(SYSDATE,'DD-
--------------------
04-NOV-2009 10:26:31
PROD_ID
----------
1
VALUE
----------------------------------------------------------------
+00 00:00:01
VALUE
----------------------------------------------------------------
+00 00:00:00
Snapshot Standby
• Redo applied when snapshot standby database is converted back to physical standby
Note:
• Both Active Data Guard and Snapshot standby require a physical standby database in
place as opposed to a logical standby database
• Combined with Real Application Testing to provide a simple way to test and
maintain protection at the same time
• Eliminate guesswork as performance test results are realistic and reliable since
using a replica of production data
• Understand the impact as well as extent of system resource consumption on
production data during performance testing
• Change assurance - Introduce changes with confidence
• Snapshot standby provides simultaneous disaster recovery capabilities as well as
QUALITY ASSURANCE capabilities
Analysis
& Reporting
AUSOUG National Conference Series 2009
Snapshot Standby – some considerations
• Can only be used with a physical standby database and not logical standby
database
• Needs flashback logging to be enabled - creates a implicit guaranteed restore
point internally to which the snapshot standby is flashed back to convert back to
physical standby
• The name of this guaranteed restore points begins with
‘SNAPSHOT_STANDBY_REQUIRED_*
• Need to consider how long the standby database operates in snapshot standby
mode
• First have to rewind the database to the guaranteed restore point using flashback
logs - then changes generated on the primary when standby was in snapshot
standby mode have to be applied by rolling forward and applying archive logs
• Note – switchover or failover cannot be performed to a snapshot standby database
Q&A
http://gavinsoorma.wordpress.com
Tel: 0417713124
gavin.soorma@bankwest.com.au
QUESTIONS
ANSWERS