Oracle dataguard overview

22
Oracle10g Data Guard Overview

description

ODG overview

Transcript of Oracle dataguard overview

Page 1: Oracle dataguard overview

Oracle10g Data GuardOverview

Page 2: Oracle dataguard overview

Objectives

• Explain the benefits of Data Guard and why we might use it

• Describe the basic components of Oracle Data Guard

Page 3: Oracle dataguard overview

Benefits of Oracle Data Guard

• Configure the system to meet business protection and recovery requirements

• Continuous service through a disaster or crippling data failure

• Complete data protection against corruptions and data loss

• Reduce overhead on primary systems by offloading:– adhoc queries– reporting– backups

• Centralized management (Data Guard Broker, Data Guard Manager via Enterprise Manager)

Page 4: Oracle dataguard overview

Data Loss Causes…

* Protect Data 2006

Natural Disasters 3%

Software Corruption 14%

Human Error 32%

Hardware & System Error 44%

Computer Viruses 7%

Page 5: Oracle dataguard overview

What is Data Guard?

PrimaryDatabase

StandbyDatabase

Database Database Copy

Ora

cle

Net

Oracle® Data Guard Concepts and Administration 10g Release 2 (10.2)“Ch. 1 Introduction to Oracle Data Guard “

Redo

Page 6: Oracle dataguard overview
Page 7: Oracle dataguard overview

Standby Databases

There are two types of standby databases:

1. Physical standby database

2. Logical standby database

Page 8: Oracle dataguard overview

Data Guard Services

There are three types of services provided between the Primary and Standby databases:

1. Redo Transport: (2 types: Archival or Real-Time)• Controls the transfer of redo data from the primary

database to the standby database.

2. Log Apply: (2 types: Redo Apply or SQL Apply)• Applies redo data on the standby database to maintain

synchronization with the primary database.

3. Role Transitions: (2 types: Switchover or Failover)• Change the role of a database:

SWITCHOVER: standby to primary + primary to standby

FAILOVER: standby to primary

Page 9: Oracle dataguard overview

Data Guard ServicesRedo Transport

Redo transport services perform the following tasks:• Transmits redo data from the primary to one

or more standbys (9 max*) using ARCH or LGWR (LNSn)

• Enforces the database protection mode• Automatically detects missing or corrupted

archived redo log files on the standby and retrieves replacement archived redo log files from the primary, or another standby database

i.e.: “GAP” RESOLUTION• Archival or Real-Time

Page 10: Oracle dataguard overview

Data Guard ServicesNo Standby – No REDO Transport

Primary

Database

Transactions

LGWR

Online

Redo Log Files

ARC0

Archived

Redo Log Files

Page 11: Oracle dataguard overview

Data Guard Services Redo Transport (Archival)

Primary

Database

Transactions

LGWR

Online

Redo Log Files

ARC0

Archived

Redo Log Files

Physical

Standby

Database

ARC0

Archived

Redo Log Files

MSRP

ARC1

RFSArchival

Transport

Redo

Apply

Page 12: Oracle dataguard overview

Data Guard Services Redo Transport (Real-Time)

Primary

Database

Transactions

LGWR

Online

Redo Log Files

ARC0

Archived

Redo Log Files

Logical

Standby

Database

LGWR

Standby

Redo Log Files

(Required)

ARC0

Archived

Redo Log Files

LSPLSN0 RFS

SQL

ApplyReal-Time

Transport

Page 13: Oracle dataguard overview

Data Guard ServicesRedo Transport Configuration

Redo transport is configured via parameters:

LOG_ARCHIVE_DEST_n (n = { 1..10 })

• One destination must be LOCAL and must be MANDATORY. This destination, usually n = 1, is always archived first when using ARCH for redo transport

• Destination n = 10 is the default FLASHBACK RECOVERY area.

LOG_ARCHIVE_DEST_STATE_n

• Allows one to ENABLE, DEFER, or RESET a specific destination

STANDBY_ARCHIVE_DEST (standby only)

• If no LOG_ARCHIVE_DEST_n locations specified then provides default location for archived redo logs

Page 14: Oracle dataguard overview

Data Guard ServicesLog Apply (Redo Apply)

For physical standby databases, Data Guard uses Redo Apply technology, which applies redo data on the standby database using standard recovery techniques of an Oracle database.

I.e. Block-for-block, byte-for-byte, bit-for-bit identical to primary.

Page 15: Oracle dataguard overview

Data Guard ServicesLog Apply (SQL Apply)

For logical standby databases, Data Guard uses SQL Apply technology, which transforms the received redo data into SQL statements and then executes the generated SQL statements on the logical standby database.

I.e. Use Log Mining to extract the redo, transform the redo into SQL statements, then execute the SQL statements against the logical standby.

Page 16: Oracle dataguard overview

Role TransitionsSwitchover and Failover

• Not automatically invoked (but can be…)

• Switchover– Planned role reversal– Used for OS or hardware maintenance

• Failover– Unplanned role reversal– Use in an emergency– Minimal or zero data loss depending on choice of

data protection mode

Page 17: Oracle dataguard overview

Data Protection ModesMaximum Protection

• Ensures that no data loss will occur if the primary database fails.

• Redo needed to recover each transaction must be written to both the local online redo log and to the standby redo log on at least one standby database before the transaction commits.

• If a fault prevents the primary database from writing its redo stream to the standby redo log of at least one transactionally-consistent standby database, the primary database shuts down.

Page 18: Oracle dataguard overview
Page 19: Oracle dataguard overview

Data Protection ModesMaximum Performance

• Default. Provides highest level of data protection possible without affecting the performance of the primary database.

• Transactions may commit as soon as the redo data needed to recover them transaction is written to the primary’s online redo log.

• Redo data stream written asynchronously to at least one standby database.

• If sufficient bandwidth exists, provides a level of data protection that approaches that of maximum availability mode with minimal impact on primary database performance.

Page 20: Oracle dataguard overview

Setting the Protection Mode

To set up redo transport services and specify a level of data protection for the Data Guard configuration, perform the following steps.

Step 1: Configure the LOG_ARCHIVE_DEST_n parameters on the primary database.

Maximum

Protection

Maximum

Availability

Maximum

Performance

Redo archival process LGWR LGWR LGWR or ARCH

Network Transmission Mode

SYNC SYNC SYNC or ASYNC (LGWR)

SYNC (ARCH)

Disk Write Option AFFIRM AFFIRM AFFIRM or NOAFFIRM

Standby Redo Log Required?

Yes Yes No but recommended

Page 21: Oracle dataguard overview

Setting the Protection Mode

Step 1: Bounce the primary database:SQL> SHUTDOWN IMMEDIATE;

SQL> STARTUP MOUNT;

* If RAC, shutdown all instances, restart/mount one instance.

Step 2: Set the mode:SQL> ALTER DATABASE SET STANDBY DATABASE TO PROTECTION MODE;

Step 3: Open the Primary Database:SQL> ALTER DATABASE OPEN;

Step 4: Confirm LOG_ARCHIVE_DEST_n parameter(s) on Standby

Database:SQL> SHOW PARAMETER log_archive_dest_

Step 5: Confirm configuration:SQL> SELECT PROTECTION_MODE, PROTECTION_LEVEL FROM V$DATABASE;

Page 22: Oracle dataguard overview

Summary

In this lesson you should have learned:

• Benefits of Data Guard and why we might use it

• Basic components of Oracle Data Guard