Sie sind auf Seite 1von 0

Oracle Data Guard

Oracle Data Guard


Logical Standby Database
Logical Standby Database
Paul Baumgartel
Paul Baumgartel
Transcentive
Transcentive
, Inc.
, Inc.
New York Oracle Users Group
New York Oracle Users Group
September 23, 2003
September 23, 2003
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 2 2
Introduction
Introduction

Data Guard is major component of


Data Guard is major component of
Oracle
Oracle

s High Availability (HA) facility


s High Availability (HA) facility

Other features include Real Application


Other features include Real Application
Clusters (RAC), Advanced Replication,
Clusters (RAC), Advanced Replication,
and Oracle Streams
and Oracle Streams

Physical standby database available since


Physical standby database available since
Oracle8
Oracle8

Logical standby introduced in 9iR2


Logical standby introduced in 9iR2
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 3 3
Choosing a standby database
Choosing a standby database
configuration
configuration

Physical standby best for disaster


Physical standby best for disaster
recovery
recovery

Most efficient
Most efficient

Less complex
Less complex

Logical standby more flexible


Logical standby more flexible

Not everything must be duplicated


Not everything must be duplicated

Can be used at all times for reporting


Can be used at all times for reporting
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 4 4
Physical standby concepts
Physical standby concepts

Exact file copy of primary database


Exact file copy of primary database

Activity on primary duplicated via


Activity on primary duplicated via
application of redo information
application of redo information

Log transport services transmit in LOG or


Log transport services transmit in LOG or
ARCH mode
ARCH mode

Standby is mounted but not open


Standby is mounted but not open
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 5 5
Physical standby concepts
Physical standby concepts

Log apply services receive and apply redo


Log apply services receive and apply redo
directly from logs
directly from logs

Most efficient due to use of low


Most efficient due to use of low
-
-
level
level
recovery mechanism (database block
recovery mechanism (database block
change vectors)
change vectors)

No user activity while in recovery mode


No user activity while in recovery mode

May be opened for read


May be opened for read
-
-
only user activity
only user activity
after suspending recovery
after suspending recovery
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 6 6
Logical standby concepts
Logical standby concepts

Standby starts as, but need not remain,


Standby starts as, but need not remain,
exact copy
exact copy

May contain schemas and objects that do


May contain schemas and objects that do
not exist on primary
not exist on primary

Log transport services transmit in LOG or


Log transport services transmit in LOG or
ARCH mode
ARCH mode

Standby is open for read/write activity (but


Standby is open for read/write activity (but
no writes on standby objects)
no writes on standby objects)
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 7 7
Logical standby concepts
Logical standby concepts

Log apply services use LogMiner to


Log apply services use LogMiner to
construct SQL from redo log contents,
construct SQL from redo log contents,
then apply it to standby objects
then apply it to standby objects

DDL may be included in or excluded from


DDL may be included in or excluded from
log apply stream
log apply stream

Progress of log apply services may be


Progress of log apply services may be
monitored
monitored
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 8 8
Logical standby: unsupported
Logical standby: unsupported
data types
data types

NCLOB
NCLOB

LONG
LONG

LONG RAW
LONG RAW

BFILE
BFILE

ROWID
ROWID

UROWID
UROWID
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 9 9
Logical standby: unsupported
Logical standby: unsupported
objects
objects

user
user
-
-
defined types
defined types

object types
object types
REFs
REFs

varrays
varrays

nested tables
nested tables

Unsupported Tables, Sequences, and Views


Unsupported Tables, Sequences, and Views

User
User
-
-
defined tables and sequences in the SYS
defined tables and sequences in the SYS
schema
schema

Tables with unsupported data types


Tables with unsupported data types

Tables using data segment compression


Tables using data segment compression

Index
Index
-
-
organized tables
organized tables
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 10 10
Preparing the primary database
Preparing the primary database

Enable forced logging


Enable forced logging

Enable archiving and define local archive


Enable archiving and define local archive
destination
destination

Set
Set
LOG_PARALLELI SM
LOG_PARALLELI SM
to 1
to 1

Ensure rows can be uniquely identified


Ensure rows can be uniquely identified
(query
(query
DBA_LOGSTDBY_NOT_UNI QUE
DBA_LOGSTDBY_NOT_UNI QUE
)
)
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 11 11
Preparing the primary database
Preparing the primary database

Enable supplemental logging


Enable supplemental logging

Perform log switch


Perform log switch

Create alternate tablespace for LogMiner


Create alternate tablespace for LogMiner
objects
objects
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 12 12
Creating the standby database
Creating the standby database

Copy the primary


Copy the primary

Move files to the standby machine


Move files to the standby machine

Rename data files


Rename data files

Turn on Database Guard


Turn on Database Guard
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 13 13
Creating the standby database
Creating the standby database

Rename the database


Rename the database

Register first archived log to be applied


Register first archived log to be applied

Start log apply services


Start log apply services

Enable archiving to standby


Enable archiving to standby
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 14 14
Verify standby database
Verify standby database

DBA_LOGSTDBY_LOG
DBA_LOGSTDBY_LOG

V$LOGSTDBY
V$LOGSTDBY

DBA_LOGSTDBY_PROGRESS
DBA_LOGSTDBY_PROGRESS

These views show available logs, progress


These views show available logs, progress
of log application, and snapshots of
of log application, and snapshots of
current SQL activity
current SQL activity

Transaction information and


Transaction information and
SCNs
SCNs
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 15 15
Management of logical standby
Management of logical standby

Exclude objects or schemas from log


Exclude objects or schemas from log
application
application

Describe operations that should not be


Describe operations that should not be
applied to standby
applied to standby

Log errors and continue apply process


Log errors and continue apply process

Database guard:
Database guard:
ALL
ALL
,
,
STANDBY
STANDBY
,
,
NONE
NONE
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 16 16
Management of logical standby
Management of logical standby

Temporarily bypass guard to modify


Temporarily bypass guard to modify
objects
objects

Constraints and triggers enabled but not


Constraints and triggers enabled but not
executed
executed

Delay log application to avoid error


Delay log application to avoid error
duplication
duplication
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 17 17
Logical standby performance
Logical standby performance

Indexes on tables with no primary key


Indexes on tables with no primary key

TRANSACTI ON_CONSI STENCY: FULL,


TRANSACTI ON_CONSI STENCY: FULL,
READ_ONLY, NONE
READ_ONLY, NONE

Adjust
Adjust
PARALLEL_MAX_SERVERS
PARALLEL_MAX_SERVERS

Adjust
Adjust
SHARED_POOL_SI ZE
SHARED_POOL_SI ZE
to improve
to improve
performance of LogMiner components
performance of LogMiner components
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 18 18
Limitations
Limitations

Logical standby not compatible with Oracle


Logical standby not compatible with Oracle
Label Security
Label Security

Bugs in log apply process (fixed on Unix


Bugs in log apply process (fixed on Unix
platforms, not yet fixed on Windows)
platforms, not yet fixed on Windows)

Performance can be poor due to nature of


Performance can be poor due to nature of
process
process

Deletion of 1000 rows is represented in logs by


Deletion of 1000 rows is represented in logs by
1000 change vectors; LogMiner extracts and
1000 change vectors; LogMiner extracts and
creates 1000
creates 1000
DELETE
DELETE
statements
statements
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 19 19
Summary
Summary

Logical standby worthwhile Data


Logical standby worthwhile Data
Guard option
Guard option

Requires careful setup and


Requires careful setup and
monitoring
monitoring

One of growing number of Oracle HA


One of growing number of Oracle HA
alternatives including replication, Data
alternatives including replication, Data
Guard, RAC, and Streams
Guard, RAC, and Streams
Paul Baumgartel NYOUG 9/23/2003 Paul Baumgartel NYOUG 9/23/2003 20 20
Contact information
Contact information

paul.baumgartel@aya.yale.edu
paul.baumgartel@aya.yale.edu

917 549
917 549
-
-
4717
4717

Feel free to get in touch!


Feel free to get in touch!

Das könnte Ihnen auch gefallen