0% found this document useful (0 votes)
38 views

Dataguard 1

The document discusses Oracle Data Guard including the types of Oracle Data Guard, advantages, services, protection modes, how to check the protection mode, steps to create a physical standby database, how to change the protection mode, advantages of physical standby databases, what physical and logical standby databases are, advantages of logical standby databases, and parameters used in an Oracle Data Guard setup.

Uploaded by

Shankar Pujari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Dataguard 1

The document discusses Oracle Data Guard including the types of Oracle Data Guard, advantages, services, protection modes, how to check the protection mode, steps to create a physical standby database, how to change the protection mode, advantages of physical standby databases, what physical and logical standby databases are, advantages of logical standby databases, and parameters used in an Oracle Data Guard setup.

Uploaded by

Shankar Pujari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

What are the types of Oracle Data Guard?

Oracle Data Guard classified in to two types based on way of creation and method used for Redo Apply.
They are as follows.
Physical standby (Redo Apply technology)
Logical standby (SQL Apply Technology)

What are the advantages in using Oracle Data Guard?

Following are the different benefits in using Oracle Data Guard feature in your environment.
High Availability.
Data Protection.
Off loading Backup operation to standby database.
Automatic Gap detection and Resolution in standby database.
Automatic Role Transition using Data Guard Broker.
What are the different services available in Oracle Data Guard?
Following are the different Services available in Oracle Data Guard of Oracle database.
Redo Transport Services.
Log Apply Services.
Role Transitions.

What are the different Protection modes available in Oracle Data Guard?

Following are the different protection modes available in Data Guard of Oracle database you can use any
one based on your application requirement.
Maximum Protection
Maximum Availability
Maximum Performance
How to check what protection mode of primary database in your Oracle Data Guard?
By using following query you can check protection mode of primary database in your Oracle Data Guard
setup.
SELECT PROTECTION_MODE FROM V$DATABASE;
For Example:
SQL> select protection_mode from v$database;
PROTECTION_MODE
——————————–
MAXIMUM PERFORMANCE

Steps to create Physical Standby database?

1.Take a full hot backup of Primary database


2.Create standby control file
3.Transfer full backup, init.ora, standby control file to standby node.
4.Modify init.ora file on standby node.
5.Restore database
6.Recover Standby database
(Alternatively, RMAN DUPLICATE DATABASE FOR STANDBY DO RECOVERY can be also used)
7.Setup FAL_CLIENT and FAL_SERVER parameters on both sides
8.Put Standby database in Managed Recover mode

How to change protection mode in Oracle Data Guard setup?

By using following query your can change the protection mode in your primary database after setting up
required value in corresponding LOG_ARCHIVE_DEST_n parameter in primary database for
corresponding standby database.

1
ALTER DATABASE SET STANDBY DATABASE TO MAXIMUM
[PROTECTION|PERFORMANCE|AVAILABILITY];
Example:
alter database set standby database to MAXIMUM PROTECTION;

What are the advantages of using Physical standby database in Oracle Data Guard?

Advantages of using Physical standby database in Oracle Data Guard are as follows.
High Availability.
Load balancing (Backup and Reporting).
Data Protection.
Disaster Recovery.

What is physical standby database in Oracle Data Guard?

Oracle Standby database are divided into physical standby database or logical standby database based
on standby database creation and redo log apply method. Physical standby database are created as
exact copy i.e block by block copy of primary database. In physical standby database transactions
happen in primary database are synchronized in standby database by using Redo Apply method by
continuously applying redo data on standby database received from primary database. Physical standby
database can offload the backup activity and reporting activity from Primary database. Physical standby
database can be opened for read-only transactions but redo apply won’t happen during that time. But
from 11g onwards using Active Data Guard option (extra purchase) you can simultaneously open the
physical standby database for read-only access and apply redo logs received from primary database.

What is Logical standby database in Oracle Data Guard?

Oracle Standby database are divided into physical standby database or logical standby database based
on standby database creation and redo log apply method. Logical standby database can be created
similar to Physical standby database and later you can alter the structure of logical standby database.
Logical standby database uses SQL Apply method to synchronize logical standby database with primary
database. This SQL apply technology converts the received redo logs to SQL statements and
continuously apply those SQL statements on logical standby database to make standby database
consistent with primary database. Main advantage of Logical standby database compare to physical
standby database is you can use Logical standby database for reporting purpose during SQL apply i.e
Logical standby database must be open during SQL apply. Even though Logical standby database are
opened for read/write mode, tables which are in synchronize with primary database are available for read-
only operations like reporting, select queries and adding index on those tables and creating materialized
views on those tables. Though Logical standby database has advantage on Physical standby database it
has some restriction on data-types, types of DDL, types of DML and types of tables.

What are the advantages of Logical standby database in Oracle Data Guard?

Better usage of resource


Data Protection
High Availability
Disaster Recovery
What is the usage of DB_FILE_NAME_CONVERT parameter in Oracle Data Guard setup?
DB_FILE_NAME_CONVERT parameter is used in Oracle Data Guard setup that to in standby databases.
DB_FILE_NAME_CONVERT parameter are used to update the location of data files in standby database.
These parameter are used when you are using different directory structure in standby database compare
to primary database data files location.
What is the usage of LOG_FILE_NAME_CONVERT parameter in Oracle Data Guard setup?

2
LOG_FILE_NAME_CONVERT parameter is used in Oracle Data Guard setup that to in standby
databases. LOG_FILE_NAME_CONVERT parameter are used to update the location of redo log files in
standby database. These parameter are used when you are using different directory structure in standby
database compare to primary database redo log file location.
Step for Physical Standby
These are the steps to follow:
Enable forced logging
Create a password file
Configure a standby redo log
Enable archiving
Set up the primary database initialization parameters
Configure the listener and tnsnames to support the database on both nodes
col name format a20
col thread# format 999
col sequence# format 999
col first_change# format 999999
col next_change# format 999999

SELECT thread#, sequence# AS “SEQ#”, name, first_change# AS “FIRSTSCN”,


next_change# AS “NEXTSCN”,archived, deleted,completion_time AS “TIME”
FROM v$archived_log
V$ log_history

Tell me about parameter which is used for standby database?

Log_Archive_Dest_n
Log_Archive_Dest_State_n
Log_Archive_Config
Log_File_Name_Convert
Standby_File_Managment
DB_File_Name_Convert
DB_Unique_Name
Control_Files
Fat_Client
Fat_Server
The LOG_ARCHIVE_CONFIG parameter enables or disables the sending of redo streams to the standby
sites. The DB_UNIQUE_NAME of the primary database is dg1 and the DB_UNIQUE_NAME of the
standby database is dg2. The primary database is configured to ship redo log stream to the standby
database. In this example, the standby database service is dg2.
Next, STANDBY_FILE_MANAGEMENT is set to AUTO so that when Oracle files are added or dropped
from the primary database, these changes are made to the standby databases automatically. The
STANDBY_FILE_MANAGEMENT is only applicable to the physical standby databases.
Setting the STANDBY_FILE_MANAGEMENT parameter to AUTO is is recommended when using Oracle
Managed Files (OMF) on the primary database. Next, the primary database must be running in
ARCHIVELOG mode.

What is Dataguard?

Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or
more standby databases to enable production Oracle databases to survive disasters and data
corruptions. Data Guard maintains these standby databases as copies of the production database. Data
Guard can be used with traditional backup, restoration, and cluster techniques to provide a high level of
data protection and data availability.

3
What is DG Broker?

DG Broker “it is the management and monitoring tool”.


Oracle dataguard broker is a distributed management framework that automates and centralizes the
creation , maintenance and monitoring of DG configuration.
All management operations can be performed either through OEM, which uses the broker (or) broker
specified command-line tool interface “DGMGRL”.

What is the difference between Dataguard and Standby?

Dataguard :
Dataguard is mechanism/tool to maintain standby database.
The dataguard is set up between primary and standby instance .
Data Guard is only available on Enterprise Edition.

Standby Database :
Physical standby database provides a physically identical copy of the primary database, with on disk
database structures that are identical to the primary database on a block-for-block basis.
Standby capability is available on Standard Edition.

Dataguard Architecture

The Oracle 9i Data Guard architecture incorporates the following items:

• Primary Database – A production database that is used to create standby databases. The archive logs
from the primary database are transfered and applied to standby databases. Each standby can only be
associated with a single primary database, but a single primary database can be associated with multiple
standby databases.
• Standby Database – A replica of the primary database.
• Log Transport Services – Control the automatic transfer of archive redo log files from the primary
database to one or more standby destinations.
• Network Configuration – The primary database is connected to one or more standby databases using
Oracle Net.
• Log Apply Services – Apply the archived redo logs to the standby database. The Managed Recovery
Process (MRP) actually does the work of maintaining and applying the archived redo logs.
• Role Management Services – Control the changing of database roles from primary to standby. The
services include switchover, switchback and failover.
• Data Guard Broker – Controls the creation and monitoring of Data Guard. It comes with a GUI and
command line interface.

What are the services required on the primary and standby database ?

The services required on the primary database are:


• Log Writer Process (LGWR) – Collects redo information and updates the online redo logs. It can also
create local archived redo logs and transmit online redo to standby databases.
• Archiver Process (ARCn) – One or more archiver processes make copies of online redo logs either
locally or remotely for standby databases.
• Fetch Archive Log (FAL) Server – Services requests for archive redo logs from FAL clients running on
multiple standby databases. Multiple FAL servers can be run on a primary database, one for each FAL
request. .
The services required on the standby database are:
• Fetch Archive Log (FAL) Client – Pulls archived redo log files from the primary site. Initiates transfer of
archived redo logs when it detects a gap sequence.
• Remote File Server (RFS) – Receives archived and/or standby redo logs from the primary database.

4
• Archiver (ARCn) Processes – Archives the standby redo logs applied by the managed recovery process
(MRP).
• Managed Recovery Process (MRP) – Applies archive redo log information to the standby database.

What do db_file_sequential_read and db_file_scattered_read events define?

• Db_file_sequential_read event generally indicates index usage.


• It shows an access by row id.
• While the db_file-scattered_read event indicates full table scan.
• Db_file_sequential_read event reads a single block at one time.
• Whereas db_file_scattered_read event reads multiple blocks.

What is a user process trace file?

• It is an optional file which is produced by user session.


• It is generated only if the value of SQL_TRACE parameter is set to true for a session.
• SQL_TRACE parameter can be set at database, instance, or session level.
• If it set at instance level, trace file will be created for all connected sessions.
• If it is set at session level, trace file will be generated only for specified session.
• The location of user process trace file is specified in the USER_DUMP_DEST parameter.

What is a latch and explain its significance?

• Latch is an on/off switch in oracle that a process must access in order to perform certain type of
activities.
• They enforce serial access to the resources and limit the amount of time for which a single process can
use a resource.
• A latch is acquired for a very short amount of time to ensure that the resource is allocated.
• We may face performance issues which may be due to either of the two following reasons
• Lack of availability of resource.
• Poor application programming resulting in high number of requests for resource.
• Latch information is available in the v$LATCH and v$LATCHHOLDER dynamic performance views.

What is RTS (Redo Transport Services) in Dataguard?

It controls the automated transfer of redo data from the production database to one or more archival
destinations. The redo transport services perform the following tasks:
a) Transmit redo data from the primary system to the standby systems in the configuration.
b) Manage the process of resolving any gaps in the archived redo log files due to a network failure.
c) Automatically detect missing or corrupted archived redo log files on a standby system and
automatically retrieve replacement archived redo log files from the
primary database or another standby database.

What are the DATAGUARD PARAMETERS in Oracle?

Set Primary Database Initialization Parameters


———————————————-
On the primary database, you define initialization parameters that control redo transport services while
the database is in the primary role. There are additional parameters you need to add that control the
receipt of the redo data and log apply services when the primary database is transitioned to the standby
role.

DB_NAME=chicago
DB_UNIQUE_NAME=chicago
LOG_ARCHIVE_CONFIG=’DG_CONFIG=(chicago,boston)’

5
CONTROL_FILES=’/arch1/chicago/control1.ctl’, ‘/arch2/chicago/control2.ctl’
LOG_ARCHIVE_DEST_1=
‘LOCATION=/arch1/chicago/
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=chicago’
LOG_ARCHIVE_DEST_2=
‘SERVICE=boston LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=boston’
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30

Primary Database: Standby Role Initialization Parameters


FAL_SERVER=boston
FAL_CLIENT=chicago
DB_FILE_NAME_CONVERT=’boston’,’chicago’
LOG_FILE_NAME_CONVERT= ‘/arch1/boston/’,’/arch1/chicago/’,’/arch2/boston/’,’/arch2/chicago/’
STANDBY_FILE_MANAGEMENT=AUTO

Prepare an Initialization Parameter File for the Standby Database


—————————————————————–
Create a text initialization parameter file (PFILE) from the server parameter file (SPFILE) used by the
primary database; a text initialization parameter file can be copied to the standby location and modified.
For example:
CREATE PFILE=’/tmp/initboston.ora’ FROM SPFILE;

Modifying Initialization Parameters for a Physical Standby Database.

DB_NAME=chicago
DB_UNIQUE_NAME=boston
LOG_ARCHIVE_CONFIG=’DG_CONFIG=(chicago,boston)’
CONTROL_FILES=’/arch1/boston/control1.ctl’, ‘/arch2/boston/control2.ctl’
DB_FILE_NAME_CONVERT=’chicago’,’boston’
LOG_FILE_NAME_CONVERT= ‘/arch1/chicago/’,’/arch1/boston/’,’/arch2/chicago/’,’/arch2/boston/’
LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
LOG_ARCHIVE_DEST_1= ‘LOCATION=/arch1/boston/
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=boston’
LOG_ARCHIVE_DEST_2= ‘SERVICE=chicago LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=chicago’
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
STANDBY_FILE_MANAGEMENT=AUTO
FAL_SERVER=chicago
FAL_CLIENT=boston

You might also like