DataGuard_architecture

24
2 Copyright © 2006, Oracle. All rights reserved. Understanding the Oracle Data Guard Architecture

Transcript of DataGuard_architecture

Page 1: DataGuard_architecture

2Copyright © 2006, Oracle. All rights reserved.

Understanding the OracleData Guard Architecture

Page 2: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 2

Objectives

After completing this lesson, you should be able to do the following:

• Describe the Data Guard architecture

• Explain the operational requirements of Data Guard

• Describe how Data Guard processes, transports, and applies redo logs

• Describe standby database modes

Page 3: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 3

Data Guard Operational Requirements: Hardware and Operating System

• The hardware can be different for the primary and standby databases.

• The operating system and platform architecture for the primary and standby databases must be the same.

• The operating system releases for the primary and standby databases can be different.

• If all databases are on the same system, verify that the OS allows you to mount more than one database with the same name.

Page 4: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 4

Data Guard Operational Requirements: Oracle Database Software

• Same release of Oracle Database Enterprise Edition must be installed for all databases.

• SYSDBA privileges are required for the accounts used to manage the database instances.

• Each database must have its own control file.

• Primary database must operate in ARCHIVELOG mode.

• Enable FORCE LOGGING on the primary database before taking data file backups for standby creation.

• If any databases use ASM and/or OMF, all should use the same combination.

Page 5: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 6

Oracle Data Guard: Architecture

LGWR

Primary database

transactions

Onlineredologs

ARC0

FAL

RFS

MRP or LSP

Archived redo logs

ARC0

Standbydatabase

Reports

(MRP only)

Standbyredo logs

Archived redo logs

BackupOra

cle

net

LNSn

(Real-time apply)

Page 6: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 7

Primary Database Flow

LGWR

Primary database

transactions

Onlineredologs

ARC0

FAL

RFS

MRP or LSP

Archived redo logs

ARC0

Standbydatabase

Reports

(MRP only)

Standbyredo logs

Archived redo logs

BackupOra

cle

net

LNSn

(Real-time apply)

Page 7: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 8

Standby Database Flow

LGWR

Primary database

transactions

Onlineredologs

ARC0

FAL

RFS

MRP or LSP

Archived redo logs

ARC0

Standbydatabase

Ora

cle

net

Reports

(MRP only)

Standbyredo logs

Archived redo logs

Backup

LNSn

(Real-time apply)

Page 8: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 9

Standby Redo Logs

Redo from primary database

RFS ARC0

Standbyredo logs

Archivedredo logs

MRP/LSP

Standby database

Page 9: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 10

Physical Standby Database: Redo Apply Architecture

Physical standby database

Primary database

Productiondatabase

Physical standbydatabase

Redoapply

Redo stream

Redotransport

Backup

Page 10: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 12

Logical Standby Database:SQL Apply Architecture

Primarydatabase

Redo transport

Transform redo information into

SQL

SQL Apply

Reports

Productiondatabase

Logical standbydatabase

Logical standby database

Page 11: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 13

Redo records

LCRLCR

:

Shared pool

Transaction groups

Transactions sorted in

dependency order

Log Mining

Apply processing

Logical change records not grouped into transactions

Transactions to be applied

Reader Preparer Builder

AnalyzerCoordinatorApplier

Data files

Redo data from primary database

SQL Apply Process: Architecture

Page 12: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 14

Real-Time Apply

RFS

Standbyredo log

files

MRP or LSP

ARC0

Primary database

Standby database

Archivedredo log

files

Page 13: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 16

Setting the DB_UNIQUE_NAME Parameter

DB_UNIQUE_NAME = SF1_DB

San Francisco

SF1_DB

Page 14: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 17

Specifying Role-Based Destinations

Primarydatabase

Standbydatabase

LOG_ARCHIVE_DEST_2= location= "/u01/app/oracle/oradata/orcldg2/arc", valid_for=(STANDBY_LOGFILE,STANDBY_ROLE)DB_UNIQUE_NAME = HRDB2

Not used

Page 15: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 19

Combinations for VALID_FOR

Combination Primary Physical Logical

ONLINE_LOGFILE, PRIMARY_ROLE Valid Ignored Ignored

ONLINE_LOGFILE, STANDBY_ROLE Ignored Ignored Valid

ONLINE_LOGFILE, ALL_ROLES Valid Ignored Valid

STANDBY_LOGFILE,STANDBY_ROLE Ignored Valid Valid

STANDBY_LOGFILE, ALL_ROLES Ignored Valid Valid

ALL_LOGFILES, PRIMARY_ROLE Valid Ignored Ignored

ALL_LOGFILES, STANDBY_ROLE Ignored Valid Valid

ALL_LOGFILES, ALL_ROLES Valid Valid Valid

Page 16: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 20

Identifying Destination Settings

SQL> SELECT DEST_ID,VALID_TYPE,VALID_ROLE,VALID_NOW 2 FROM V$ARCHIVE_DEST;DEST_ID VALID_TYPE VALID_ROLE VALID_NOW------- --------------- ------------ -------------- 1 ALL_LOGFILES ALL_ROLES YES 2 STANDBY_LOGFILE STANDBY_ROLE WRONG VALID_TYPE 3 ONLINE_LOGFILE STANDBY_ROLE WRONG VALID_ROLE 4 ALL_LOGFILES ALL_ROLES UNKNOWN 5 ALL_LOGFILES ALL_ROLES UNKNOWN 6 ALL_LOGFILES ALL_ROLES UNKNOWN 7 ALL_LOGFILES ALL_ROLES UNKNOWN 8 ALL_LOGFILES ALL_ROLES UNKNOWN 9 ALL_LOGFILES ALL_ROLES UNKNOWN 10 ALL_LOGFILES ALL_ROLES UNKNOWN 11 ALL_LOGFILES ALL_ROLES YES11 rows selected.

Page 17: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 21

Standby Redo Log Configuration

Redo shipment

RFS

Standbyredo logs

Onlineredo logs

Primarydatabase

Standbydatabase

Page 18: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 22

Using SQL to Add Standby Redo Logs

• Use the ALTER DATABASE statement to create the standby redo log files:

• Add members to a group with the following statement:

• View information about the groups as follows:

SQL> ALTER DATABASE ADD STANDBY LOGFILE MEMBER 2 '/oracle/oradata/orcl/log2b.rdo' TO GROUP 2;

SQL> ALTER DATABASE ADD STANDBY LOGFILE 2 ('/oracle/oradata/orcl/log1c.rdo', 3 '/oracle/oradata/orcl/log2c.rdo') SIZE 500K;

SQL> SELECT * FROM v$standby_log;SQL> SELECT * FROM v$logfile 2 WHERE type = 'STANDBY';

Page 19: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 23

Using Enterprise Managerto Add Standby Redo Logs

Page 20: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 24

Standby Database Modes

You can maintain the standby data in one of the following modes:

• For physical standby databases– Redo Apply– Open read-only mode

• For logical standby databases– Open read/write mode

Page 21: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 26

Summary

In this lesson, you should have learned how to describe the following:

• Data Guard architecture processes

• Operational requirements of a Data Guard environment

• How Data Guard processes, transports, and applies redo logs

• Modes of standby databases and when to use each mode

Page 22: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 27

Practice 2-1: Architecture Review

This practice covers the following topics:

• Reviewing the Oracle Data Guard architecture

• Reviewing the processes that Data Guard uses to transport and apply redo logs

• Reviewing the modes that are used to recover a primary database

Page 23: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 28

Practice 2-2: Installing the Oracle Management Agent

This practice covers the following topics:

• Installing the Oracle Management Agent

• Configuring monitoring credentials for your database

Page 24: DataGuard_architecture

Copyright © 2006, Oracle. All rights reserved.2 - 29

Practice 2-3: Configuring Your Primary Database

This practice covers the following topics:

• Reviewing your primary database configuration

• Configuring your primary database in preparation for creating a Data Guard configuration