Вы находитесь на странице: 1из 28

<Insert Picture Here>

Oracle Data Guard


Active Data Guard

Agenda

Data Guard Architecture & Features


Data Guard 11g New Features
Active Data Guard
Resources

<Insert Picture Here>

What is a Disaster?
Well-recognized disasters such as headline-grabbing events
Fire, earthquake, tsunami, flood, hurricane,

And . . .more mundane events that occur much more frequently

Faulty system components server, network, storage, software,


Data corruptions
Backup/recovery of bad data
Wrong batch job
Bad HW/SW installations / upgrades / patching
Operator errors
Power outages
Etc.

What is Data Guard?


Data Availability & Data Protection solution for Oracle
Automates the creation and maintenance of one or more
synchronized copies (standby) of the production (or
primary) database
If the primary database becomes unavailable, a standby
database can easily assume the primary role
Standby databases also used for queries, reporting,
testing, or backups while in standby role
An included feature of Oracle Database Enterprise Edition

Oracles Integrated HA Solution Set

Planned
Downtime

Real Application Clusters

Data
Failures

ASM
Flashback
RMAN & Oracle Secure Backup
Data Guard
Streams

System
Changes

Online Reconfiguration
Rolling Upgrades

Data
Changes

Online Redefinition

Oracle MAA Best Practices

Unplanned
Downtime

System
Failures

Oracle Data Guard Architecture


Physical
Standby

Dallas
Sync or Async
Redo Shipping

Production
Database

Open R/O

Redo
Apply
Network

Backup

Broker

DIGITAL DATA STORAGE

DIGITAL DATA STORAGE

Chicago

Logical
Standby

Transform
Redo to SQL

SQL
Apply

Open R/W

Boston
6

Data Guard Process Architecture


Redo Transport & Apply
Transactions

Physical/Logical
Standby Database

Oracle Net
LGWR

LNS

RFS

MRP - physical
LSP - logical

sync

async

Primary
Database

Online
Redo Logs

arch

Standby
Redo
Logs

Transform Redo
to SQL for
Logical Standby

ARCH
ARCH

Archived
Redo Logs

Queries,
Reports,
Testing,
Backups

Archived
Redo Logs

Data Guard Redo Apply


Open
Read-Only
Primary
Database

Physical Standby
Database

Data Guard
Broker
Redo Apply
Network
Redo Shipment






Backup
Standby
Redo Logs

DIGITAL DATA STORAGE

Physical Standby Database is a block-for-block copy of the primary database


Uses the database recovery functionality to apply changes
While apply is active can be opened in read-only mode for reporting/queries*
Can also be used for fast* backups, further offloading the production database
* Requires additional license for Oracle Active Data Guard

Data Guard SQL Apply


Additional
Indexes &
Materialized Views

Primary
Database

Data Guard
Broker

Logical Standby
Database
Transform Redo
to SQL and Apply
Open
Read - Write

Network
Redo Shipment




Standby
Redo Logs

Logical Standby Database is an open, independent, active database


 Contains the same logical information (rows) as the production database
 Physical organization and structure can be very different
 Can host multiple schemas
Can be queried for reports while redo data is being applied via SQL
Can create additional indexes and materialized views for better query performance

SQL Apply Process Architecture


Logical Change Records not
grouped into transactions

Redo Data
from
Primary
Database

Redo
Records
Reader

LCR
LCR
:

Preparer

Builder

Shared
Pool

Log Mining
Transaction
groups

Apply Processing

Logical
Standby
Database

Coordinator

Applier
Transactions
to be applied

Analyzer
Transactions sorted
in dependency order

10

Redo Apply or SQL Apply?


Redo Apply

SQL Apply

Physical, block-for-block copy


of the primary
Can be open for read-only
queries supports real-time
reporting in 11g
At role transition, offers
assurance that the standby
database is an exact replica of
the old primary
Can be used for fast backups
Higher performance

Logical, transaction-fortransaction copy of the primary


Allows creation of additional
objects, modification of objects
Able to skip apply on certain
objects
Is open read-write (data in
tables maintained by SQL
Apply can not be changed)
Supports real-time reporting
Has datatype restrictions

11

Protection from Human Errors


Flashback Database or Delayed Apply

Primary Site

Delayed Apply or
Flashback Database

Standby Site

Data Changes

 Application of changes received from the primary can be delayed at standby


to allow for the detection of user errors and prevent standby to be affected
 Administrators may choose not to configure any delay if both primary and
standby are affected, then they can be simply flashed back (Oracle 10g)
 The apply process also revalidates the log records to prevent application of
any log corruptions

12

Switchover and Failover


Switchover
Planned role reversal
No database reinstantiation required
Used for maintenance of OS or hardware

Failover
Unplanned failure of primary
Use Flashback Database to reinstante original primary

Manually execute via simple SQL / GUI interface, or


Automate failover using Data Guard Fast-Start Failover

13

Fast-Start Failover
Standby Site
Primary Site

Primary
StandbySite
Site
Observer

Steady state - Data Guard Observer Process monitors the state of the configuration
Disaster strikes and an automatic failover is executed
When repaired - the Observer reinstates the original primary as a new standby
14

Data Guard 11g Enhancements


Increase ROI

High Availability

Active Data Guard

Snapshot Standby

Better Data Protection

Manageability

Faster redo transport


Advanced Compression

Real-time Query
Fast Incremental backup

Redo compression for GAPs

Lost-write protection
Fast-Start Failover

Faster Redo Apply


Faster failover & switchover
Fast-Start Failover using ASYNC
Transient Logical Standby

SQL Apply
RMAN Integration
Security
Mixed Windows/Linux
Enterprise Manager & Broker

15

Traditional Physical Standby Databases


Investment in Disaster Recovery only
Real-time
Queries

Production
Database

Standby
Database

Applications, backups, reports run on production only

16

Active Data Guard 11g


Real-time Query
Real-time

Real-time
Query
Queries

Continuous Redo
Shipment and Apply

Production
Database

Physical Standby
Database

Offload read-only queries to physical standby


Offload fast incremental backups to physical standby
17

Active Data Guard Benefits


Invest in improving Quality of Service

Physical standby in recovery


All read activity on production
Disaster protection only
Standby systems rarely used
Complex replication used to
create reporting replica

Simultaneous read & recovery


Shift read-only workload to standby
Performance protection
Regularly used for production
Simple, high performance,
application and data transparent

18

Active Data Guard - Licensing


A Database Option for Oracle Enterprise Edition 11g
Option license is required only when using either:
Real-time Query
RMAN block-change tracking on a standby database

Used in conjunction with Data Guard functionality


included with Oracle11g Enterprise Edition

19

How to Setup a Standby Database


10g
1. Prepare the primary database.
2. Back up the primary database.
3. Copy files to the standby
system.
4. Set parameters on the physical
standby database.
5. Start the standby database.
6. Configure Oracle Net Services.
7. Set parameters on the primary
database.
8. Start the transport of redo.

11g
1.
2.
3.
4.

Prepare the primary database.


Configure Oracle Net Services.
Prepare the standby database.
Duplicate database over
network.
5. Start the standby database.
6. Use DataGuard to set
parameters for transport and
appy services.

20

Prepare Primary Database


Enable archiving mode
Force logging
Set parameters
db_unique_name
db/log_file_name_convert

21

Configure Oracle Net Services


Create tnsnames entries on both sides
primary node: primary service
standby node: standby service

Add a static service definition in the listener.ora file:


SID_LIST_LISTENER=(SID_LIST=
(SID_DESC=(SID_NAME=sid_name)
(GLOBAL_DBNAME=db_unique_name_DGMGRL.db_domain)
(ORACLE_HOME=oracle_home)))

Start the listeners on both sides

22

Prepare the Standby Database


Create password file
orapwd file=$OH/dbs/orapw<sid> password=<pwd> ignorecase=y

Create a parameter file containing simply db_name


init<stbysid>.ora:

db_name = <db name>


remote_log_password_file = exclusive

sql> startup nomount

Optionally include parameters like db_file_name_convert


Create log directories where required

23

Duplicate the Primary Database Over


the Network
Startup standby instance
sql> startup nomount

Duplicate using RMAN


connect target sys/@porcl
connect auxiliary sys/@sorcl
duplicate target database
for standby
from active database
spfile parameter_value_convert = ('control','ctrl')
set db_unique_name = 'SORCL'
set sga_target = '200m'
set log_file_name_convert = '/ORCL','/SORCL'
set db_file_name_convert = '/ORCL','/SORCL'
nofilenamecheck
;

24

Setup Dataguard Broker


Create standby redo log files on both databases
Start Broker
sql> alter system set dg_broker_start = true

Create Dataguard Configuration


Enterprise Manager
dgmgrl
DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL>

connect
create configuration
enable configuration;
add database
enable database

25

Configure Dataguard Attributes


Use Logwriter and set other attributes
connect sys/..@porcl
edit database 'PORCL'
set property standbyarchivelocation = '/u03/oracle/archive/ORCL'
;
edit database 'PORCL set property logxptmode = 'sync';
edit database 'SORCL'
set property standbyarchivelocation = '/u03/oracle/archive/SORCL'
;
edit database 'SORCL set property logxptmode = 'sync';
show database verbose 'PORCL';
show database verbose 'SORCL';

26

Use the Standby Database Active


Dataguard
Disable redo apply
dgmgrl> edit database SORC set state = apply-off;

Open the standby database


sql> alter database open;

Enable redo apply


dgmgrl> edit database SORC set state = apply-on

27

Enterprise Manager Grid Control


or let Grid Control do the work to create the standby
database!

28

Вам также может понравиться