Professional Documents
Culture Documents
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
Oracle
A BE ble l Database 12c: Data
E LIZ sfera
C I A tranGuard Administration
I
TR non-
PA
publish, license, post, transmit, or distribute this document in whole or in part without
Maria Billings the express authorization of Oracle.
Trevor Bowen
The information contained in this document is subject to change without notice. If you
Harald van Breederode find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Larry Carpenter warranted to be error-free.
Al Flournoy
Restricted Rights Notice
Joe Fong
Gerlinde Frenzen If this documentation is delivered to the United States Government or anyone using
the documentation on behalf of the United States Government, the following notice is
Joel Goodman applicable:
Uwe Hesse
s a
) ha
U.S. GOVERNMENT RIGHTS
Nitin Karkhanis The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
Donna Keesling
l ฺ om
disclose these training materials are restricted by the terms of the applicable Oracle
c
ai ฺ
license agreement and/or the applicable U.S. Government contract.
Sean Kim
m
g ide
Trademark Notice
Jerry Lee,
9 @
9 nt G u
Stephen Moriarty
u i z
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names
pr tude
may be trademarks of their respective owners.
Juan Quezada Nunez
(
Veerabhadra Rao Putrevu
R ON his S
Puneet Sangar
Thorsten Senft B AR use t
U IZ e to
H R icens
Ira Singer
Branislav Valny
T
A BE ble l
Editors
L IZ fera
DanielA E ns
C I Milne
I Kumarn- t r a
TRAnwesha
Raj
PA noRay
Publishers
Joseph Fernandez
Veena Narasimhan
Edutronic Global Services EฺIฺRฺL
Contents
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
iii
Edutronic Global Services EฺIฺRฺL
s a
3 Oracle Net Services in a Data Guard Environment
) ha
Objectives 3-2
l ฺ c om
Oracle Net Services Overview 3-3
m ai ฺ
Understanding Name Resolution 3-4
9 @ g
u ide
Local Naming Configuration Files 3-5
i z 9 nt G
Local Naming: tnsnames.ora 3-6 u
pr tude
(
ON his S
Connect-Time Failover: Planning for Role Reversal 3-7
R
B AR use t
Listener Configuration: listener.ora 3-8
Dynamic Service Registration 3-9
U IZ e to
H R icens
Static Listener Entries: listener.ora 3-10
T
Optimizing Oracle Net for Data Guard 3-11
A BE ble l
Quiz 3-13
LIZ sfera
Summary 3-15
E
I C IA -tran
Practice 3: Overview 3-16
TR non
PA 4 Creating a Physical Standby Database by Using SQL and RMAN Commands
Objectives 4-2
Steps to Create a Physical Standby Database 4-3
Preparing the Primary Database 4-4
FORCE LOGGING Mode 4-5
Configuring Standby Redo Logs 4-7
Standby Redo Log Usage 4-8
Using SQL to Create Standby Redo Logs 4-9
Viewing Standby Redo Log Information 4-10
Setting Initialization Parameters on the Primary Database to Control Redo
Transport 4-11
Setting LOG_ARCHIVE_CONFIG 4-12
Setting LOG_ARCHIVE_DEST_n 4-14
iv
Edutronic Global Services EฺIฺRฺL
i z 9 nt G
Creating the Physical Standby Database 4-33
Real-Time Apply (Default) 4-34 u
pr tude
(
ON his S
Starting Redo Apply in Real-Time 4-36
R
Database 4-37 B AR use t
Preventing Primary Database Data Corruption from Affecting the Standby
U IZ e to
H R icens
Special Note: Data Guard Support for Oracle Multitenant 4-39
T
Special Note: Standby Database on the Same System 4-40
A BE ble l
Creating a Physical Standby Without Using RMAN 4-41
LIZ sfera
Quiz 4-42
E
I C IA -tran
Summary 4-44
TR non Practice 4: Overview 4-45
PA
5 Using Oracle Active Data Guard
Objectives 5-2
Oracle Active Data Guard 5-3
Using Real-Time Query 5-4
Enabling Real-Time Query 5-5
Disabling Real-Time Query 5-6
Checking the Standby’s Open Mode 5-7
Understanding Lag in an Active Data Guard Configuration 5-8
Monitoring Apply Lag: V$DATAGUARD_STATS 5-9
Monitoring Apply Lag: V$STANDBY_EVENT_HISTOGRAM 5-10
Allowed Staleness of Standby Query Data 5-11
Configuring Zero Lag Between the Primary and Standby Databases 5-12
v
Edutronic Global Services EฺIฺRฺL
U IZ e to
H R icens
Traditional Multi-Standby Database Architecture 5-35
T
Benefits: Real-Time Cascade 5-36
A BE ble l
Quiz 5-37
LIZ sfera
Summary 5-38
E
I C IA -tran
Practice 5: Overview 5-39
TR non
PA 6 Creating and Managing a Snapshot Standby Database
Objectives 6-2
Snapshot Standby Databases: Overview 6-3
Snapshot Standby Database: Architecture 6-4
Converting a Physical Standby Database to a Snapshot Standby Database 6-5
Activating a Snapshot Standby Database: Issues and Cautions 6-6
Snapshot Standby Database: Target Restrictions 6-7
Viewing Snapshot Standby Database Information 6-8
Snapshot Standby Space Requirements 6-9
Converting a Snapshot Standby Database to a Physical Standby Database 6-10
Quiz 6-11
Summary 6-12
Practice 6: Overview 6-13
vi
Edutronic Global Services EฺIฺRฺL
vii
Edutronic Global Services EฺIฺRฺL
Broker 8-10
Data Guard Broker Interfaces 8-11
Broker Controlled Database Initialization Parameters 8-12
Using the Command-Line Interface of the Data Guard Broker 8-13
Using Oracle Enterprise Manager Cloud Control 8-16
Data Guard Overview Page 8-17
Benefits of Using Enterprise Manager 8-18
Quiz 8-19
s a
Summary 8-21
) ha
l ฺ c om
9 Creating a Data Guard Broker Configuration
m ai ฺ
Objectives 9-2
9 @ g
u ide
Data Guard Broker: Requirements 9-3
i z 9 nt G
Data Guard Broker and the SPFILE 9-5 u
pr tude
Data Guard Monitor: Configuration File 9-7 ON
( S
R h i s
Data Guard Broker: Log Files 9-8
A R se t
Creating a Broker Configuration Z9-9
I B o u
U t
H R Locations
Clear Redo Transport Network
e n se on Primary 9-10
T Database
Connecting to the Primary
E l ic with DGMGRL 9-11
Defining the A B bl e
Broker Configuration and the Primary Database Profile 9-12
L I Z r a
Adding
A E a Standby
n s feDatabase to the Configuration 9-13
I t a Sync to the Configuration 9-14
Adding arFar
ICEnabling
-
T R n
no the Configuration 9-15
PA Broker Support for Complex Redo Routing 9-16
Defining RedoRoutes by Using DGMGRL 9-17
RedoRoutes Usage Guidelines 9-18
How to Read Redo Routing Rules 9-19
Far Sync Example with RedoRoutes 9-20
Changing Database Properties and States 9-21
Managing Redo Transport Services by Using DGMGRL 9-22
Managing the Redo Transport Service by Using the LogXptMode Property 9-26
Setting LogXptMode to ASYNC 9-27
Setting LogXptMode to SYNC 9-28
Setting LogXptMode to FASTSYNC (New in Oracle Database 12c) 9-29
Disabling Broker Management of the Configuration or Standby Database 9-30
Removing the Configuration or Standby Database 9-31
viii
Edutronic Global Services EฺIฺRฺL
Quiz 9-32
Summary 9-33
Practice 9: Overview 9-34
Objectives 10-2
Monitoring the Data Guard Configuration by Using Enterprise Manager Cloud
Control 10-3
Viewing the Data Guard Configuration Status 10-4
Monitoring Data Guard Performance 10-5
Viewing Log File Details 10-6
Enterprise Manager Metrics and Alerts 10-7
Data Guard Metrics 10-8
s a
Managing Data Guard Metrics 10-9
) ha
Viewing Metric Value History 10-10
l ฺ c om
Viewing Data Guard Diagnostic Information 10-11
m ai ฺ
9 @ g
u ide
Using Monitorable Database Properties to Identify a Failure 10-13
i z 9 nt G
Using the SHOW CONFIGURATION DGMGRL Command to Monitor the
Configuration 10-14 u
pr tude
(
ON his S
Using the SHOW DATABASE VERBOSE DGMGRL Command to Monitor the
R
Configuration 10-15
B AR use t
Viewing Standby Redo Log Information in V$LOGFILE 10-17
U IZ e to
H R icens
Viewing Standby Redo Log Information in V$STANDBY_LOG 10-18
T
Identifying Destination Settings 10-19
A BE ble l
Setting the LOG_ARCHIVE_TRACE Initialization Parameter 10-20
LIZ sfera
Viewing Redo Transport Errors by Querying V$ARCHIVED_DEST 10-22
E
I C IA -tran
Evaluating Redo Data by Querying V$DATAGUARD_STATS 10-23
TR nonViewing Data Guard Status Information by Querying
PA V$DATAGUARD_STATUS 10-24
Monitoring Redo Apply by Querying V$MANAGED_STANDBY 10-25
Monitoring SQL Apply by Querying V$LOGSTDBY_TRANSACTION 10-26
Quiz 10-27
Summary 10-29
Practice 10: Overview 10-30
ix
Edutronic Global Services EฺIฺRฺL
Quiz 11-13
Summary 11-14
Practice 11: Overview 11-15
i z 9 nt G
Validating Databases for Switchover by Using DGMGRL 12-11
u
pr tude
Performing a Switchover by Using DGMGRL 12-14
(
ON his S
Preparing for a Switchover Using SQL 12-15
R
B AR use t
Performing a Switchover by Using SQL 12-16
Considerations When Performing a Switchover to a Logical Standby
U IZ e to
H R icens
Database 12-17
T
Situations That Prevent a Switchover 12-18
A BE ble l
Failover 12-19
LIZ sfera
Types of Failovers 12-20
E
I C IA -tran
Failover Considerations 12-21
TR nonPerforming a Failover by Using Enterprise Manager 12-22
PA Performing a Failover to a Physical Standby Database 12-25
Performing a Failover to a Logical Standby Database 12-26
Performing a Manual Failover by Using DGMGRL 12-27
Reenabling Disabled Databases by Using DGMGRL 12-28
Quiz 12-29
Summary 12-31
Practice 12: Overview 12-32
x
Edutronic Global Services EฺIฺRฺL
xi
Edutronic Global Services EฺIฺRฺL
xii
Edutronic Global Services EฺIฺRฺL
xiii
Edutronic Global Services EฺIฺRฺL
xiv
Edutronic Global Services EฺIฺRฺL
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
xv
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
I t d ti
Introduction to
t Oracle
O l Data
D t Guard
G d
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Primary Standby
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Oracle Net
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr Database de
Database ( t u
R ON his Scopy
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
Oracle Data Guard A
is B
a b component of an integrated Oracle Database High Availability
central
L I Z r a
(HA) solutionEset that helps
A n s fe organizations ensure business continuity by minimizing the
I C I
various kinds
- t a and unplanned down time that can affect their businesses.
of rplanned
A TR Data
Oracle n onGuard is a management, monitoring, and automation software infrastructure that
P works with a production database and one or more standby databases to protect your data
against failures, errors, and corruptions that might otherwise destroy your database. It
protects critical data by providing facilities to automate the creation, management, and
monitoring of the databases and other components in a Data Guard configuration. It
automates the process of maintaining a copy of an Oracle production database (called a
standby database) that can be used if the production database is taken offline for routine
maintenance or becomes damaged.
In a Data Guard configuration, a production database is referred to as a primary database.
A standby database is a synchronized copy of the primary database. By using a backup copy
of the primary database, you can create from 1 to 30 standby databases. The standby
databases, together with the primary database, make up a Data Guard configuration.
All Data Guard standbyy databases can enable up-to-date read access to the standby y
database while redo being received from the primary database is applied. This makes all
standby databases excellent candidates for relieving the primary database of the overhead of
supporting read-only queries and reporting.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A Bservices
The following types
L I Z erab are available with Data Guard:
of
• Redo transport
A f
E nsservices: Control the automated transmittal of redo information from
the
t I
IC n-tr
e p
primary
a y a
database to o
onee o
or more
o e sta
standby
dby databases o or aarchival
c a dest
destinations.
at o s
R
T• Applyno services: Control when and how data is applied to the standby database.
PA - Redo Apply: Technology used for physical standby databases. Redo data is
applied on the standby database by using Oracle media recovery.
- SQL Apply: Technology used for logical standby databases. The received redo
data is first transformed into SQL statements, and then the generated SQL
statements are executed on the logical standby database.
• Role management services: A database operates in one of two mutually exclusive
roles: primary or standby. Role management services operate in conjunction with redo
transport services and apply services to change these roles dynamically as a planned
transition (called a switchover operation) or as a result of database failure due to a
failover operation.
• Switchover
– Planned role reversal
– Used for OS or hardware maintenance
• Failover
– Unplanned role reversal
– Emergency use
a
– Zero or minimal data loss (depending on choice of data-
) has
protection mode) om
a
– Can be initiated automatically when fast-start failover ilฺc
is
enabled @ gm ideฺ
9 u 9 nt G
u i z
( pr tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
Data Guard enables A BEto change
you l e
b the role of a database dynamically by issuing SQL
L I Z r a
e of the Data Guard broker’s interfaces. Data Guard supports two
statements or
A Eby using
n s feither
I
C n-tra
role-transition
I operations:
R no to one
T• Switchover: The switchover feature enables you to switch the role of the primary
PA database of the available standby databases. The chosen standby database
becomes the primary database, and the original primary database then becomes a
standby database.
• Failover: You invoke a failover operation when a catastrophic failure occurs on the
primary database. During a failover operation, the failed primary database is removed
from the Data Guard environment,
environment and a standby database assumes the primary
database role. You invoke the failover operation on the standby database that you want
to fail over to the primary role. You can also enable fast-start failover, which allows Data
Guard to automatically and quickly fail over to a previously chosen synchronized
standby database.
Note: Fast-start failover is discussed in detail in the lesson titled “Enabling Fast-Start
Failover.”
Databases that are disabled after a role transition are not removed from the broker
configuration, but they are disabled in the sense that the databases are no longer managed
by the broker. To reenable broker management of these databases, you must reinstate or re-
create the databases.
Note: See the lesson titled “Performing Role Transitions” for detailed information.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Oracle
Management
Server
Repository
Agent Agent
Primary Standby
database database
s a
) ha
Data Data
Guard Guard
broker Enterprise Manager b k
broker
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tudclient e
(
CLI management
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
The Oracle Data GuardA BEbroker l e
b distributed management framework that automates and
is a
L I Z r a
centralizes the
A
creatingIthe Datara
sfemaintenance,
E creation,
n
Guard
and monitoring of Data Guard configurations. After
configuration, the broker monitors the activity, health, and availability
of R C n-int the configuration.
allIsystems
T no of using Oracle Data Guard broker include:
PAThe benefits
• Enhanced disaster protection
• Higher availability and scalability with Oracle Real Application Clusters (Oracle RAC)
Databases
• Automated creation of a Data Guard configuration
g
• Easy configuration of additional standby databases
• Simplified, centralized, and extended management
• Simplified switchover and failover operations
• Fast Application Notification (FAN) after failovers
• Built-in monitoring and alert and control mechanisms
• Transparency to the application
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
You can use Oracle A BE blManager
Enterprise e Cloud Control or the Data Guard broker’s own
L I Z r a
E nsfe interface (DGMGRL) to take advantage of the broker’s
specialized command-line
A
I C I
management
tra
capabilities.
-
T R
Enterprise n
oManager Cloud Control provides a web-based interface that combines with the
PAbroker’s ncentralized management and monitoring capabilities so that you can easily view,
monitor, and administer primary and standby databases in a Data Guard configuration.
You can also use DGMGRL to control and monitor a Data Guard configuration. You can
perform most of the activities that are required to manage and monitor the databases in the
configuration from the DGMGRL prompt or in scripts.
If you do not create a Data Guard broker configuration, you can manage your standby
databases by using SQL commands.
LNSn RFS
Redo
buffer
LGWR (Real-time
Oracle net
apply)
Standby Backup
Online redo logs a
s
) ha
redo
logs
g Reports
ARC0 l ฺ c om
Gap
m ai ฺ
ARC0 resolution
9 @ g
u ide
i z 9 nt G
u
pr Archived de redo
( t u
Archived redo
logs R ON his S logs
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Oracle Data Guard A BE bthe
leverages l e existing database redo-generation architecture to keep the
L I Z r a
standby databases
A E ninsthe feconfiguration synchronized with the primary database. By using the
existing Iarchitecture,
r a Oracle Data Guard minimizes its impact on the primary database.
I C - t
A TR Data
Oracle n onGuard uses several processes to achieve the automation that is necessary for
P disaster recovery and high availability. Some of these processes support Oracle Database in
general, and other processes are specific to a Data Guard environment.
NSSn RFS
Redo
buffer
LGWR (Real-time
Oracle net
apply)
Standby Backup
Online redo logs a
s
) ha
redo
logs
g Reports
ARCn l ฺ c om
Gap
m ai ฺ
ARCn resolution
9 @ g
u ide
i z 9 nt G
u
pr Archived de redo
( t u
Archived redo
logs R ON his S logs
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BEData l e
L I Z erab
On the primary database, Guard uses the following processes:
• Log writer
I A E (LGWR):
a n sf LGWR collects transaction redo information and updates the online
R ICedo
redo logs.
ogs
n - tr
For
o eac
each sy
synchronous
c o ous (S (SYNC) C) sta
standbydby database, LGWR G passes tthee redo
edo to
T an nNSS o (Network Server SYNC) process, which ships the redo directly to the remote file
PA server (RFS) process on the standby database. LGWR waits for confirmation from the
NSS process before acknowledging the commit. For asynchronous (ASYNC) standby
databases, independent redo transport slave processes (TTnn) read the redo from
either the redo log buffer in memory or the online redo log file, and then ship the redo to
its standby database. Other than starting the asynchronous TTnn processes, LGWR has
no interaction with any asynchronous standby destination.
• Archiver (ARCn): The ARCn process creates a copy of the online redo log files locally
for use in a primary database recovery operation. ARCn is also responsible for shipping
redo data to an RFS process at a standby database and for proactively detecting and
resolving gaps on all standby databases. There can be 30 archiver processes. The
default value is four.
NSSn RFS
Redo
buffer
LGWR (Real-time
Oracle net
apply)
Standby Backup
Online redo logs a
s
) ha
redo
logs
g Reports
ARCn l ฺ c om
Gap
m ai ฺ
ARCn resolution
9 @ g
u ide
i z 9 nt G
u
pr Archived de redo
( t u
Archived redo
logs R ON his S logs
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BEData l e
L I Z erab
On the standby database, Guard uses the following processes:
• Remote
I A Efile server
a n sf (RFS): RFS receives redo information from the primary database
R IC
and
a d ca
can
n - tr e redo
write
te the
t edo into to standby
sta dby redo
edo logs
ogs o or d
directly
ect y to a archived
c ed redo
edo logs.
ogs Eachac
T NSSn
PA Note: noThe
and ARCn process from the primary database has its own RFS process.
use of standby redo logs is discussed in more detail in the lesson titled
“Creating a Physical Standby Database by Using SQL and RMAN Commands.”
• Archiver (ARCn): The ARCn process archives the standby redo logs.
• Managed recovery (MRP): For physical standby databases only, MRP applies archived
redo log information to the physical standby database. If you start managed recovery
with
ith th
the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE SQL statement, t t t
this foreground session performs the recovery. If you use the optional DISCONNECT
[FROM SESSION] clause, the MRP background process starts. If you use the Data
Guard broker to manage your standby databases, the broker always starts the MRP
background process for a physical standby database.
• Logical standby (LSP): For logical standby databases only, LSP controls the
application of archived redo log
g information to the logical
g standby
y database.
database database
Redo Redo
transport apply
Redo
stream s a
m ) ha
ฺco
Backup
a il
@ gm ideฺ
i z 99 nt Gu
u de
prPhysical
Primary (
N is Sdatabase tu standby
database O
A RR se th
I Z B ou
R U and/or
Copyright © 2014, Oracle
e tits affiliates. All rights reserved.
H icen s
T l
A BEstandby l e
L I Z erab
The Data Guard physical Redo Apply architecture consists of:
I A E (primary)
• A production
a n sf database, which is linked to one or more standby databases (up
R IC
to 30) that
t
n
at
- t r
are
a e identical
de t ca copies
cop es o of tthe
epproduction
oduct o database
database. The e limitt o
of 30 sta
standby
dby
T databaseso is imposed by the LOG_ARCHIVE_DEST_n parameter. In Oracle Database
PA 12cnRelease 1 (12.1), the maximum number of destinations is 31. One is used as the
local archive destination, leaving the other 30 for uses such as the Far Sync or standby
databases.
• The standby database, which is updated by redo that is automatically shipped from the
primary database. The redo can be shipped as it is generated or archived on the primary
database Redo is applied to each standby database by using Oracle media recovery
database. recovery.
During planned down time, you can perform a switchover to a standby database. When
a failure occurs, you can perform a failover to one of the standby databases. The
physical standby database can also be used to back up the primary database.
database database
Redo SQL
transport Apply
Transform redo
information into s a
SQL ) ha
l ฺ c om
m ai ฺ
9 @ u ide
g Reports
i z 9 nt G
u
prLogical destandby
Primary ( t u
database
R ON his Sdatabase
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
In a logical standby A BE bconfiguration,
database l e Data Guard SQL Apply uses redo information
L I Z r a
shipped fromEthe primary
A n s fesystem. However, instead of using media recovery to apply changes
I C I
(as in the physical
- t r astandby database configuration), the redo data is transformed into
R noSQL
equivalent
T n statements by using LogMiner technology. These SQL statements are then
A
P applied to the logical standby database. The logical standby database is open in read/write
mode and is available for reporting capabilities. By opening the logical standby database in
read/write mode, additional reporting structures such as indexes or materialized views can be
created that do not exist in the primary database.
A logical standby database can be used to perform rolling database upgrades, thereby
minimizing down time when upgrading to new database patch sets or full database releases
releases.
LNSn RFS
Redo
buffer
LGWR (Real-time
Oracle net
apply)
Standby
Online redo logs Backup a
s
) ha
redo
logs
g Reports
p
ARC0 l ฺ c om
ARCH ping
m ai ฺ
ARC0
9 @ g
u ide
Redo to
i z 9 nt G
resolve u
pr tArchived de redo
gap ( u
Archived redo
logs R ON his S logs
B AR use t
Copyright © 2014,U IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icen R s
T l
If connectivity is lost A BE bthe
between l e primary database and one or more standby databases, redo
L I Z r a
data that is being
A E generatedn s fe on the primary database cannot be sent to those standby
I C I
databases. When
- t r a
a connection is reestablished, Data Guard automatically detects that there
are
T Rmissing
n o n
archived redo log files (referred to as a gap), and then automatically transmits the
A
P missing archived redo log files to the standby databases by using the ARCn processes. The
standby databases are synchronized with the primary database without manual intervention
by the DBA.
data protection:
• Maximum protection
• Maximum availability
• Maximum performance
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Data Guard provides A BE high-level
three b l e modes of data protection that you can configure to
L I Z r a
A n s feperformance, and transaction protection. You can configure the
balance cost,Eavailability,
I C I
Data Guard
- t r a
environment to maximize data protection, availability, or performance.
A TR noProtection
Maximum n
P This protection mode guarantees that no data loss occurs if the primary database fails. For
this level of protection, the redo data that is needed to recover each transaction must be
written to both the local online redo log and the standby redo log (used to store redo data
received from another database) on at least one standby database before the transaction
commits. To ensure that data loss does not occur, the primary database shuts down if a fault
preventst it from
f writing
iti its
it redo
d stream
t tto att least
l t one remote
t standby
t db redo
d log.
l
Maximum Availability
This protection mode provides the highest possible level of data protection without
compromising the availability of the primary database. As with maximum protection mode, a
transaction does not commit until the redo needed to recover that transaction is written to the
local online redo log and to at least one remote standby redo log. Unlike maximum protection
mode, the primary database does not shut down if a fault prevents it from writing its redo
stream to a remote standby redo log. Instead, the primary database operates in an
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
unsynchronized mode until the fault is corrected and all the gaps in the redo log files are
resolved. When all the gaps are resolved and the primary database is synchronized with the
standby database, the primary database automatically resumes operating in maximum
availability mode.
This mode guarantees that no data loss occurs if the primary database fails, but only if a
second fault does not prevent a complete set of redo data from being sent from the primary
database to at least one standby database.
Maximum Performance (Default)
s a
) ha
The default protection mode provides the highest possible level of data protection without
affecting the performance of the primary database. This is accomplished by allowing a
l ฺ c om
transaction to commit as soon as the redo data needed to recover that transaction is written to
m ai ฺ
the local online redo log. The primary database’s redo data stream is also written to all
@ g ide
ASYNC standby databases and is written asynchronously with respect to the commitment of
9 u
the transactions that create the redo data.i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
s a
Many restrictions exist. ) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A
Hardware and OperatingB b
L IZ feraSystem Requirements
Erequirements
These are the
A n s for Data Guard:
•RIC
I
The hardware
a
-tr for the primary and standby database systems can be different different. For
T n o n
PA example, the
differ.
number of CPUs, the memory size, and the storage configuration can
• The operating systems for both databases and operating system binaries can be
different.
If the primary and standby databases are both on the same server, you must ensure that the
operating
ope at g syste
system e
enables
ab es you to mount
ou t ttwo
o databases with
t tthe
e sa
same
e name
a eoon tthe
e sa
samee
system simultaneously. Certain parameters must be specified to support this configuration, as
discussed in the lesson titled “Creating a Physical Standby Database by Using SQL and
RMAN Commands.”
Refer to My Oracle Support notes 413484.1, 395982.1, and 414043.1 for additional
information.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
• You must install A B
the same b release of Oracle Database Enterprise Edition for the primary
L I Z r a
database
A fe databases in your Data Guard configuration. Oracle Data
E andnallsstandby
I C I
Guard
- t r a only as a feature of Oracle Database Enterprise Edition; it is not
is available
TR available
non with Oracle Database Standard Edition.
PA Note: See the documentation titled Oracle Data Guard Concepts and Administration for
information about simulating a standby database environment when using Oracle
Database Standard Edition.
• If you use Oracle Automatic Storage Management (ASM) and Oracle Managed Files
(OMF) in a Data Guard configuration, you should use ASM and OMF symmetrically on
th primary
the i and
d standby
t db d database.
t b If any ddatabase
t b iin your D
Data
t GGuard
d configuration
fi ti
uses ASM, OMF, or both, then every database in the configuration should use the same
combination (that is, ASM, OMF, or both).
Note: An exception to this guideline is if you are using Data Guard as a technique to
migrate to ASM and/or OMF.
Benefits of Implementing
Oracle Data Guard
Oracle Data Guard provides the following benefits:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Quiz
a. Physical
b. Primary
c Logical
c.
d. Snapshot
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
I ferab
Answer: a, c, d Z
L
A E ns
I
IC n-tra
T R no
PA
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: c
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Practice 1: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Creating
C ti a Physical
Ph i l Standby
St db Database
D t b by
b
Using Enterprise Manager Cloud Control
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A
The screenshot inZthe Bslide b the home page for the primary database, with the top level
shows
menu structureL I r a
fe the following items: Oracle Database, Performance, Availability,
E containing
n s
Schema,IA
R IC n-tra
and Administration.
T access
To nothe
PAselect Add
Add Standby Database wizard, navigate to the primary database target and
Standby Database from the Availability menu. The Add Standby Database menu
item is the only Data Guard option on the Availability menu if a Data Guard configuration does
not already exist. After a Data Guard configuration is defined, the Availability menu will also
contain menu items for Data Guard Administration, Data Guard Performance, and Verify Data
Guard Configuration.
Before
B f you invoke
i k th
the Add St
Standby
db DDatabase
t b wizard,
i d verify
if th
thatt th
the primary
i d
database
t b
instance was started with a server parameter file (SPFILE) and that archiving is enabled.
Note: Actual webpages may differ with each version of Oracle Enterprise Manager. The
screenshots used in this lesson were taken with Oracle Enterprise Manager Cloud Control
12c Release 2 with patch set update (PSU) two installed (12.1.0.2.2).
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
The above webpage A BE bshows
snippet l e the Add Standby Database wizard after logging in for the
L I Z r a
first time. It provides
A E nthe s fefollowing options:
• IC I
Create
C eate a new
- tera physical
p ys ca sta
standby
dby database
R
T• Create n
no a new logical standby database
PA • Manage an existing standby database with Data Guard broker
• Create a primary database backup only
If you are not connected to the primary database when you select Add Standby Database
from the Availability menu, a Database Login window appears. You will then be able to select
from an existing named credential, or you can create a new credential. You must be
connected to the primary database with SYSDBA credentials to use the Add Standby
Database wizard.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b step one of six steps in creating a physical standby
shows
database. Step L I r a
fe the type of backup to be used for creating the standby
A E onendefines
s
I C I
database—either
- t r a
one that you create by performing an online backup, or an existing backup.
A TR Guard
Data
n onuses Oracle Recovery Manager (RMAN) to perform the backup.
P The online backup option can be performed using a direct copy approach that does not
require staging areas, or it can utilize staging directories. The staging directories can be
retained for future standby database creations, or they can be deleted after the standby
database is created. A backup performed into a staging area can be compressed to reduce
file size and transfer time, but it may also slow down datafile backup and restoration.
The existing
Th i ti bbackup
k option
ti requires
i a llevell 0 (f
(full)
ll) or llevell 1 (i
(incremental)
t l) RMAN b
backup
k ththatt
is typically performed as part of a regular backup strategy. You will be prompted for both the
existing RMAN backup location and a new staging area location on the primary database host
if you select this option.
Note: The actual Enterprise Manager webpages will vary depending on the options selected.
For example, if the Add Standby Database wizard is used to create a logical standby
y SQL Apply.
database, this step would also show all of the tables that are unsupported by y
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b step two of six steps in creating a physical standby
shows
database. Step L I r a
fe “Backup Options.” For an online direct backup, the degree of
A E twonisstitled
I C I
parallelism
- t r a as a backup option. In this step, you must supply the primary host
is specified
R nousing
credentials,
T n either an existing named credential or by creating a new credential. If the
A
P primary database does not currently have standby redo logs, this step will also require that
they be created. Oracle Enterprise manager will automatically determine the correct size and
number of groups to create for standby redo logs. You can select the option to use Oracle-
managed files (OMF) for the standby redo log files or you can explicitly name and locate the
standby redo logs that will be created on the primary database.
For backup types other than online direct backups
backups, you supply the staging area locations
locations,
existing RMAN backup locations, backup compression features, and whether to retain the
backups for future use depending on which backup method was chosen.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b step three of six steps in creating a physical standby
shows
L I r a
e “Database Location.” This step contains three sections. In the
E threensisftitled
database. Step
A
StandbyIDatabase r aAttributes section, you define the instance name of the standby database
and I C
Rwhether - t
nthe standby database will use file system storage or Automatic Storage
A T n o
P Management (ASM). In the Standby Database Location section, you define the host name for
the server to which the standby database will be transferred and the existing Oracle home
software location on that server. In the Standby Host Credentials section, you specify host
credentials to be used on the standby server machine (you can use existing named
credentials or you may create new credentials).
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b step four of six steps in creating a physical standby
shows
database. Step L I r a
fe “File Locations.” This step contains two sections, Standby
A E fournisstitled
Database
I C I - t r a and Listener Configuration. If a file system was selected in step three
File Locations
as
T Rthe database
n o n storage location, the Standby Database File Location section of this window
A
P allows you to keep the same files names and locations as the primary database uses, or
allows you to create a new directory structure compliant with Oracle Optimal Flexible
Architecture (OFA). If ASM was chosen in step three as the database storage location, Oracle
Enterprise Manager will prompt you to log in to the ASM instance to determine available ASM
disk groups and allow you to specify which ASM disk groups to use for storage. With either
p
option selected, a Customize button in this section allows yyou to view all individual datafiles,
tempfiles, logfiles, control files, directory objects, and external files, and to define specific
names and locations.
If staging directories had been selected earlier, an additional section, Standby Host Backup
File Access, appears. This allows the specific directory on the standby host machine to be
defined along with the file transfer method, either HTTP/S or FTP. There is also an option for
the standby database to access the files directly from a shared directory such as an NFS
mount.
mount
In the Listener Configuration section of this step, you specify the listener name and port
number for the listener. A new listener will be created if the specified listener name and port
does not already exist.
Note: When the Next button is clicked,, a warning
g message
g will appear
pp if any
y files for external
tables located on the primary database host already exist on the standby database host.
These files will be overwritten by the Add Standby Database wizard.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZtheA Bslide b step five of six steps in creating a physical standby
shows
L
database. Step
I r a
fe “Configuration.” This step contains four sections. The first section,
A E fiveParameters,
StandbyIDatabase
is titled
n s
I C - t r a prompts for the standby DB_NAME parameter (for logical
A TR ndatabases
standby n only), standby DB_UNIQUE_NAME parameter, STANDBY_ARCHIVE_DEST
oand
P parameter, FAST_RECOVERY_AREA_SIZE parameter. You can also select to delete
applied archive redo logs when space is needed.
The Standby Database Monitoring Credentials section of this step allows you to override
normal default monitoring credentials and specify SYSDBA credentials for monitoring. This is
required for a mounted standby database.
The D
Th Data
t GGuarddBBroker
k section
ti iis only
l di
displayed
l d if no existing
i ti b broker
k configuration
fi ti iis ffound.
d It
allows you to delete the broker configuration after the standby database is created if desired.
If there is an existing broker configuration, this section is hidden.
The Data Guard Connect Identifiers section allows you to specify connect identifiers for both
the primary database and standby database. You can use Enterprise Manager connect
descriptors that are explicitly coded into the LOG_ARCHIVE_DEST_n parameters, or specify
g net service name that can be used by
an existing y all databases. If a connect identifier for the
primary database has already been created previously for other standby databases, you will
not be prompted for it again here.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b step six of six steps in creating a physical standby
shows
database. Step L I r a
fe “Review” and it provides a recap of many of the settings entered
A E six isnstitled
I C I
on the previous
- t r a
five steps. The Standby Database Storage section can be expanded to show
all
T Rindividual
n o ndatafiles, tempfiles, logfiles, control files, directory objects, and external files that
A
P will be created on the standby database host. If everything is satisfactory, click Finish to
create a job to perform the tasks.
Note: There is no option to schedule the creation job to run at a future time. It will be an
immediate job submitted when the Finish button is clicked.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
When you click the A BEbutton
Finish l e
b step six of the Add Standby Database wizard, an Oracle
in
L I Z r a
Enterprise Manager
E njob s feis created and an information dialog window appears that provides a
URL linkIAto viewrthe a The screenshot in the slide shows the job activity window for the job
job.
I C
Rwasncreated.
that - t
n The default refresh mode for this window is manual refresh. Change the
A T o
P auto refresh option to one of the available time frequency choices to see changes happen
while they are in progress or manually click the refresh icon when desired. The Log Report
button will show the output log for all SQL*Plus, RMAN, and Listener Control Utility
(lsnrctl) utility commands used. The Debug button will provide more details in the logs,
including the actual RMAN script that was used to duplicate the primary database.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b the job activity window. The scroll bar on the right side of
shows
the window has L I r a
fe down to show individual job steps of the Create Standby
A E been n smoved
Database
I C I job. Each
- t r a or job step shows the target machine that the job step was run on,
row
the
T Rstatusnoofnthe job step, the start time of the job step, the end time of the job step, and a
A
P calculated elapsed time for the job step.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
After a Data Guard A BE blehas
configuration been defined, the Availability menu contains both Add
L I Z r a
e Guard Administration items. Clicking either one while on the
Standby Database
A E and n s fData
primary Idatabase r a page opens the Data Guard administration page.
home
I C - t
A TRscreenshot
The n on in the slide shows the Data Guard administration page. The Overview section
P on this page displays the Data Guard status for the configuration, the protection mode, and
whether Fast-Start Failover has been enabled. The Primary Database section of this page
shows the hostname of the primary database, current log sequence number, and an option to
edit primary database properties. The Standby Databases section of this page shows all
standby databases that are configured for this environment along with properties about each
database such as name
database, name, host machine on which it resides
resides, status
status, role
role, whether real-time
real time
query is enabled, last received redo log, last applied redo log, and an estimated failover time
for that particular standby database.
A chart on the Data Guard Administration page graphs both transport lag and apply lag for
each standby database. Transport lag is the time difference between the last update on the
primary database and the last received redo on the standby database. Apply lag is the time
difference between the last update on the primary database and the last applied redo on the
standby
t db d database.
t b A
An Add St
Standby
db DDatabase
t b b
button
tt on thi
this page iis used
d tto create
t additional
dditi l
standby databases, and links at the bottom navigate to performance monitoring and
verification.
Verifying Configuration
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b the progress indicator of the Verify Configuration
shows
administrative L I r a
e be invoked from the Data Guard administration page. The verify
thatfcan
A Etask n s
I C I
configuration task
- t r a
performs a series of validation checks on the Data Guard configuration,
A TR naohealth
including n check of each database and agent. The Verify Configuration operation:
P • Determines the current data protection mode settings, including the current redo
transport mode settings for each database and whether the standby redo logs are
configured properly. If standby redo logs are needed for a database, a message
indicates this on the Detailed Results page. You can then add the standby redo logs.
• Validates each database for the current status
• P f
Performs a log
l switch
it h on th
the primary
i d
database
t b (f
(for non-RAC
RAC ddatabases)
t b ) and
d verifies
ifi
that the log was applied on each standby database
• Checks the agent status for each database. The verify process executes a SQL*Plus job
on the agent if credentials are available. If credentials are not available to run the job,
the agent is pinged instead. If errors occur, a message appears on the Results page.
• Displays the results of the Verify Configuration operation (including errors)
Note: You can cancel the Verify Configuration operation at any time by clicking Cancel.
Cancel
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Enterprise Manager A BE Control
Cloud l e
b 12c can manage the Fast-Start Failover feature for Data
Guard. This E L I Z r a
e discussed in more detail in lesson titled “Enabling Fast Start
feature willfbe
I
Failover.” A a n
The screenshot
s in the slide shows the Configure page for Fast-Start Failover. It
I C
R you
allows - t r
tonspecify which standby database Fast-Start failure will use as the failover target,
A T n o
P which host and alternate host will be used for the Data Guard observer process, failover
properties, and primary database properties related to the Fast-Start Failover configuration.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Enterprise Manager A BE Control
Cloud l e
b 12c can manage primary database properties related to
L I Z r a
the Data Guard fe In order to access the Edit Primary Database Properties page,
E configuration.
n s
navigateIAto the Data
r a Guard administration home page of the primary database and click the
Edit I C -
Rlink nbeside t
n the properties label of the primary database section. The screenshot in the
A T o
P slide shows the General tab for editing primary database properties. There is also a Standby
Role Properties tab and a Common Properties tab. The General tab allows the broker to be
disabled or enabled, redo transport to be started or stopped, and allows viewing of the alert
log of the primary database and standby database.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
Additional Data Guard A Bparameters
b that can be edited for the primary database can be found
L I Z r a
on the Standby
A s fe
E Rolenproperties tab and the common properties tab. The screenshot in the
I C I
slide shows
- t r a
the Standby Role Properties tab found on The Edit Primary Database Properties
A TR Compression
page. ontab yousetting
On this
n
can set the redo transport mode to SYNC, FASTSYNC, or ASYNC, the
P Redo to ENABLE or DISABLE, and you can specify the number of
seconds for Net Timeouts and the number of minutes for the Apply Delay. You can also
specify the Standby Archive location and turn on or turn off log shipping to the standby
database. The setting for standby archive location will only take effect after a role reversal,
which allows the current primary database to become a standby database.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The screenshot inZthe A Bslide b the Common Properties tab of the Edit Primary Database
shows
L
Properties page.
I r a
fetab, you can define redo routes, the Data Guard connect identifier for
A E Onnthis s
I C I
the primary
- t r a
database, the number of log archive process, and the trace level for Data Guard
A TR non
processes.
P
Test Application
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
The test application A BE ofbOracle
feature l e Enterprise Manager on the Data Guard administration
L I Z r a
webpage allows
A E a thorough
n s fe testing of Data Guard by generating a workload on the primary
database.
I C I - t r a
This workload will generation many transactions per second, cause log switching at
the
T Rprimary,
n o nand monitor the reception of the redo on the standby database and the
A
P application of the received redo. The screenshot in the slide shows the test application page
in progress of a running test. You have the ability to start, stop, or pause the test application.
Statistics show the current transactions per minute (33 in the screenshot). There are three
graphs on this page. The first graph shows the redo generation rate on the primary database
measured in kilobytes per second. The second graph shows both the current transport lag
pp y lag
and current apply g measured in seconds on the standby y database. The third g
graph
p shows
the apply rate measure in kilobytes per second on the standby database.
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
Practice 2: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
O
Oracle
l NNett S
Services
i in
i a Data
D t Guard
G d
Environment
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
1 2 Dedicated
server
process
s a
3
) ha
Client Listener Database
l ฺ c om
m ai ฺ
Instance
9 @ g
u ide
i z 9 nt G
u
pr tude
(
Database as
R ON a client
h i s S another database
to
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Oracle Net Services A BE enterprise-wide
provide b l e connectivity solutions in distributed,
L I Z r a
heterogeneous
A E computing
n s fe environments. It enables a network session from a client
I C I
application
- t a Database server.
to anrOracle
AATR
dedicated
n onserver process is a type of service handler that the listener starts when it receives
P a client request. The slide depicts the process of establishing a connection from a client to an
Oracle Database (non-shared server architecture) by using the following steps:
1. The listener receives a client connection request.
2. The listener starts a dedicated server process.
3. The listener provides the location of the dedicated server process in a redirect message.
g
4. The client connects directly to the dedicated server.
Note: Depending on the operating system and transport protocol, step three may be
eliminated. In this case, the dedicated server process inherits the connection request from the
listener. The result is the same—a network session established is between the client and the
dedicated server process.
If the client and database exist on the same computer, then the application initiating the
session can spawn a dedicated server process without going through the listener. This is
known as the bequeath protocol and is often used when starting a database instance.
LOG_ARCHIVE_DEST_2='SERVICE=london …'
specified.
PRMY =
(DESCRIPTION =
(ADDRESS_LIST =
(FAILOVER=on)
(ADDRESS=(PROTOCOL=TCP)(HOST=host01.example.com)
(PORT=1521)(SEND_BUF_SIZE=10485760)
a
has
(RECV_BUF_SIZE=10485760))
(ADDRESS=(PROTOCOL=TCP)(HOST=host03.example.com)
m )
(PORT=1521)(SEND_BUF_SIZE=10485760) l ฺc o
a i
(RECV_BUF_SIZE=10485760))
@ gm ideฺ
99 nt Gu
)
(SDU=65535) i z
( pru tude
(CONNECT_DATA=(SERVICE_NAME=prmy.example.com))
) ON is S
A RR se th
I Z B ou
R U and/or
Copyright © 2014, Oracle
e tits affiliates. All rights reserved.
H icen s
T l
Role-reversal operations A BEsuchbas l e failover and switchover can modify which host the primary
L I Z e r a
A E nissfcurrently
or standby database running on. The client configuration should include a connect
descriptor
I C I - t r a
that includes all potential host that a particular service can run on. This can be
R nobynspecifying an ADDRESS_LIST with multiple listening endpoints or addresses
configured
T
A
P within it. Connect-time failover instructs Oracle Net to fail over to a different listener if the first
listener fails. The use of the ADDRESS_LIST clause turns on connect-time failover by default.
It is not necessary to use the FAILOVER=on statement, as indicated by the red text in the
slide.
When the application connections are being made, if they should happen to attempt to
connect to an old primary host that is unavailable
unavailable, the connection attempt to that host should
last no longer than 3 seconds. This allows for connection attempts to get through the
ADDRESS_LIST quickly until a new primary host is found. This can be configured with the
following entry placed into the sqlnet.ora file:
SQLNET.OUTBOUND_CONNECT_TIMEOUT=3
Note: The ADDRESS_LIST clause is optional. Multiple addresses can be defined without
explicitly using the ADDRESS_LIST syntax. In this case, the failover mode would default to be
off and it would explicitly require the FAILOVER=on syntax to enable connect-time failover.
$ORACLE_HOME/network/admin/listener.ora
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
A BE bis lconfigured
Dynamic service registration e in the database initialization file. It does not require
L
any configuration I Z thefe r a
A E inparameter
n s listener.ora file. If not specified, the value for the
I C I
SERVICE_NAMES
- t r a defaults to the global database name, a name comprised of the
A TR ndefined,on theandDB_UNIQUE_NAME
DB_UNIQUE_NAME DB_DOMAIN parameters in the initialization parameter file. If not
P explicitly parameter defaults to the value DB_NAME. The value
for the INSTANCE_NAME parameter defaults to the Oracle system identifier (SID). All of these
names can be explicitly defined to non-default values.
SERVICE_NAMES specifies one or more names by which clients can connect to the instance.
The instance registers its service names with the listener. You can specify multiple service
names to distinguish among different uses of the same database.
database For example:
SERVICE_NAMES=PROD,DG_PRMY,DG_RW,MAIN_REPORTING
By default, the LREG process registers service information with its local listener on the default
local address of TCP/IP, port 1521. To have the LREG process register with a local listener
that does not use TCP/IP, port 1521, configure the LOCAL_LISTENER parameter in the
initialization parameter file to locate the local listener.
A remote listener is a listener residing on one computer that redirects connections to a
database instance on another computer. You can configure registration to remote listeners
using the REMOTE_LISTENER parameter.
The default and maximum amount for the receive socket memory can be determined with:
# cat /proc/sys/net/core/rmem_default
# cat /proc/sys/net/core/rmem_max
s a
The default and maximum amount for the send socket memory can be determined with: ) ha
# cat /proc/sys/net/core/wmem_default
l ฺ c om
m ai ฺ
ide
# cat /proc/sys/net/core/wmem_max
@ g
9
9 nt G u
u i z
Adjust values with the following commands:
( pr tude
# echo 'net.core.wmem_max=10485760' >>
R ON s S
/etc/sysctl.conf
h i
# echo 'net
'net.core.rmem_max=10485760'
core rmem max 10485760'
B et
AR >>us/etc/sysctl.conf
/etc/sysctl conf
U IZ e to
H Rinitial
You must also set minimum size,
T e n s and maximum size in bytes:
size,
A TR non
/etc/sysctl.conf
P
Reload the changes made by using the following command:
# sysctl –p
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Practice 3: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Creating
C ti a Physical
Ph i l Standby
St db Database
D t b by
b
Using SQL and RMAN Commands
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
Steps to Create
a Physical Standby Database
1. Prepare the primary database.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
consistency.
• FORCE LOGGING forces redo to be generated even when
NOLOGGING operations
p are executed.
• Temporary tablespaces and temporary segments are not
logged.
• FORCE LOGGING is recommended for both physical and
a
logical standby databases.
) has
• Issue the following command on the primary database:com
a ilฺ
SQL> ALTER DATABASE FORCE LOGGING;
@ gm ideฺ
i z 99 nt Gu
( pru tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l whether the Oracle database server logs all changes in
A Bdetermines
rab to temporary tablespaces and temporary segments). The
FORCE LOGGING mode
LIZ sforfechanges
the databaseE(except
C
[NO]FORCE
I IA LOGGING
- t r an clause of the ALTER DATABASE command contains the following
A TR non
settings:
P • FORCE LOGGING: This setting takes precedence over (and is independent of) any
NOLOGGING or FORCE LOGGING settings that you specify for individual tablespaces and
any NOLOGGING setting that you specify for individual database objects. All ongoing,
unlogged operations must finish before forced logging can begin.
• NOFORCE LOGGING: Places the database in NOFORCE LOGGING mode. This is the
default.
default
The FORCE_LOGGING column in V$DATABASE contains a value of YES if the database is in
FORCE LOGGING mode.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
(recommended).
• Create standby redo logs using the same file size as the
primary database online redo logs.
• Create one additional group more than the number of
online redo log groups.
Online Redo Standby
redo logs shipment Redo logs s a
) ha
l ฺ c om
m ai ฺ
RFS 9 @ g
u ide
i z 9 nt G
u
pr Standby de
( t u
Primary
database R ON hisdatabase S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A standby redo log A
is BE only
used b l e
when the database is in the standby role to store redo data
L I Z r a
received from
A Ethe primary
n s fe database. Standby redo logs form a separate pool of log file
groups. IConfiguring
r a standby redo log files is highly recommended for all databases in a Data
I C - t
A TR configuration
Guard
n on to aid in role reversal.
P You should create at least one more standby redo log group than you have online redo log
groups in the primary database. In addition, each standby redo log file must be at least as
large as the largest redo log file in the redo log of the redo source database.
A standby redo log is required to implement:
• Synchronous transport mode
• Real-time apply
• Cascaded redo log destinations
Note: By configuring the standby redo logs on the primary database, the standby redo logs
are created automatically on the standby database when you execute the DUPLICATE
TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE RMAN command. They will also
be automatically created on the Far Sync server as well when it is created, provided that they
already
l d existi t on th
the primary
i machine.
hi F
Far S
Sync will
ill b
be di
discussed
d llater
t iin th
the course.
Standby Archived
Redo from redo logs redo logs
primary database
RFS ARC0
s a
MRP/LSP ) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
r ude
pdatabase
Standby (
N is St
O
A RR se th
I Z B ou
R U and/or
Copyright © 2014, Oracle
e tits affiliates. All rights reserved.
H icen s
T l
If standby redo logs A BE
are b
availablel e and configured correctly, the RFS process will write the
L I Z r a
e database to the standby redo logs. Because the files are
redo received
A Efrom nthesfprimary
generally
I C I the same
- t r a as the online redo logs of the primary database, they should fill up
size
and
T Rswitchn oatna similar frequency as the online redo logs. There may be some delay due to
A
P the latency of the network transmission of the redo. The additional standby redo log group
should allow the log switch of the standby redo logs without causing wait states. At log switch
of the standby redo logs, the ARC0 process will create an archived redo log using the
completed standby redo log.
The RFS process creates and writes directly to an archived redo log file instead of the
standby redo log if any of the following conditions are met:
• There are no standby redo logs.
• It cannot find a standby redo log that is the same size as or larger than the incoming
online redo log file.
• All standby redo logs of the correct size have not yet been archived.
Note: In previous releases, the parameter STANDBY_ARCHIVE_DEST was used to identify
the location of the archived redo logs created on the standby database host that were created
from the standby redo logs. This parameter is now deprecated, because an appropriate
location is automatically chosen.
changes:
or s a
) ha
SQL> ALTER DATABASE ADD STANDBY LOGFILE
l ฺ c om
2 '+DATA' SIZE 52428800; m ai ฺ
g e
Database altered. 9@ uid 9 nt G
u i z
( pr tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
You can create standbyA BE redob l
logse by using the ADD STANDBY LOGFILE clause of the ALTER
LIZ sAlthough
DATABASE statement.
E f era standby redo logs are used only when the database is
operating
I C r an role, you should create standby redo logs on the primary database
IAin the-tstandby
A TRthat switching
so
n on roles does not require additional DBA intervention.
P You should create standby redo log files on the primary database prior to using the
DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE RMAN command
so that RMAN creates standby redo log files automatically on the standby database.
Create standby redo log file groups by using the following guidelines:
• Each standby redo log file must be at least as large as the largest redo log file in the
redo source database. For administrative ease, Oracle recommends that all redo log
files in the redo source database and the redo transport destination be of the same size.
• The standby redo log must have at least one more redo log group than the redo log on
the redo source database.
s a
) ha
SQL> SELECT group#, dbid, thread#, sequence#, status
om
2 FROM v$standby
$ y_log;
g;
l ฺ c
ai ฺ
GROUP# DBID THREAD# SEQUENCE# STATUS
---------- ---------- ---------- ---------- ---------- m
4 2581955083 1 44 ACTIVE
9 @ g
u ide
5 UNASSIGNED 1 0 UNASSIGNED
i z 9 nt G
u
pr tude
6 UNASSIGNED 1 0 UNASSIGNED
(
7 UNASSIGNED 0 0 UNASSIGNED
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E logslewere l
To verify that standbyA Bredo b created, query V$STANDBY_LOG or V$LOGFILE. An
L I Z r a
example output
A E using n s fe
Automatic Storage Management (ASM) is shown below:
I
Q C SELECT
I'STANDBY‘;
SQL>
- tragroup#,
g p , type,yp , member FROM v$logfile $ g WHERE type
yp =
T R o n
PA GROUP#n TYPE MEMBER
---------- ------- ------------------------------------------------
4 STANDBY +SBDAT/london/onlinelog/group_4.266.711624939
5 STANDBY +SBDAT/london/onlinelog/group_5.267.711624945
6 STANDBY +SBDAT/london/onlinelog/group_6.268.711624951
+SBDAT/london/onlinelog/group 6 268 711624951
7 STANDBY +SBDAT/london/onlinelog/group_7.269.711624957
4 STANDBY +SBFRA/london/onlinelog/group_4.259.711624941
5 STANDBY +SBFRA/london/onlinelog/group_5.260.711624947
6 STANDBY +SBFRA/london/onlinelog/group_6.261.711624955
7 STANDBY +SBFRA/london/onlinelog/group_7.262.711624963
8 rows selected.
PA
T no
Setting LOG_ARCHIVE_CONFIG
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Specify the DG_CONFIG A BEattributel e
b the LOG_ARCHIVE_CONFIG parameter to list the
of
L I Z r a
E nofsthe
DB_UNIQUE_NAME
A fe primary and standby databases in the Data Guard configuration. By
I C I
default, the r a
LOG_ARCHIVE_CONFIG
- t parameter enables the database to send and receive
T R ThenLOG_ARCHIVE_CONFIG
redo. o n parameter can be used to disable the sending of redo logs
A
P to remote destinations or disable the receipt of remote redo logs. The complete syntax for the
LOG_ARCHIVE_CONFIG parameter is as follows:
LOG_ARCHIVE_CONFIG = {
[ SEND | NOSEND ][ RECEIVE | NORECEIVE ]
[ DG_CONFIG=(remote_db_unique_name1
[, ... remote_db_unique_name9) | NODG_CONFIG ] }
Use the V$DATAGUARD_CONFIG view to see the unique database names defined with the
DB_UNIQUE_NAME and LOG_ARCHIVE_CONFIG initialization parameters; you can thus view
the Data Guard environment from any database in the configuration. The first row of the view
lists the unique database name of the current database that was specified with the
DB_UNIQUE_NAME initialization parameter. Additional rows reflect the unique database
names of the other databases in the configuration that were specified with the DG_CONFIG
DG CONFIG
keyword of the LOG_ARCHIVE_CONFIG initialization parameter.
DB_UNIQUE_NAME
------------------------------
boston
s a
) ha
london
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Setting LOG_ARCHIVE_DEST_n
– Local archiving
– Standby database location
• Include (at a minimum) one of the following:
– LOCATION: Specifies a valid path name
– SERVICE: Specifies a valid Oracle Net Services name
referencing a standby database
a
• Include a LOG_ARCHIVE_DEST_STATE_n parameter for
) has
each defined destination
destination. om
ilฺc
LOG_ARCHIVE_DEST_2=
g ma deฺ
'SERVICE=london
9 9 @ Gui
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
r u iz ent
DB_UNIQUE_NAME=london'
N (p Stud
LOG_ARCHIVE_DEST_STATE_2=ENABLE O is
A RR se th
I Z B ou
R U and/or
Copyright © 2014, Oracle
e tits affiliates. All rights reserved.
H icen s
T
BE ble l
By using the variousALOG_ARCHIVE_DEST_n attributes, you define most of the settings for
L I Z r a
the Data Guard fe The Redo Transport Service is directly controlled by these
E configuration.
n s
settings.IA
A numberr a of different attributes can be set for each LOG_ARCHIVE_DEST_n
I C
R noMost
parameter. - t
n have defaults that are adequate for most configurations. See Oracle Data
A T
P Guard Concepts and Administration for a complete list and a description of each.
You should specify a LOG_ARCHIVE_DEST_n parameter (where n is an integer from 1 to 31)
for the local archiving destination and one for the standby location. In previous versions of
Oracle Database, LOG_ARCHIVE_DEST_10 was set to USE_DB_RECOVERY_FILE_DEST
when the fast recovery area was being used. Beginning with Oracle Database 11g Release 2,
you must manually set a location to use the fast recovery area
area. Query the V$ARCHIVE_DEST
V$ARCHIVE DEST
view to see current settings of the LOG_ARCHIVE_DEST_n initialization parameter.
All defined LOG_ARCHIVE_DEST_n parameters must contain, at a minimum, either a
LOCATION attribute or a SERVICE attribute.
In addition, you must have a LOG_ARCHIVE_DEST_STATE_n parameter for each defined
destination. LOG_ARCHIVE_DEST_STATE_n defaults to ENABLE.
Primary Standby
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
database database
Not used
s a
) ha
log_archive_dest_2 = log_archive_dest_2
l hi d t 2 =
l ฺ c om
'service=london async 'service=boston asyncai
valid_for= valid_for=
@ gm ideฺ
(online_logfile, z 99 nt Gu
(online_logfile,
i
primary_role) ( pru tude
primary_role)
db_unique_name=london'
RON S
db_unique_name=boston'
h is
R
A use t
Z B
I and/or
UOracle
Copyright © 2014,
R e titsoaffiliates. All rights reserved.
H icen s
T l
The VALID_FOR attributeA BEof the b l e initialization parameter enables you
L I Z r a LOG_ARCHIVE_DEST_n
to identify exactly
A E when n s fethe archive destination is to be used, as well as which type of log file it
I C I
is used for.
- t r a uses a keyword pair to identify the redo log type as well as the
The attribute
R nrole.
database
T o n Using this attribute enables you to set up parameters in anticipation of
A
P switchover and failover operations.
In the example in the slide, there is a destination on the standby database and the primary
database defined with the VALID_FOR setting shown. This destination is to be used on the
standby database only after a switchover, when the standby becomes a primary. The
destination on the old primary is ignored when it becomes a standby.
You supply two values for the VALID_FOR
VALID FOR attribute: redo_log_type
d l t and database_role.
d t b l
The redo_log_type keywords are:
• ONLINE_LOGFILE: This destination is used only when archiving online redo log files.
• STANDBY_LOGFILE: This destination is used only when archiving standby redo log files
or receiving archive logs from another database.
• ALL_LOGFILES: This destination is used when archiving either online or standby redo
l fil
log files.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
s a
) ha
LOG_FILE_NAME_CONVERT Converts primary database log file names
A TR non
P
A TR nprocess
recovery on halts with an error.
P You specify the path name and file name location of the primary database data files followed
by the standby location by setting the value of this parameter to two strings. The first string is
the pattern found in the data file names on the primary database. The second string is the
pattern found in the data file names on the physical standby database. You can use as many
pairs of primary and standby replacement strings as required. You can use single or double
quotation marks.
marks Parentheses are optional.
optional
In the example in the slide, /oracle1/dba/ and /oracle2/dba/ are used to match file
names coming from the primary database. /ora1/stby_dba/ and /ora2/stby_dba/ are
the corresponding strings for the physical standby database. A file on the primary database
named /oracle1/dba/system01.dbf is converted to
/ora1/stby_dba/system01.dbf on the standby database.
Multiple pairs can be specified such as ('a','b','1','2').
Note: If the standby database uses Oracle Managed Files (OMF), do not set the
DB_FILE_NAME_CONVERT parameter. There is a 255-character limit on this parameter.
DB_FILE_NAME_CONVERT.
• LOG_FILE_NAME_CONVERT must be defined on standby
databases that have different disk or directory
y structures
from the primary.
• LOG_FILE_NAME_CONVERT applies only to a physical
standby database.
• LOG_FILE_NAME_CONVERT can be set in the DUPLICATE a
RMAN script
script. ) has
om
a ilฺc
@ gm ideฺ
LOG_FILE_NAME_CONVERT = ('/oracle1/logs/',
i z 99 nt Gu
pru tude
'/ora1/stby_logs/')
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
The LOG_FILE_NAME_CONVERTA BE ble parameter is used to convert the name of a redo log file on
L I Z r a
E nstofethe name of a redo log file on the standby database. Adding a redo
the primary database
log file toIA
the primary
r a database requires adding a corresponding file to the standby database.
I C
R thenstandby
When - t
n database is updated, this parameter is used to convert the log file name
A T o
P from the primary database to the log file name on the standby database. This parameter is
required if the standby database is on the same system as the primary database or on a
separate system that uses different path names.
Specify the location of the primary database online redo log files followed by the standby
location. The use of parentheses is optional.
Both DB_FILE_NAME_CONVERT
DB FILE NAME CONVERT and LOG_FILE_NAME_CONVERT
LOG FILE NAME CONVERT parameters perform simple
string substitutions. For example, ('a','b') will transform the following:
/disk1/primary/mya/a.dbf into
/disk1/primbry/myb/b.dbf
Multiple pairs can be specified such as ('a','b','1','2').
Note: If the standby database uses OMF, do not set the LOG_FILE_NAME_CONVERT
parameter. There
Th iis a 255
255-character
h lilimiti on this
hi parameter.
• FAL_SERVER is:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
DB_NAME=boston
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_CONFIG='DG_CONFIG=(boston,london)'
CONTROL_FILES='/u01/app/oracle/oradata/boston/control01.ctl',
/ 1/ / l / d /b / l 1 l
'/u01/app/oracle/oradata/boston/control02.ctl'
LOG_ARCHIVE_DEST_2=
'SERVICE=london
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=london'
s a
LOG_ARCHIVE_DEST_STATE_2=ENABLE
) ha
REMOTE LOGIN PASSWORDFILE EXCLUSIVE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
l ฺ c om
LOG_ARCHIVE_FORMAT=arch_%t_%s_%r.log
m ai ฺ
g ide
FAL_SERVER=london
STANDBY_FILE_MANAGEMENT=auto 9 @
9 nt G u
DB_FILE_NAME_CONVERT='boston','london'
u i z
LOG_FILE_NAME_CONVERT='boston','london' ( pr tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
In the example in theA BE assume
slide, l e
b that the primary database is named boston and the
L I Z r a
standby is named
A E london.
n s fe For each, an Oracle Net Services name is defined.
Note: I traparameters can also be used to change ASM disk groups. For example:
ICThe convert
-
T R no n
PA
DB_FILE_NAME_CONVERT=('+DATA','+SBDAT')
LONDON =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=host03.example.com)
(PORT=1521)(SEND_BUF_SIZE=10485760)
(RECV_BUF_SIZE=10485760))
)
(SDU=65535) a
(CONNECT_DATA=(SERVICE_NAME=london.example.com))
) has
) om
a ilฺc
@ gm ideฺ
i z 99 nt Gu
( pru tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A
Use Oracle Net ManagerBEto definel e
b a network service name for your physical standby
L I Z r a
database. The
A fe the entry in the tnsnames.ora file that was generated by Oracle
E slidenshows
s
I
IC n-tra
Net Manager.
R
T Thisoentry is used to connect to the standby database when invoking RMAN and
Note:
PAexecutingnthe DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE
command. It is also used in the LOG_ARCHIVE_DEST_2 parameter for the SERVICE value to
define the redo transport to the standby database.
A TR This
Note: n n is needed because the instance is shut down and restarted during the
oentry
P standby database creation using RMAN.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
You can create a Z A BE file
password l e
b your physical standby database by copying the primary
for
L I r a
E nfilesftoe the physical standby database host and renaming it.
database password
A
Note:
I I
CIt would - trapossible to use the orapwd utility to create a password file, but that
be
T R
technique n
noshould always be avoided with Data Guard. The Recovery Manager DUPLICATE
PADATABASE command is being used in this lesson and RMAN will automatically copy the
password file from the primary and replace the one that was created. Manual creation will not
work when creating other Data Guard servers such as Far Sync (to be discussed later in the
course).
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BEparameter
Create a text initialization b l e file containing only the DB_NAME and DB_DOMAIN
L I Z r a
initialization E
A
parameters.
n s fe
I a
C n-trparameter
This Iinitialization file is used to start the physical standby database in NOMOUNT
R
T prioroto the execution of the DUPLICATE TARGET DATABASE FOR STANDBY FROM
mode
PAACTIVE nDATABASE RMAN command. When you execute this command, RMAN creates a
server parameter file for the standby database.
Creating Directories
for the Physical Standby Database
Create the baseline directory structures needed on the physical
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
[oracle@host03]$ mkdir -p
/u01/app/oracle/admin/london/adump
[oracle@host03]$ mkdir -p
/u01/app/oracle/oradata/london
[oracle@host03]$ mkdir -p
a
has
/u01/app/oracle/oradata/london/pdbseed
[oracle@host03]$ mkdir -p
p m )
o
/u01/app/oracle/oradata/london/dev1
a ilฺc
[oracle@host03]$ mkdir -p
@ gm ideฺ
99
/u01/app/oracle/fast_recovery_area/london Gu iz ent
r u
N (p Stud
R RO this
B A use
Z
I and/or
UOracle
Copyright © 2014, titsoaffiliates. All rights reserved.
R s e
T H icen
BEstructurel e l
I Z A
Create an initial directory
r a b for the physical standby database in the
L
E nsfeand $ORACLE_BASE/oradata locations. The directories to be
$ORACLE_BASE/admin
C A
created Idepend
t on
r a whether the primary database is using file locations for data files or
I
R noStorage
Automatic -
n Manager. If multi-tenant architecture is being used, additional directories
A T
P are needed. The above example is for a file system–based, multi-tenant installation using a
single pluggable database named DEV1. Additional pluggable databases on the primary
server will require additional directories to be created if the file system is used for storage.
mode:
A TR recommends
machine.
n on will require
This that the ORACLE_HOME and PATH location change accordingly.
P Oracle the oraenv utility to change environment variables provided entries exist
in the /etc/oratab file. The oraenv utility will adjust ORACLE_SID, ORACLE_BASE,
ORACLE_HOME, PATH, and LD_LIBRARY_PATH environment variables. The ORACLE_HOME
variable should point to the Grid Infrastructure software directories when starting the listener
by using the LSNRCTL utility. However, the ORACLE_HOME variable should point to the
database software directories when starting g the database.
Note: Because the initialization parameter file contains only entries for DB_NAME and
DB_DOMAIN, memory sizes for the System Global Area will use default values. Later the
DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE RMAN command
will copy the initialization parameter values for memory sizing from the primary database
configuration.
database:
run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
s a
duplicate target database for standby ) ha
from active database l ฺ c om
m ai ฺ
Note: The script continues in the next slide. 9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le lthe DUPLICATE TARGET DATABASE FOR STANDBY FROM
A Bcontaining
Create an RMAN script b
L IZ command.
e r a
E nsf
ACTIVE DATABASE
A
I tra to using RMAN to create the standby database. They include:
ICare advantages
There -
T R n
no can create a standby database by copying the files currently in use by the
PA • RMAN primary database. No backups are required.
• RMAN can create a standby database by restoring backups of the primary database to
the standby site. Thus, the primary database is not affected during the creation of the
standby database.
• RMAN automates renaming g of files, including
g Oracle Managed
g Files ((OMF)) and
directory structures.
• RMAN restores archived redo log files from backups and performs media recovery so
that the standby and primary databases are synchronized.
Note: You can use the CONFIGURE … PARALLELISM integer command to configure
automatic channels for the specified device type. For additional information, see the Oracle
Database Backup and Recovery Reference.
spfile
parameter_value_convert 'boston','london'
set db_unique_name='london'
set db_file_name_convert='boston','london'
set log_file_name_convert='boston','london'
set log_archive_max_processes='10'
set fal_server='boston'
set log_archive_config='dg_config=(boston,london)'
set log_archive_dest_2='service=boston ASYNC a
valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE)
) has
db unique name boston'
db_unique_name=boston' om
nofilenamecheck; a ilฺc
} gm deฺ @ Gui
9 9
r u iz ent
N (p Stud
R RO this
B A use
Z
I and/or
UOracle
Copyright © 2014, titsoaffiliates. All rights reserved.
R s e
T H icen
BE the l e l
In the RMAN script,
I Z Aspecify
r a b settings for the physical standby initialization parameters. You
only need toE L fe
specify parameters
s that are different than those on the primary database.
C I
Parameters A related
t r a n
to directory paths for data files, control files, and online redo logs that are
I -
A TR ndoonot
different n have to be specified if DB_FILE_NAME_CONVERT and
P LOG_FILE_NAME_CONVERT are used.
RFS
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Primary MRP
database Standby
redo log
files
s a
ARC0 ) ha
l ฺ c om
m ai ฺ
9 @ g
u i de
Archived
i z 9 nt G
redo log u
pr tuStandby de
(
files
R ON his S database
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
With the real-timeZ A BE
apply l e
b apply services apply the redo data from standby redo log
feature, log
L I r a
e time the log files are being written to) as opposed to recovering
E (at nthesfsame
files in real time
A
redo from
I C I archived
- t r a log files when a log switch occurs. If for some reason the apply
redo
R isnunable
service
T o n to keep up (for example, if you have a physical standby in read-only mode
A
P for a period of time), then the apply service automatically goes to the archived redo log files
as needed. The apply service also tries to catch up and go back to reading the standby redo
log files as soon as possible.
Real-time application of redo information provides a number of benefits, including faster
switchover and failover operations, up-to-date results after you change a physical standby
database to read
read-only
only, up-to-date
up to date reporting from a logical standby database
database, and the ability to
leverage larger log files on the primary database resulting in larger standby redo logs on the
standby database.
Having larger log files with real-time apply is desirable because the apply service stays with a
log longer and the overhead of switching has less impact on the real-time apply processing.
The RECOVERY_MODE column of the V$ARCHIVE_DEST_STATUS view contains the value
MANAGED REAL TIME APPLY when log apply services are running in real-time apply mode.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Special Note:
Data Guard Support for Oracle Multitenant
• A multitenant container database (CDB) can have a
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Special Note:
Standby Database on the Same System
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Primary Standby
/oracle/dba /oracle/standby/dba
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
Practice 4: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
U i O
Using Oracle
l AActive
ti Data
D t Guard
G d
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
Redo Redo
transport apply
Redo
Primary stream Physical standby Queries s a
database database
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
With Oracle Active A BEGuard,
Data l e
b can use a physical standby database for queries while
you
L I Z r a
redo is applied
A fe standby database. This feature enables you to use a physical
E to thensphysical
standby Idatabase r afor disaster recovery and to offload work from the primary database during
I C
R operation.
normal - t
n The physical standby is in a read-only mode, so no additional indexes or
A T n o
P materialized views may be created to support reporting activities.
Note: If you need to create additional structures (such as indexes and materialized views),
you can create a logical standby database as described in the lesson titled “Creating a
Logical Standby Database.”
In addition, this feature provides a loosely coupled read/write clustering mechanism for OLTP
workloads
kl d when h configured
fi d as ffollows:
ll
• Primary database: Recipient of all update traffic
• Several readable standby databases: Used to distribute the query workload
The physical standby database can be opened in read-only mode only if all files were
recovered up to the same system change number (SCN). Otherwise, the open fails.
2 Open
2. O the
th database
d t b ffor read-only
d l access:
SQL> ALTER DATABASE OPEN READ ONLY;
database.
• Assess the value for STANDBY_MAX_DATA_DELAY.
• Focus on periods of time when the apply lag exceeds
desired levels so that issue can be resolved.
SQL> SELECT * FROM V$STANDBY_EVENT_HISTOGRAM
2> WHERE NAME = 'apply lag' AND COUNT > 0;
ALTER SESSION
SET STANDBY_MAX_DATA_DELAY = {INTEGER|NONE}
s a
) ha
• If the limit is exceeded
exceeded, an error message is returned:
l ฺ c om
ORA-3172 STANDBY_MAX_DATA_DELAY has been exceeded m ai ฺ
• This setting is ignored for the SYS user. 99@ Gui
g de
r u iz ent
N (p Stud
R RO this
B A use
Z
I and/or
UOracle
Copyright © 2014, titsoaffiliates. All rights reserved.
R s e
T H icen
BEthrough l e l
You can configure aAlimit b the use of the STANDBY_MAX_DATA_DELAY session
L I Z r a
parameter. Use
A fe parameter to specify a limit for the amount of time (in seconds)
E thisnsession
s
allowed Ito elapse r a
between when changes are committed on the primary database and when
I C - t
A TR same
those
n onchanges can be queried on the active standby database.
P If the specified limit cannot be met, an error is returned to the query as follows:
ORA-3172 STANDBY_MAX_DATA_DELAY has been exceeded
This guarantees that a query will not receive a “stale result” if the apply lag exceeds the
service level agreement. In addition, a warning message is written to the standby database
alert log.
The default value is NONE, which indicates that queries issued to the physical standby
database will be executed regardless of the apply lag on that database.
• Is database role–aware
– It uses DATABASE_ROLE, a new attribute in the USERENV
co e
context.
– SQL and PL/SQL clients can retrieve the database role
programmatically using the SYS_CONTEXT function.
– It enables you to write role-specific triggers.
• Sets STANDBY_MAX_DATA_DELAY when the application a
logs on to a real-time query enabled standby database m)
real time query–enabled has
l ฺ c o
• i
Allows for configuration of a maximum data delay without
g ma deฺ
changing the application source code 9@ ui
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BELOGON
You can create an AFTER b l e trigger that sets the STANDBY_MAX_DATA_DELAY session
L I Z r a
parameter when
A fe is a physical standby database that is operating in real-time
E thendatabase
s
I
C n-tra
query mode.
I
R o
T OraclenDatabase
In 12c Release 1 (12.1), the DATABASE_ROLE attribute of the USERENV
PAcontext enables you to determine the role of the database. SQL and PL/SQL clients can
retrieve this information by using the SYS_CONTEXT function. This enables you to write
triggers that perform certain actions based on the database role.
A TR SESSION
ALTER
n on SYNC WITH PRIMARY performs a blocking wait on the standby database
P upon execution. This command causes the application to be blocked until the standby
database is in sync with the primary database as of the time this command is executed.
When the ALTER SESSION command returns control to the session, the session can continue
to process queries without having to wait for Redo Apply on the standby database.
If Redo Apply is not active or is canceled before the standby database is in sync with the
primary database, an ORA-3173 Standby may not be synced with primary error is
returned.
om
BEGIN
IF (SYS_CONTEXT('USERENV','DATABASE_ROLE') IN
l ฺ c
('PHYSICAL STANDBY'))
m ai ฺ
THEN
9 @ g
u ide
execute immediate 'alter session sync with primary';
i z 9 nt G
END IF; u
pr tude
(
END;
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
This type of trigger A
is BE when
useful b l e you are using the standby database for reporting and want
L I Z r a
to be sure that
E the reports
n s fe have the most current data. The standby-only AFTER LOGON trigger
executesIA the ALTERr a SYNC WITH PRIMARY command to force a wait for
I C - t SESSION
R non between the primary database and the standby database. A standby-only
synchronization
A T
P trigger is created and enabled on the primary database, and then becomes part of the redo
that is propagated to the standby database. However, the trigger logic is designed only to take
certain actions if the database role is set to “physical standby.”
– Executes as user U
– Reads table U.R (R) and writes to table U.W (W)
– User S has S.R synonym for U.R and S.W synonym for
U.W@primary.
• Create an AFTER LOGON trigger on the standby database:
CREATE TRIGGER adg_logon_switch_schema_trigger
AFTER LOGON ON u.schema s a
BEGIN ) ha
IF (SYS
(SYS_CONTEXT('USERENV','DATABASE_ROLE')
CONTEXT('USERENV' 'DATABASE ROLE')
l ฺ c om
IN ('PHYSICAL STANDBY'))
m ai ฺ
THEN
9 @ g
u ide
execute immediate
i z 9 nt G
'alter session set current_schema = S'; u
pr tude
END IF; (
END;
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Consider an application A BE b l e
as described in the slide. The application executes as user U, reading
L I Z r a
the U.R table
A Eand writing
n s feto the U.W table. The application connects as user U when
executing
I C I - t a
on therprimary database.
A TR S accesses
User
n on U.R with the S.R synonym and U.W with the S.W synonym.
P The AFTER LOGON trigger is created on the standby database for another user, R.
When the application executes on the standby database, it connects as the U user. The
AFTER LOGON trigger fires and transparently switches to the S schema. All reads on R
execute as reads to the U.R table on the standby database. All reads and writes to W execute
as reads and writes to U.W@primary.
– Tracks the blocks that have changed since the last backup
• Oracle Database has integrated change tracking:
– A change tracking file is used
used.
– Changed blocks are tracked as redo is generated.
– Database backup automatically uses the changed-block list.
s a
List of changed blocks
1011001010110 g
Change-
m ) ha
CTWR 0001110100101 tracking lฺco
1010101110011 file ma
i
Redo ฺ
generation 9 @ g
u ide
SGA i z 9 Redon t Glog
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A
The goal of an incremental BE backup l e
b is to back up only those data blocks that have changed
L I Z r a
since a previous
A E backup. n s feYou can use RMAN to create incremental backups of data files,
I C I
tablespaces, or the
- t r a entire database. During media recovery, RMAN examines the restored
T Rto determine
files
n o n whether it can recover them from an incremental backup. RMAN always
A
P chooses incremental backups over archived redo logs because applying changes at a block
level is faster than reapplying individual changes.
If you enable the block change tracking feature, Oracle Database tracks the physical location
of all database changes in the change tracking file. RMAN uses this change-tracking data to
determine which blocks to read during an incremental backup, creating much faster
incremental backups by eliminating the need to read the entire data filefile. The maintenance of
this file is fully automatic and does not require your intervention. The size of the change
tracking file is proportional to the following:
• Database size in bytes
• Number of enabled threads in a RAC environment
• Number of old backups maintained by the change tracking file
The minimum size for the change tracking file is 10 MB; new space is allocated in 10 MB
increments. By default, the Oracle Database server does not record block-change
information.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
ALTER DATABASE i z 9 nt G
u
pr tude
{ENABLE|DISABLE} BLOCK CHANGE TRACKING (
[USING FILE '...']
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
You enable blockZ A BEtracking
change l e
b from the database home page. Click the Policy tab on the
Backup SettingsL I r a
e do not need to set the change tracking file destination if the
fYou
A E page. n s
I C I
DB_CREATE_FILE_DEST
- t r a initialization parameter is set, because the file is created as an
T R Managed
Oracle
n o n File (OMF) file in the DB_CREATE_FILE_DEST location. You can, however,
A
P specify the name of the change tracking file and place it in any location you choose.
You can also enable or disable block change tracking by using an ALTER DATABASE SQL
command. If the change tracking file is stored in the database area with your database files, it
is deleted when you disable change tracking.
You can rename the change tracking file by using the ALTER DATABASE RENAME SQL
command Your database must be in the MOUNT state to rename the tracking file
command. file. The ALTER
DATABASE RENAME FILE command updates the control file to refer to the new location. Use
the following syntax to rename the change tracking file:
ALTER DATABASE RENAME FILE '...' TO '...';
Far Sync
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
The diagram in the A BEdisplays
slide l e
b flat projection of a world map showing North America,
a
L I Z r a
South America,
A E Europe,n s feand Africa. Somewhere in North America, an icon in the slide
I C I
represents
- t r a database system. Somewhere in Europe, an icon in the slide
the primary
R noanstandby database system. A short distance from the primary database system is
represents
T
A
P a new type of instance called a Far Sync that is introduced as a new feature with Data Guard
in Oracle Database 12c.
The redo transport uses synchronous (SYNC) transmission between the primary database
system and a Far Sync. This imposes a practical limit on the distance between the primary
database system and the Far Sync instance because it impacts the performance on the
primary database.
database The log writer (LGWR) process of the primary database system has to wait
for confirmation from the Network Server SYNC (NSS) process that the redo has been
transmitted over the network before it can proceed with the next transaction. Redo transport
from the Far Sync to the standby database system uses asynchronous communication. This
eliminates the requirement of waiting for acknowledgment from the Network Server ASYNC
(NSA) process on the Far Sync instance, creating near zero performance impact because of
network transmission even if intercontinental distances are involved.
Physical Standby
Primary (london)
(b t )
(boston)
Far Sync (bostonFS)
LOG_ARCHIVE_DEST_STATE_2='ENABLE'
s a
LOG_ARCHIVE_DEST_2='SERVICE=bostonFS SYNC AFFIRM MAX_FAILURE=1
) ha
ALTERNATE=LOG ARCHIVE DEST 3 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
ALTERNATE=LOG_ARCHIVE_DEST_3 VALID FOR=(ONLINE LOGFILES,PRIMARY ROLE)
l ฺ c om
ai ฺ
DB_UNIQUE_NAME=bostonFS'
m
LOG_ARCHIVE_DEST_STATE_3='ALTERNATE'
9 @ g
u ide
i z 9 nt G
LOG_ARCHIVE_DEST_3='SERVICE=london ASYNC ALTERNATE=LOG_ARCHIVE_DEST_2 u
pr tude
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=london' (
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
A BE blewith
In the event that communication the Far Sync instance is lost, you can optionally
L I Z r a
A n s fe to automatically become the alternate destination. This will
configure theEterminal standby
I C I
reduce the amount
- t r a of data loss by allowing Oracle Data Guard to ship redo asynchronously
A TR from
directly
n onthe primary to the terminal standby, temporarily bypassing the Far Sync instance.
P This enables Oracle Data Guard to continue sending redo, asynchronously, to the terminal
standby london when it can no longer send the redo directly to the Far Sync instance
bostonFS. When the Far Sync instance becomes available again, Oracle Data Guard
automatically resynchronizes the Far Sync instance bostonFS and returns to the original
configuration in which the primary sends redo to the Far Sync instance and the Far Sync
instance forwards that redo to the terminal standby.
standby When the synchronization is complete
complete,
the alternate destination (LOG_ARCHIVE_DEST_3 in the example) will again become dormant
as the alternate.
• Copy th
C the parameter
t file
fil (PFILE) and
d password d file
fil used dbby
the primary database. (Several initialization parameters
must also be modified for the Far Sync instance.)
• Copy the control file to the Far Sync system. a
• Create standby redo log files as you would for any ) has
standby. om
a ilฺc
• Start the Far Sync instance and mount the control
@ gmfileidbyeฺ
using standard syntax. i z 99 nt Gu
• The DATABASE_ROLE column in V$DATABASE
( pru tude will contain
N S
the value FAR SYNC. RO this
B AR use
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
You start creatingZ aA BE
Far Syncbby l eissuing a command on the primary database to create a new
L
Far Sync instance
I r a
fe file. The primary database must be mounted or open to issue the
A E controln s
command.
I C I - t r a
The syntax for creating a Far Sync instance control file is:
A TR ALTER
SQL>
n on DATABASE CREATE FAR SYNC INSTANCE CONTROLFILE AS
P '/PATH/FILENAME';
Next, copy the resulting control file, along with a copy of the primary database parameter file
and the password file, to the machine that will host the Far Sync instance. It is assumed that
the database software has already been installed on the machine that will host the Far Sync
instance and a database listener has been configured. If the primary database uses a server
parameter file (SPFILE)
(SPFILE), create a parameter file (PFILE) before copying the file
file. The following
list of initialization parameters may need changing for the Far Sync instance:
DB_UNIQUE_NAME; CONTROL_FILES, FAL_SERVER, LOG_ARCHIVE_CONFIG, and
LOG_ARCHIVE_DEST_n.
On both the primary and Far Sync systems, use Oracle Net Manager to create a network
service name for the primary and standby databases that will be used by redo transport
services. This name will be supplied
pp in the LOG_ARCHIVE_DEST_n p parameter. Use standard
syntax to start and mount the Far Sync. After you mount the Far Sync, the DATABASE_ROLE
column in the view V$DATABASE shows ‘FAR SYNC’.
Standby
Far Sync
Primary ASYNC
St db
Standby
Standby
s a
) ha
ASYNC
l ฺ c om
i
aStandby
@ g m
i d eฺ
i z 99 nt Gu
( pru tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
Up to this point inZ A
this Blesson, bthe discussion of a redo transport mechanism from a primary
database to E L I
a Far Syncfe r a
has used synchronous transmission. It is possible to also use
I A
asynchronous redo a n s
transport in a maximum performance Data Guard configuration.
I C - t r
A TR
In maximum
n onperformance mode, the primary database services the Far Sync destination by
P using ASYNC redo transport, regardless of the physical distance between the primary and the
Far Sync. High network latencies do not affect transaction throughput when a destination is
serviced with ASYNC transport.
In maximum performance mode, a Far Sync can benefit Data Guard configurations that
manage more than one remote destination. Each destination that a primary directly services
t k computing
takes ti resources away from
f applications
li ti running
i on th
the primary.
i Wh
When a F Far SSync
is used, the primary only has to service the Far Sync, which then services the rest of the
configuration. The performance benefit increases as the number of destinations increases.
The slide shows a world map with a primary database in North America using ASYNC redo
transport to a Far Sync located in Europe. The Far Sync is then used to cascade the primary
redo to multiple standby sites located throughout Europe and Africa. Upto 30 terminal
destinations are supported.
Real-Time Cascade
time cascade.
• Less performance overhead
– The primary database ships to a single destination
destination.
• Less network volume at the primary database
SYNC ASYNC
s a
) ha m
l ฺ c o
Primary Local Standby ai ฺ
Remote Standby
m
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
With real-time cascade A Bintroduced
b in Oracle Database 12c, the terminal destination has
L I Z
minimal redoEtransport flag r a
e for the primary database. Therefore, the local standby can be used
I
to cascade A the redo a n s
to the remote standby. This reduces the volume of redo sent from the
I C - t r
A TR by
primary
n n which results in less performance impact on the primary database.
ohalf,
P
Quiz
system level.
a. True
b False
b.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
Practice 5: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
C
Creating
ti and
d Managing
M i a Snapshot
S h t Standby
St db
Database
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
database
LGWR NSSn RFS
Transactions
Oracle net
Online
redo Standby
logs redo logs
s a
) ha
ARC0 l ฺ c om
m ai ฺ
ARC0
9 @ g
u ide
i z 9 nt G
u
pr tArchived de redo
( u
Archived redo
logs R ON his S logs
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BEdatabase
After a physical standby l e
b is converted to a snapshot standby database, Redo Apply
L I Z r a
no longer applies
transportIA
E (SYNC
methodra n sfeor data.
the redo The redo data continues to be received using the defined
ASYNC), but it is not applied until the snapshot standby database is
RIC noback
converted
T n-tto a physical standby database.
PA
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A
Keep the followingZin BE when
mind b l eactivating a snapshot standby database:
L I r a
fe when a log file is corrupted: The snapshot standby database
• Potential
A E datanloss
s
IC I
accepts redo
- tralog
edo og files
es but does not ot app
applyy tthem.
e If tthere e e is s a cocorrupted
upted redo
edo log
og file
e at tthe
e
R n
no standby
T snapshot database, it is not discovered until the database is converted back to
PA a physical standby database and the managed recovery process (MRP) is started. If the
primary database is unavailable at that time, there is no way to retrieve that log. Also,
the loss or corruption of a flashback log file might prevent conversion back to a physical
standby database.
• Lengthy conversion of the snapshot standby database to a primary database: In
the event of a failure of the primary database,
database the snapshot standby database can be
converted back to a physical standby database. The redo that has been received can
then be applied, and the database can be converted to a primary database. If the
snapshot standby database lags far behind the primary database, it may take a long
time to apply the redo that has been received and convert it to the primary database.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
When you convertZthe A Bphysicalb standby database to a snapshot standby database, it cannot
L I r a
be the only standby
I
protectionA E ndatabase
mode.ra
sfe in the configuration if your configuration is in maximum
In addition, you cannot make changes to the configuration after converting
to R IC nstandby
a snapshot -t database that would create this situation. Protection modes will be
A T n o
P discussed later in the course.
You cannot perform a switchover to a snapshot standby database.
A snapshot standby database cannot be configured as a fast-start failover target.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E oflethe l
The DATABASE_ROLE A Bcolumn b V$DATABASE view indicates that the database is a
L I Z r a
snapshot standby
A n s fe
E database.
I
IC n-tra
T R no
PA
Quiz
standby database.
a. True
b False
b.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Practice 6: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
C
Creating
ti a Logical
L i l Standby
St db Database
D t b
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Benefits of Implementing a
Logical Standby Database
• Provides an efficient use of system resources:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
no utilization
T• Efficient
PA independent,
of system resources: A logical standby database is an open,
and active production database. It can include data that is not part of the
primary database, and users can perform data manipulation operations on tables in
schemas that are not updated from the primary database. It remains open while the
tables are updated from the primary database, and those tables are simultaneously
available for read access. Because the data can be presented with a different physical
layout, additional indexes and materialized views can be created to improve your
reporting and query requirements and to suit your specific business requirements.
Note: Oracle Database 12c offers the Active Data Guard option. Active Data Guard
includes the real-time query feature, which enables you to open a physical standby
database in read-only mode while Redo Apply is active. However, you cannot add
additional structures to the physical standby database as you can with a logical standby
database.
• Reduction in primary database workload: The logical standby tables that are updated
from the primary database can be used for other tasks (such as reporting, summations,
and queries), thereby reducing the primary database workload.
Benefits of Implementing a
Logical Standby Database
• Provides data protection:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
database database
SQL
Redo transport Apply
Transform redo
information into s a
SQL ) ha
l ฺ c om
m ai ฺ
9 @ u ide
g Reports
i z 9 nt G
u
pr Logical destandby
Primary ( t u
database
R ON his Sdatabase
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
In a logical standby A BE bconfiguration,
database l e Data Guard SQL Apply uses redo information
L I Z r a
shipped fromEthe primary
A n s fesystem. However, instead of using media recovery to apply changes
I C I
(as in the physical
- t r astandby database configuration), archived redo log information is
R noninto equivalent SQL statements by using LogMiner technology. These SQL
transformed
T
A
P statements are then applied to the logical standby database. The logical standby database is
open in read/write mode and is available for reporting capabilities.
LCR
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Redo Shared
records pool
Redo data from Logical change records not
primary database Log Mining grouped into transactions Transaction
groups
Apply processing
s a
) ha
Applier Coordinator Analyzer
l ฺ c om
m ai ฺ
Transactions to
be applied
Transactions
9
sorted@ in
g
u ide
i z 9 nt G
Data files
pr tuu dependency
de
( order
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A
SQL Apply uses aZcollection e l execution servers and background processes that
BE ofblparallel
apply changesE Lfrom ra database to the logical standby database as follows:
I thefeprimary
• ICTheIeAreader
eadetrpa ns reads
process
ocess eads redoedo records
eco ds fromo tthe ea archived
c ed redo edo logog files.
es
R o n
T• Thenpreparer-
processes convert the block changes into table changes or logical change
PA records (LCRs). At this point, the LCRs do not represent any specific transactions.
• The builder process assembles completed transactions from the individual LCRs.
• The analyzer process examines the records, possibly eliminating transactions and
identifying dependencies between the different transactions.
• The coordinator p
process ((LSP):
)
- Assigns transactions
- Monitors dependencies between transactions and coordinates scheduling
- Authorizes the commitment of changes to the logical standby database
• The applier process:
- Applies the LCRs to the database
- Asks the coordinator process to approve transactions with unresolved
dependencies, scheduled appropriately so that the dependencies are resolved.
- Commits the transactions
Preparing to Create a
Logical Standby Database
Perform the following steps on the primary database before
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
Unsupported Objects
maintained.
• Log apply services automatically exclude unsupported
objects
j when applying
pp y g redo data to the logical
g standby
y
database.
• Unsupported objects:
– Tables and sequences in the SYS schema
a
– Tables used to support materialized views
) has
– Global temporary tables o m
a
– Tables with unsupported data types (listed in the next lฺc
islide)
m ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A
If the primary database Bcontains
b unsupported tables, log apply services automatically exclude
L I Z r a
these tablesE
A n s fe redo data to the logical standby database.
when applying
I
IC n-tra
T R no
PA
OWNER TABLE_NAME
------------------------------ ------------------------------
IX AQ$_STREAMS_QUEUE_TABLE_G
IX AQ$_STREAMS_QUEUE_TABLE_H
…
s a
OE CATEGORIES_TAB
) ha
OE CUSTOMERS
l ฺ c om
OE PURCHASEORDER
m ai ฺ
g ide
PM PRINT_MEDIA
SH DIMENSION_EXCEPTIONS 9 @
9 nt G u
u i z
20 rows selected. ( pr tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
You can query DBA_LOGSTDBY_UNSUPPORTED_TABLE to determine which tables in the
L I Z r a
primary database
A E are n s fesupported by log apply services.
not
Note: I traowned by the schemas identified in the previous slide will not show up in
ICUser tables
-
R n
T query.oThis query will return different results if run against the container or pluggable
this
PAdatabasenin a multitenant architecture.
• DBMS_JAVA
• DBMS_REGISTRY
• DBMS_ALERT
DBMS ALERT
• DBMS_SPACE_ADMIN
• DBMS_REFRESH
• DBMS_REDEFINITION a
s
• DBMS_AQ ) ha
l ฺ c om
Packages supported only in the context of a rolling upgrade:
m ai ฺ
9 @ g
u ide
SQL> SELECT OWNER, PKG_NAME FROM DBA_LOGSTDBY_PLSQL_SUPPORT
i z 9 nt G
WHERE SUPPORT_LEVEL = 'DBMS_ROLLING'; u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
Oracle PL/SQL-supplied A BEpackages l e
b that do not modify system metadata or user data leave no
L I Z r a
footprint in the
A E archivedn s feredo log files, and therefore are safe to use on the primary database.
Examples
I C I of such
- t r apackages are DBMS_OUTPUT, DBMS_RANDOM, DBMS_PIPE,
contains enough column information to maintain the table in the logical standby database.
However, the redo transport services and log apply services run more efficiently if you add a
primary key. You should consider adding a disabled RELY constraint to these tables (as
described in the next slide)
slide).
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
rows:
SQL> ALTER TABLE hr.employees
2 ADD PRIMARY KEY ((employee_id,
l id llast_name)
t )
3 RELY DISABLE;
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
If your applicationZ A BE thatblthe
ensures e lrows in a table are unique, you can create a disabled
primary key E LI constraint
RELY f e raon the table without incurring the overhead of maintaining a
C A on tthe
primary Ikey r a ns database.
primary
I constraint
RRELY n-
T
The
n o tells the system to log the named columns (in this example,
PAEMPLOYEE_ID and LAST_NAME) to identify rows in this table. Be careful to select columns for
the disabled RELY constraint that uniquely identify the row. If the columns selected for the
RELY constraint do not uniquely identify the row, SQL Apply does not apply redo information
to the logical standby database.
To improve the performance of SQL Apply, add a unique constraint/index to the columns to
id tif th
identify the row on th
the llogical
i l standby
t db d database.
t b F
Failure
il tto d
do so results
lt iin ffullll ttable
bl scans
during UPDATE or DELETE statements carried out on the table by SQL Apply.
Note: For this example, assume that the HR.EMPLOYEES table does not have a primary key.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
You create a logical A BE bdatabase
standby l e by first creating a physical standby database. Then
L I Z r a
you convert E
A
the physical
n s festandby database into a logical standby database.
I tra standby database:
IC thenphysical
To create -
T R no a physical standby database as described in the lesson titled “Creating a
PA a. Create
Physical Standby Database by Using SQL and RMAN Commands.”
b. Ensure that the physical standby database is current with the primary database by
allowing recovery to continue until the physical standby database is consistent with the
primary database, including all database structural changes (such as adding or dropping
data files).
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
SQL Apply requires A
a BLogMinerb dictionary in the redo data so that it can properly interpret
L I Z r a
changes in the
A E redo.nWhens fe you execute the DBMS_LOGSTDBY.BUILD procedure, the
LogMiner
I C I dictionary
- t r a is built and supplemental logging is automatically enabled for logging
T R key
primary
n o nand unique key columns. Supplemental logging ensures that each update
A
P contains enough information to logically identify the affected row.
Note: The DBMS_LOGSTDBY.BUILD procedure waits for all existing transactions to complete
so that long-running transactions executing on the primary database will affect its operation.
A E ALTER
a. Issue the
n s f
DATABASE RECOVER TO LOGICAL STANDBY db_name command to
IC I
continue
co t ue app
- t ray g redo
applying edo data to tthe ep physical
ys ca sta standby dby database u until
t itt is
s ready
eady to co
convert
et
R n
o standby database. Specify a database name (db_name) to identify the new
T to anlogical
PA logical standby database.
The redo log files contain the information needed to convert your physical standby
database to a logical standby database. The statement applies redo data until the
LogMiner dictionary is found in the redo log files.
b. Shut down the logical standby database instance and restart it in MOUNT mode.
c. Modify
M dif th
the LOG_ARCHIVE_DEST_n
LOG ARCHIVE DEST parameters t to
t specify
if separate
t local
l l destinations
d ti ti
for:
- Archived redo log files that store redo data generated by the logical standby
database
- Archived redo log files that store redo data received from the primary database
RESETLOGS option:
SQL> ALTER DATABASE OPEN RESETLOGS;
s a
) ha
l ฺ c om
m ai ฺ
Select “Create a new logical
standby database.” 9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BE database
To create a logicalZstandby b l e by using Enterprise Manager:
L I r a
feDatabase on the Data Guard overview page to invoke the Add
1. Click Add
A E Standbyn s
IC
StaI
Standby ra Wizard.
dby Database
- tatabase ad
R
T Note: n
noIf the logical standby database is the first database to be created in your
PA configuration, access the Add Standby Database Wizard by clicking “Setup and
Manage” in the Data Guard section on the Availability page. Next, click the Add Standby
Database link to invoke the Add Standby Database Wizard.
2. Select “Create a new logical standby database” on the Add Standby Database page,
and click Continue.
3. The wizard guides you through a procedure that is similar to adding a physical standby
database.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
On the Add Standby A BE bleBackup
Database: Type page, you determine whether you have tables
L I Z e r a
A E arennotsfsupported
or columns that by SQL Apply. In the SQL Apply Unsupported Tables
section, Iselect r a
“Table Columns and Data Types” in the drop-down list and click Go to see the
I C - t
A TR nontables.
unsupported
P
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
BE bleConfiguration
On the Add StandbyADatabase: page, specify the values for the DB_NAME and
L I Z r a
DB_UNIQUE_NAME
A s fe
E nparameters for your logical standby database. In addition, specify the
I C I
target name to be
- t r a
used by Enterprise Manager Cloud Control.
A TR
In on Database Monitoring Credentials section, you can choose between a non-
the Standby
n
P SYSDBA user such as DBSNMP to monitor the database or choose to use the SYSDBA
monitoring credentials.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
After completing all A BE in bthelewizard,
pages you see the Add Standby Database Review page.
L I Z r a
e this page and click Finish to submit a job to create your logical
E nsfon
Review the information
A
standby Idatabase.
R IC n-tra
PA
T no
tables.
• ALTER DATABASE GUARD command keywords:
– ALL: Prevents users from making changes to any data in the
database
– STANDBY: Prevents users from making changes to any data
maintained by Data Guard SQL Apply
– NONE: Normal security s a
• Q y the GUARD_STATUS column in V$DATABASE.
Query $ ) ha
l ฺ c om
• The database guard level is automatically set to ALL
m aiby ฺ
the broker on the logical standby database. 9@g uide
• The database guard level applies to allruusers nt G SYS.
iz9 eexcept
N (p Stud
R RO this
B A use
Z
I and/or
UOracle
Copyright © 2014, titsoaffiliates. All rights reserved.
R s e
T H icen
BE buser l e l
The database guard
I Z Acontrols
r a access to tables in a logical standby database. Use the
L
E GUARD
ALTER DATABASE
s fe command to configure the database guard.
I A
C itnis-not
By default,
n
trapossible for a nonprivileged user to modify data on a Data Guard SQL
R I
T database,
Apply o because the database guard is automatically set to ALL. With this level of
PAsecurity,nonly the SYS user can modify data.
When you set the security level to STANDBY, users are able to modify data that is not
maintained by the logical apply engine. A security level of NONE permits any users to access
the standby database if they have the appropriate privileges.
When creating a logical standby database manually with SQL commands, you must issue the
ALTER DATABASE GUARD ALL command before opening the database. Failure to do so
allows jobs that are submitted through DBMS_JOB.SUBMIT to be scheduled and to potentially
modify tables in the logical standby database.
Note: Be careful not to let the primary and logical standby databases diverge while the
database guard is disabled.
settings:
SQL> SELECT error, statement_opt, name
2 FROM dba_logstdby_skip
dba logstdby skip
3 WHERE owner='HR';
ERROR STATEMENT_OPT NAME
---------- -------------------- ----------
N DML JOBS
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
You can query the DBA_LOGSTDBY_SKIP view on the logical standby database to determine
L I Z e r a
the SQL Apply
A E filtering
n s fsettings. The view contains the following columns:
• C I
Ithe - tra whether the statement should be skipped
ERROR: Indicates pp or should return an error for
T R o n
nstatement
PA • STATEMENT_OPT: Specifies the type of statement that should be skipped (It must be
one of the SYSTEM_AUDIT statement options.)
• OWNER: Name of the schema under which the skip option is used
• NAME: Name of the table that is being skipped
• USE_LIKE: Indicates whether the statement uses a SQL wildcard search when
matching names
• ESC: Escape character to be used when performing wildcard matches
• PROC: Name of a stored procedure that is executed when processing the skip option
You can query DBA_LOGSTDBY_SKIP_TRANSACTION to view settings for transactions to be
skipped.
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: a
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Practice 7: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
O
Oracle
l Data
D t Guard
G d Broker:
B k Overview
O i
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
management framework.
• The broker automates and centralizes the creation,
maintenance,, and monitoringg of Data Guard
configurations.
• With the broker, you can perform all management
operations locally or remotely with easy-to-use interfaces:
– Oracle Enterprise Manager Cloud Control s a
– DGMGRL (a command-line
command line interface) ) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T
The following are Z A
some el
BofE theboperations
l that the broker automates and simplifies:
L I r a
feof Data Guard configurations incorporating a primary database, a
• Automated
A E creation
n s
IC I
e o
new or e
- tstrag sta
existing standby
dby database, redo edo transport
t a spo t services,
se ces, a andd log
og app
apply
y se
services
ces
R
T Note: n
noAny of the databases in the configuration can be a Real Application Clusters
PA (RAC) database.
• Adding new or existing standby databases to each existing Data Guard configuration,
for a total of one primary database and from one to 30 standby databases in the same
configuration
• Managing an entire Data Guard configuration (including all databases, redo transport
services, and log apply services) through a client connection to any database in the
configuration
• Invoking switchover or failover with a single command to initiate and control complex
role changes across all databases in the configuration
• Monitoring the status of the entire configuration, capturing diagnostic information,
reporting statistics (such as the log apply rate and the redo generation rate), and
detecting problems quickly with centralized monitoring
monitoring, testing,
testing and performance tools
• Client-side:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BE l e
L IZ ferab
The Oracle Data Guard broker consists of both client-side and server-side components.
On the client,Eyou cansuse the following Data Guard components to define and manage a
C IA -tran
configuration:
I
A T•R Oracle
n onEnterprise Manager Cloud Control
P • DGMGRL, which is the Data Guard command-line interface (CLI)
On the server, the Data Guard monitor is a broker component that is integrated with the
Oracle database. The Data Guard monitor comprises the Data Guard monitor (DMON) process
and broker configuration files, with which you can control the databases of that configuration,
modifyy their behavior at run time,, monitor the overall health of the configuration,
g , and provide
p
notification of other operational characteristics.
The configuration file contains profiles that describe the current state and properties of each
database in the configuration. Associated with each database are various properties that the
DMON process uses to control the database’s behavior. The properties are recorded in the
configuration file as a part of the database’s object profile that is stored there. Many database
properties are used to control database initialization parameters related to the Data Guard
environment.
environment
O
Oracle Net
Boston Boston London
Far Sync
ASYNC
s a
Oracle Net m ) ha
Primary London Standby
i l ฺ co
Far Sync a
Site gmSite eฺ @ Guid
ASYNC 9 9
r u iz ent
N (p Stud
R RO this
B A use
Z
I and/or
UOracle
Copyright © 2014, titsoaffiliates. All rights reserved.
R s e
T H icen
BE consists l e l
I Z A
A Data Guard configuration
r a b of one primary database and up to 30 standby databases
or Far Sync E L
locations. The
s fe databases in a Data Guard configuration are typically dispersed
C I A
geographically and
t r n
a connected by Oracle Net.
are
I -
AATR on broker configuration is a logical grouping of the primary, Far Sync, and standby
Data Guard
n
P databases in a Data Guard configuration. The broker’s DMON process configures and
maintains the broker configuration components as a unified group of resource objects that you
can manage and monitor as a single unit.
Standby database
Broker-controlled Standby database
d t b
databases St db d
Standby database
t b
Standby database
Standby database
Standby database
Standby database
Standby database a
Primary database s
) ha
Standby database
Instances l ฺ c om
Instances
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A Bperforms
L I Z erab operations on the following logical objects:
The Data Guard broker
• Configuration
A f
E nofsdatabases
• IC
I -tr a
T R Singleo
database
n
PAA brokernconfiguration consists of:
• Configuration object: A named collection of database profiles. A database profile is a
description of a database object, including its current state, current status, and
properties.
• Database objects: Objects corresponding to primary or standby databases
• Instance objects: A database object may comprise one or more instance objects if it is
a RAC database.
The broker supports one or more Data Guard configurations, each of which includes a profile
for one primary database as well as profiles for up to 30 physical, logical, RAC or non-RAC
standby databases. Far Sync destinations are also counted towards the limit of 30 locations.
command-line interface
A TR health,
activity,
n on and availability of all systems in that configuration.
P The Data Guard monitor process (DMON) is an Oracle background process that runs on every
instance that is managed by the broker, including Far Sync instances. When you start the
Data Guard broker, a DMON process is created.
When you use Enterprise Manager or the Data Guard command-line interface (CLI), the DMON
process is the server-side component that interacts with the local instance and the DMON
processes that are running on other sites to perform the requested function
function. The DMON
process is also responsible for monitoring the health of the broker configuration and for
ensuring that every instance has a consistent copy of the configuration files in which the DMON
process stores its configuration data. There are two multiplexed versions of the configuration
file on each database.
Configuration and Configure and manage from Set up services manually for
management single interface each database
s a
) ha
Monitoring • Monitor continuously Monitor each database
• Unified status and reports individually through views
l ฺ c om
• Integrate with EM events
m ai ฺ
@ g ofide
Control Invoke role transitions with Coordinate9 sequences
9 nt G u
a single command multiple i zcommands across
( pru tusites
database defor role
R ON transitions
h i s S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
The table in the slide A BE ban
provides l e overview of configuration management with and without the
L I Z r a
Data Guard E
A n s fe Table 1-1, “Configuration Management With and Without the
broker (source:
Broker,”Iin Oracle r a Guard Broker).
Data
I C - t
A TR non
P
• LOG_ARCHIVE_DEST_n • PRESERVE_COMMIT_ORDER
• LOG_ARCHIVE_DEST_STATE_n • RECORD_APPLIES_DDL
• ARCHIVE_LAG_TARGET • RECORD_SKIP_DDL
• DB_FILE_NAME_CONVERT • RECORD_SKIP_ERRORS
• LOG_ARCHIVE_FORMAT
• LOG_ARCHIVE_MAX_PROCESSES
• LOG_ARCHIVE_MIN_SUCCEED_DEST
s a
) ha
• LOG_ARCHIVE_TRACE
• LOG FILE NAME CONVERT
LOG_FILE_NAME_CONVERT
l ฺ c om
• STANDBY_FILE_MANAGEMENT
m ai ฺ
• MAX_EVENTS_RECORDED 9 @ g
u ide
• i z 9 nt G
MAX_SERVERS u
pr tude
• (
ON his S
MAX_SGA
R
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The Data Guard broker A Bdirectly
b controls the database initialization parameters listed in the
L I Z r a
slide. After defining
A E na sData fe Guard broker configuration, you should use DGMGRL or
I C I
Enterprise Manager
- t r a Cloud Control to manage your configuration. You should not use SQL
A TR notonmanage the databases, because you could cause a conflict with the broker.
commands
P The broker also uses configurable property settings to manage how redo apply and SQL
apply are started. Therefore, the following SQL statements are managed automatically by the
broker:
• ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
• ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE
Connected.
DGMGRL> show configuration
Configuration - DRSolution
Protection Mode: MaxPerformance
Databases:
boston - Primary database
bostonFS - Far Sync
london - Physical standby database a
s
) ha
london2 - Logical standby database
londonFS - Far Sync (inactive)
l ฺ c om
m ai ฺ
Fast-Start Failover: DISABLED
9 @ g
u ide
i z 9 nt G
Configuration Status: u
pr tude
(
ON his S
SUCCESS
R
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
DGMGRL Commands A BE ble l
LIZ sfeare
The followingEcommands
ra available in DGMGRL (the Data Guard CLI). Many of these
C
commands
I IA have
- t r an
additional arguments that are not described here. See Oracle Data Guard
T R fornodetailed
Broker n information.
PA • ADD DATABASE: Adds a new standby database to the existing broker configuration
• ADD FAR_SYNC: Adds an existing Far Sync instance to an Oracle Data Guard broker
configuration
• CONNECT: Connects to the specified database using the specified username
• CONVERT DATABASE:
CO S CoConvertse ts tthe
e spec
specified
ed database to e
either
t e a ssnapshot
aps ot sta
standby
dby
database or a physical standby database
• CREATE CONFIGURATION: Creates a broker configuration and adds a primary
database to that configuration
• DISABLE CONFIGURATION: Disables broker management of a configuration so that
the configuration and all of its databases are no longer managed by the broker
• DISABLE DATABASE: Disables broker management of the named standby database
• B AR use t
EDIT INSTANCE (Property): Changes the value of a property for the specified instance
• U IZ e to
EDIT INSTANCE RESET (Property): Resets an instance-specific property for the
H R icens
specified instance(s) to its default value
T
• A BE ble l
ENABLE CONFIGURATION: Enables broker management of the broker configuration
LIZ sfera
and all of its databases
E
•
I C IA -tran
ENABLE DATABASE: Enables broker management of the specified database
T•R nonENABLE FAR_SYNC: Enables broker management of the specified Far Sync instance
PA • ENABLE FAST_START FAILOVER: Enables the broker to automatically fail over from
the primary database to a target standby database
• ENABLE FAST_START FAILOVER CONDITION: Allows a user to add conditions for
which a fast-start failover should be performed
• EXIT: Exits the Data Guard command-line interface
• FAILOVER: Performs a database failover operation in which the standby database to
which DGMGRL is currently connected fails over to the role of primary database
• HELP: Displays online help for the Data Guard command-line interface
• QUIT: Quits the Data Guard command-line interface
• REINSTATE DATABASE: Reinstates the database after a failover
• REMOVE CONFIGURATION: Removes the broker configurationg and ends broker
management of its members
s a
) ha
l ฺ c om
m ai ฺ
Select “Data Guard Administration”
to access the Data Guard 9 @ g
u
pages.
ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BE features l e
To access the Data
L I Z erab in Enterprise Manager Cloud Control:
Guard
I A E Targets
1. Click the
a n sftab to go to the Targets page.
T
2 IC
2.
R Click -tr to go to the Databases page
Databases
o n page, where you can see a list of all discovered
PA n
databases, including the primary database.
3. Click the primary database to go to the primary database home page.
4. Click Availability.
5. Click “Data Guard Administration” to open the Data Guard Overview page.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
On the Data Guard A BE bpage,
Overview l e you can:
L I Z era
I A a n sf mode and access the page to edit the protection mode
E protection
• View the
T
• IC
R received
o n -tr showing the amount of data that the standby database has not
View a summary
PA n
• View information about the primary database
• View or access pages to change information for the standby databases:
- Add a standby database to the broker configuration
- Change the state or properties
- Discontinue
Discontin e Data G Guard
ard broker control
- Switch the role from standby to primary
- Transition the standby database to the role of the primary database
• Access pages to view performance information for the configuration and status of online
redo log files for each standby database
• Perform a verification process on the Data Guard configuration
Quiz
Which tools are used to interface with the Data Guard Broker?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
a. DGMGRL
b. SRVCTL
c Enterprise Manager
c.
d. CRSCTL
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: a, c
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Quiz
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
C
Creating
ti a Data
D t GGuard
d Broker
B k C Configuration
fi ti
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Edutronic Global Services EฺIฺRฺL
Objectives
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
initialization parameters.
• Using the SPFILE enables the Data Guard broker to keep
its configuration
g file and the database SPFILE consistent.
• If you use the broker, use Enterprise Manager Cloud
Control or DGMGRL to update database parameter
values.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T
A
To ensure that theZbrokerBEcanbupdatel e l the values of parameters in both the database instance
LI sfile,
and the configuration f a must use the persistent server parameter file (SPFILE) to
eryou
E n initialization parameters. Use of the SPFILE gives the broker a
I C IA and
control static
- t r adynamic
R nothat
mechanism
T n enables it to reconcile property values that you have selected when using the
A
P broker with any related initialization parameter values that are recorded in the SPFILE. In
addition, the SPFILE permits persistent Data Guard settings so that Data Guard continues to
work even after the broker is disabled.
When you set definitions or values for database properties in the broker configuration, the
broker records the changes in the configuration file and also propagates the changes to the
related initialization parameters in the server parameter file in the Data Guard configuration
configuration.
When the configuration is enabled, the broker keeps the database property values in the Data
Guard configuration file consistent with the values of the database initialization parameters in
the SPFILE.
Even when the configuration is disabled, you can update database property values through
the broker. The broker retains the property settings (without validating the values) and
updates the database initialization parameters in the SPFILE and the in-memory y settings
g the
next time you enable the broker configuration.
For dynamic initialization parameters, the broker keeps the value of the database parameter
consistent in the System Global Area (SGA) for the instance, in the Data Guard configuration
files, and in the SPFILE. For static initialization parameters, the value in the SGA may differ
from what is in the configuration files and in the SPFILE. Typically, the broker reconciles the
differences by updating all parameter and property values the next time the database instance
is stopped and restarted.
Note: When using the broker (with Enterprise Manager or DGMGRL), do not attempt to
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
manually set the parameters that the broker controls. If you set them manually, either you
render your configuration inoperable or the broker simply takes the next opportunity to reset
the parameter to the recorded setting. If you want to change a parameter value, you must
change it by using one of the broker interfaces.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U IZ e to
T H R icens
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
DMON process.
• There is one file for each instance in the broker
configuration.
• Broker log files are created in the same directory as the
alert log and are named drc<$ORACLE_SID>.log.
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
A BE operational
The DMON process records b l e and status information in the broker log file for each
L I Z r a
instance in the
A fe broker configuration.
E DatanGuard
s
I
IC n-tra
T R no
PA
london;
Database "london" added
om
london - Physical
y standby
y database
l ฺ c
m ai ฺ
ide
Fast-Start Failover: DISABLED
@ g
9
9 nt G u
Configuration Status: u i z
DISABLED ( pr tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T l
Use the ADD DATABASE A BEDGMGRL l e
b command to define the standby database and create a
L I Z r a
broker configuration
A E nprofile.
s fe The database name specified must be the same as the value of
I C I
the DB_UNIQUE_NAME
- t r a initialization parameter. The connect identifier is used by Oracle Net
A TR ntooaccess
Services n the database from all other databases in the configuration.
P The AS CONNECT IDENTIFIER clause is optional. If you do not specify this clause, the
broker will search the LOG_ARCHIVE_DEST_n initialization parameters on the primary
database for an entry that corresponds to the database being added.
The broker uses the specified connect-identifier to communicate with the specified
database from other databases. Therefore, you must ensure that the connect-identifier
can be
b used d tto address
dd th
the specified
ifi d d
database
t b ffrom allll d
databases
t b iin your configuration.
fi ti F
For
example, if TNS is used as the naming method, you must ensure that the tnsnames.ora file
on every database and instance that is part of the configuration contains an entry for the
connect identifier. The connect identifier must resolve to the same connect descriptor.
Note: The broker will determine the standby type whenever you add an existing standby. In
older versions of the Oracle database, such as version 10.2, you had to specify
"MAINTAINED AS [ PHYSICAL | LOGICAL ]" when you added an existing standby.
bostonFS;
far sync instance "bostonFS" added
A TR ntooaccess
Services n the database from all other databases in the configuration.
P
Enabled.
R RO this
B A use
Z
I and/or
UOracle
Copyright © 2014, titsoaffiliates. All rights reserved.
R s e
T H icen
BE isbset l e l
A
The RedoRoutes property
IZ feone to a character string that contains one or more redo routing
ra or more redo sources and one or more redo destinations. A
rules. Each rule
E Lcontains
I
redo routing
C a ns active when one of the redo sources in the rule is in the primary
A ruletrbecomes
RIThisnresults
role.
T o n- in redo from the primary database being sent to every redo destination in
PAthat rule. A redo routing rule contains a redo source field and a redo destination field,
separated by a colon:
(redo source : redo destination)
The redo source field must contain the LOCAL keyword or a comma-separated list of
DB_UNIQUE_NAME values:
{
{LOCAL | db_unique_name_1,[,db_unique_name_n]}
i [ i ]}
You cannot set the RedoRoutes property on a logical or snapshot standby database.
DGMGRL> EDIT DATABASE Paris SET PROPERTY 'RedoRoutes' = '(Berlin : Madrid ASYNC)';
broker configuration:
• Primary database in Boston, MA.
• Far Sync in Cambridge,
Cambridge MA.
MA
• Physical standby in Chicago, IL.
• Far Sync in Shaumburg, IL. (for role reversal)
s a
) ha
DGMGRL> EDIT DATABASE Boston SET PROPERTY 'RedoRoutes' = '(LOCAL : Cambridge
SYNC)';
DGMGRL> EDIT FAR
FAR_SYNC
SYNC Cambridge SET PROPERTY 'RedoRoutes'
RedoRoutes = '(Boston
(Boston : Chicago
l ฺ c om
ai ฺ
ASYNC)';
DGMGRL> EDIT
DATABASE Chicago SET PROPERTY 'RedoRoutes' = '(Local : Shaumburg
m
SYNC)';
DGMGRL> EDIT
FAR_SYNC Shaumburg SET PROPERTY 'RedoRoutes' = '(Chicago
9 @ u ide
g : Boston
ASYNC)';
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
H icenR s
T
After Data Guard Z A BEhas bbeen
broker l e lconfigured for a primary database, Far Sync, physical
I
standby, andEaLsecond fFar
e raSync for role reversal, the configuration will appear as follows:
C I A trans
RI nSHOW
DGMGRL>
T o n- CONFIGURATION;
PAConfiguration - The SUPER cluster
Protection Mode: MaxAvailability
Databases:
Boston - Primary database
Cambridge - Far Sync
Chi
Chicago - Physical
Ph i l standby
db database
d b
Shaumburg – Far Sync (Inactive)
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
Notice that in the output of the show configuration command, indentation is used to show that
a database or Far Sync instance is receiving redo from a source location.
location The use of
RedoRoutes overrides the LogXptMode Data Guard property.
A TREDITnoDATABASE
The n SET STATE DGMGRL command is used to change the state of the
P primary database and standby databases. When the broker configuration is enabled, the
databases are in one of four states:
• TRANSPORT-ON (applicable only to the primary database): Redo transport services
transmit redo data to the standby databases when the primary database is open in
read/write mode.
• TRANSPORT-OFF (applicable
( li bl only
l tto th
the primary
i d
database):
t b ) R
Redo
d ttransportt services
i are
stopped on the primary database.
• APPLY-ON (applicable only to a physical or logical standby database): Redo Apply is
started on the physical standby database when it is mounted or in open read-only mode.
SQL Apply is started on a logical standby database when it is opened and the logical
standby database guard is on.
• APPLY OFF (applicable only to a physical or logical standby database): Redo Apply is
APPLY-OFF
stopped on a physical standby database. SQL Apply is not running on a logical standby
database.
Property Purpose
AlternateLocation Specifies an alternate disk location to store the archived redo log files in
the standby when the location specified by the
StandbyArchiveLocation configurable property fails
ApplyLagThreshold Generates a warning status for a logical or physical standby when the
member's apply lag exceeds the value specified by the property
ArchiveLagTarget Limits the amount of data that can be lost and, effectively, increases the
s a
) ha
availability of the standby database or Far Sync instance by forcing a log
switch after the amount of time you specify (in seconds) elapses
l ฺ c om
Binding Specifies whether the redo destination is MANDATORY or OPTIONAL
m ai ฺ
@ g
making uid
e
DGConnectIdentifier Specifies the connection identifier the broker uses when
z 9
9 nt G
connections to a configuration member
u i
( pr tude
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The properties that A BData
the b broker uses can be categorized into configuration
Guard
L I Z r a
properties that
A E control n s fe behavior of the broker configuration, monitorable (read-only)
the
I C I
properties
- t r a
for information, and configurable properties. The properties listed in the slide are
Property Purpose
LogArchiveFormat Specifies the format for filenames of archived redo log files using a
database ID (%d)
(%d), thread (%t)
(%t), sequence number (%s)
(%s), and
resetlogs ID (%r)
LogArchiveMaxProcesses Specifies the initial number of archiver processes (ARCn) that are
invoked
LogArchiveMinSucceedDest Controls when online redo log files are available for reuse
s a
) ha
provided archiving has succeeded to a minimum number of
destinations
l ฺ c om
LogShipping Specifies the ENABLE and DEFER values for the
LOG_ARCHIVE_DEST_STATE_n initialization parameter of the m ai ฺ
database or Far Sync instance that is sending redo data
9 @ g
u ide
i z n G
9 configuration
t
LogXptMode Specifies the redo transport services u
pr tude on each
member to SYNC, ASYNC, or FASTSYNC (
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The properties that A BData
the b broker uses can be categorized into configuration
Guard
L I Z r a
properties that
A E control n s fe behavior of the broker configuration, monitorable (read-only)
the
I C I
properties
- t r a
for information, and configurable properties. The properties listed in the slide are
Configurable Purpose
Property
MaxConnections Specifies how many ARCn processes will be used in parallel to transmit
redo data from a single archived redo log on the database or Far Sync
instance to the archived redo log at the remote site
MaxFailure Specifies the maximum number of contiguous archiving failures before the
redo transport services stop trying to transport archived redo log files to the
standby database
s a
NetTimeout Specifies
p the number of seconds the LGWR waits for Oracle Net Services to ) ha
respond to a LGWR request and is used to bypass the long connection
l ฺ c om
timeout in TCP/IP
m ai ฺ
RedoCompression Specifies whether redo data is transmitted to a standby 9 @ g
u
database or de
iFar
Sync instance in compressed or uncompressediform z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
The properties that A BData
the b broker uses can be categorized into configuration
Guard
L I Z r a
properties that
A E control n s fe behavior of the broker configuration, monitorable (read-only)
the
I C I
properties
- t r a
for information, and configurable properties. The properties listed in the slide are
StandbyArchiveLocation Specifies the location of archived redo log files arriving from
a redo source
TTnn RFS
Redo
buffer
Standby ack (Real-time
LGWR apply)
Standby
acle Net
redo logs
s a
Online ) ha
om
Ora
redo
d
ARC0 l ฺ c
logs
m ai ฺ
9 @ g
u i de
Sets the ASYNC and NOAFFIRM
i z 9 nt G
attributes of u
pr tArchived de redo
( u
ON his S logs
LOG_ARCHIVE_DEST_n
R
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
A
When you set the LogXptModeBE bleproperty to ASYNC, the broker configures redo transport
L I Z r a
services for this
A E standby n s fedatabase by using the ASYNC and NOAFFIRM attributes of the
I C I
LOG_ARCHIVE_DEST_n
- t r a initialization parameter. ASYNC mode enables a moderate level of
A TR protection
data
n on for the primary database with a lower performance impact than SYNC mode.
P Standby redo log files are required for ASYNC mode.
In the diagram in the slide, the solid line represents a synchronous operation (writing locally to
the primary database online redo log files). The broken lines represent asynchronous
operations with respect to the transaction commit on the primary database.
NSSn RFS
Redo
buffer
Standby ack (Real-time
LGWR apply)
Standby
acle Net
redo logs
s a
Online ) ha
om
Ora
redo
d
ARC0 l ฺ c
logs
m ai ฺ
9 @ g
u i de
Sets the SYNC and AFFIRM
i z 9 nt G
attributes of u
pr tArchived de redo
( u
ON his S logs
LOG_ARCHIVE_DEST_n
R
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
A BE bledatabase
When you set the LogXptMode property to SYNC, the broker configures redo
L I Z r a
transport services
A E fornsthis festandby database by using the SYNC and AFFIRM attributes of the
I C I
LOG_ARCHIVE_DEST_n
- t r a initialization parameter. This mode enables the highest level of data
A TR notonthe primary database but also incurs the highest performance overhead.
protection
P Standby redo log files are required for SYNC mode.
In the diagram in the slide, the solid line represents a synchronous operation (writing locally to
the primary database online redo log files). The broken lines represent asynchronous
operations with respect to the transaction commit on the primary database.
NSSn RFS
Redo
buffer
Standby ack (Real-time
LGWR apply)
Standby
acle Net
redo logs
s a
Online ) ha
om
Ora
redo
d
ARC0 l ฺ c
logs
m ai ฺ
9 @ g
u i de
Sets the SYNC and NOAFFIRM
i z 9 nt G
attributes of u
pr tArchived de redo
( u
ON his S logs
LOG_ARCHIVE_DEST_n
R
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T l
A
When you set the LogXptModeBE bledatabase property to FASTSYNC, the broker configures redo
L I Z r a
transport services
A E fornsthis festandby database by using the SYNC and NOAFFIRM attributes of
I C I
the LOG_ARCHIVE_DEST_n
- t r a initialization parameter. This mode is new for Oracle Database
A TR non
12c.
P Standby redo log files are required for FASTSYNC mode.
In the diagram in the slide, the solid line represents a synchronous operation (writing locally to
the primary database online redo log files). The broken lines represent asynchronous
operations with respect to the transaction commit on the primary database.
Quiz
How many Data Guard broker configuration files are created for
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2014, Oracle and/or its affiliatesฺ
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
E le l
A B
Answer: b
L IZ ferab
A E ns
I
IC n-tra
T R no
PA
Summary
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA
Practice 9: Overview
s a
) ha
l ฺ c om
m ai ฺ
9 @ g
u ide
i z 9 nt G
u
pr tude
(
R ON his S
B AR use t
U
Copyright © 2014, IZ and/or
Oracle
e titsoaffiliates. All rights reserved.
R
H icen s
T
A BE ble l
E LIZ sfera
I C IA -tran
TR non
PA