Thursday, July 4, 2013

Basics of Data Guard

Standby Database
A standby database is a transactionally consistent copy of an Oracle production database that is initially created from a backup copy of the primary database.

There are two types of Standby database
Physical Standby and
Logical Standby.

Physical Standby Database
A physical standby database is physically identical to the primary database, with on disk database structures that are identical to the primary database on a block-for-block basis. The database schema, including indexes, are identical. Data Guard maintains a physical standby database by performing Redo Apply.
Redo Apply-The physical standby database is maintained by applying redo data from the archived redo log files or directly from standby redo log files on the standby system using the Oracle recovery mechanism.
Open read-only
A physical standby database can be open in read-only mode so that you can execute queries on the database. While opened in read-only mode, the standby database can continue to receive redo data, but application of the redo data from the log files is deferred until the database resumes Redo Apply.
Open read/write
A physical standby database can also be opened for read/write access for purposes such as creating a clone database or for read/write reporting. While opened in read/write mode, the standby database does not receive redo data from the primary database and cannot provide disaster protection.

Benefits of Physical Standby Database
# Disaster recovery and high availability- A physical standby database enables a robust and efficient disaster recovery and high availability solution. Easy-to-manage switchover and failover capabilities.
# Data protection- Using a physical standby database, Data Guard can ensure no data loss, even in
the face of unforeseen disasters.
# Reduction in primary database workload-Oracle Recovery Manager (RMAN) can use physical standby databases to off-load backups from the primary database saving valuable CPU and I/O cycles.
# Performance- The Redo Apply technology used by the physical standby database applies changes using low-level recovery mechanisms, which bypass all SQL level code layers; therefore, it is the most efficient mechanism for applying high volumes of redo data.

Logical Standby Databases
A logical standby database is initially created as an identical copy of the primary database, but it later can be altered to have a different structure. The logical standby database is updated by executing SQL statements. This allows users to access the standby database for queries and reporting at any time.

Benefits of a Logical Standby Database
# Efficient use of standby hardware resources
# Reduction in primary database workload

Data Guard Operational Prerequisites
Hardware and Operating System Requirements
# All members of a Data Guard configuration must run an Oracle image that is built for the same platform.
#The hardware (for example, the number of CPUs, memory size, storage configuration) can be different between the primary and standby systems.
# The operating system running on the primary and standby locations must be the same, but the operating system release does not need to be the same. In addition, the standby database can use a different directory structure from the primary database.

Oracle Software Requirements
# Oracle Data Guard is available only as a feature of Oracle Database Enterprise Edition. It is not available with Oracle Database Standard Edition. This means the same release of Oracle Database Enterprise Edition must be installed on the primary database and all standby databases in a Data Guard configuration.
# The COMPATIBLE initialization parameter must be set to the same value on all
databases in a Data Guard configuration.
# The primary database must run in ARCHIVELOG mode
# The primary database can be a single instance database or a multi-instance Real Application Clusters database. The standby databases can be single instance databases or multi-instance Real Application Clusters (RAC) databases, and these standby databases can be a mix of both physical and logical types.
# Each primary database and standby database must have its own control file.
# If a standby database is located on the same system as the primary database, the archival directories for the standby database must use a different directory structure than the primary database.
# To protect against unlogged direct writes in the primary database that cannot be propagated to the standby database, turn on FORCE LOGGING at the primary database before performing datafile backups for standby creation. Keep the database in FORCE LOGGING mode as long as the standby database is required.
# The user accounts you use to manage the primary and standby database instances must have SYSDBA system privileges.
# Oracle recommends that when you set up Oracle Automatic Storage Management (ASM) and Oracle Managed Files (OMF) in a Data Guard configuration, set it up symmetrically on the primary and standby database.


No comments:

Post a Comment