7.oracle DATA GUARD
7.oracle DATA GUARD
2. What are different types of modes in Data Guard and which is default?
Maximum Availability
This protection mode provides the highest level of data protection that is possible without
compromising the availability of a primary database. Transactions do not commit until all redo data
needed to recover those transactions has been written to the online redo log and to the standby redo
log on at least one synchronized standby database. If the primary database cannot write its redo stream
to at least one synchronized standby database, it operates as if it were in maximum performance mode
to preserve primary database availability until it is again able to write its redo stream to a synchronized
standby database.
This mode ensures that no data loss will occur 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
This protection mode provides the highest level of data protection that is possible without affecting the
performance of a primary database. This is accomplished by allowing transactions to commit as soon as
all redo data generated by those transactions has been written to the online log. Redo data is also
written to one or more standby databases, but this is done asynchronously with respect to transaction
commitment, so primary database performance is unaffected by delays in writing redo data to the
standby database(s).
This protection mode offers slightly less data protection than maximum availability mode and has
minimal impact on primary database performance.This is the default protection mode.
Maximum Protection
This protection mode ensures that no data loss will occur if the primary database fails. To provide this
level of protection, the redo data needed to recover a transaction must be written to both the online
redo log and to the standby redo log on at least one synchronized standby database before the
transaction commits. To ensure that data loss cannot occur, the primary database will shut down, rather
than continue processing transactions, if it cannot write its redo stream to at least one synchronized
standby database.
Transactions on the primary are considered protected as soon as Data Guard has written the redo data
to persistent storage in a standby redo log file. Once that is done, acknowledgment is quickly made back
to the primary database so that it can proceed to the next transaction. This minimizes the impact of
synchronous transport on primary database throughput and response time. To fully benefit from
complete Data Guard validation at the standby database, be sure to operate in real-time apply mode so
that redo changes are applied to the standby database as fast as they are received. Data Guard signals
any corruptions that are detected so that immediate corrective action can be taken.
Because this data protection mode prioritizes data protection over primary database availability, Oracle
recommends that a minimum of two standby databases be used to protect a primary database that runs
in maximum protection mode to prevent a single standby database failure from causing the primary
database to shut down.
4. What are the parameters we’ve to set in primary/standby for Data Guard?
FAL_CLIENT specifies the FAL (fetch archive log) client name that is used by the FAL service, configured
through the FAL_SERVER parameter, to refer to the FAL client. The value is an Oracle Net service name,
which is assumed to be configured properly on the FAL server system to point to the FAL client (standby
database). Given the dependency of FAL_CLIENT on FAL_SERVER, the two parameters should be
configured or changed at the same time.
FAL_CLIENT and FAL_SERVER are initialization parameters used to configure log gap detection and
resolution at the standby database side of a physical database configuration. This functionality is
provided by log apply services and is used by the physical standby database to manage the detection
and resolution of archived redo logs.
FAL_CLIENT and FAL_SERVER only need to be defined in the initialization parameter file for the standby
database(s). It is possible; however, to define these two parameters in the initialization parameter for
the primary database server to ease the amount of work that would need to be performed if the
primary database were required to transition its role.
In Primary site:
FAL_SERVER=STANDBY
FAL_CLIENT=PRIMARY
In Standby site:
FAL_SERVER=PRIMARY
FAL_CLIENT=STANDBY
6. What are differences between physical, logical, snapshot standby and ADG
(or) what are different types of standby databases?
8. If you didn’t have access to the standby database and you wanted to find out what error has
occurred in a data guard configuration, what view would you check in the primary database to check
the error message?
You can check the v$dataguard_status view.
9. How can u recover standby which far behind from primary (or) without archive logs how can we
make standby sync?
By using RMAN incremental backup.
10. What is snapshot standby (or) How can we give a physical standby to user in READ WRITE mode
and let him do updates and revert back to standby?
Till Oralce 10g, create guaranteed restore point, open in read write, let him do updates, flashback to
restore point, start MRP. From Oracle 11g, convert physical standby to snapshot standby, let him do
updates, convert to physical standby, start MRP.
15. What is the difference between normal MRP (managed apply) and RTA MRP (real time apply)?
Standby database runs in three different modes
Maximum Performance
Maximum availability
Maximum protection
Maximum performance is yours ASYNChronous apply of redo entries at standby site and
problems at standby site
doesn't halt your production site at all.
e.g : Network failed between primary site and standby site, you will not face any issue at
production site.
Maximum protection is your SYNChronous apply of redo entries at standby site and a problem
at standby site halts the
production site as well. This ensures that both the site are in complete sync and even disaster at
primary site will not result
in data loss.
Maximum availability is in between your above two modes, it works like a maximum protection
mode and provide synchronous
transmission of redo entries, but in case of unavailability at standby site it doesn't halt primary
database rather convert itself to maximum
performance mode.
Above command will start MRP process and starts the recovery of configured database with
redo entries. Disconnect from session releases the control back to client connection.
Above command will use Real Time Apply, a new feature which was introduced in 10g, this
will ensure that the redo entries will be applied directly from standby log files, thus you receive a
real time data. This facilitate 11g Active data guard concept as well.
Thus this command starts the MRP process, but it does't wait for the logs to complete before
applying, rather it picks up changed
entries from current standby logfiles and recovers the database.
e.g : You used current logfile syntax for recovery and you did insert into tableName values(1) at
primary site, changes are captured in
the redo log and LGWR is used to transfer entries to standby site. The entries are transferred to
RFS Process at the standby site, which
copies the entry to standby redo logfiles, since the method used is current logfile. The changes
are applied immediately. Thus your changed
data at primary site and standby site is available immediately rather than waiting for the entire
log to be filled before applying to standby site.
- See more at: http://www.oracledba.in/Articles/display_article.aspx?
article_id=43#sthash.oXf1Vypb.dpuf
Synchronous transport (SYNC) is also referred to as "zero data loss" method because the LGWR is not
allowed to acknowledge a commit has succeeded until the LNS can confirm that the redo needed to
recover the transaction has been written at the standby site.
1. The user commits a transaction creating a redo record in the SGA, the LGWR reads the redo
record from the log buffer and writes it to the online redo log file and waits for confirmation
from the LNS
2. The LNS reads the same redo record from the buffer and transmits it to the standby database
using Oracle Net Services, the RFS receives the redo at the standby database and writes it to the
SRL
3. When the RFS receives a write complete from the disk, it transmits an acknowledgment back to
the LNS process on the primary database which in turns notifies the LGWR that the transmission
is complete, the LGWR then sends a commit acknowledgment to the user
This setup really does depend on network performance and can have a dramatic impact on the primary
databases, low latency on the network will have a big impact on response times. The impact can be seen
in the wait event "LNS wait on SENDREQ" found in thev$system_event dynamic performance view.
There is also a timeout value that can be adjusted in the event of a network failure, we will discuss this
in more detail in the installation section
Asynchronous transport (ASYNC) is different from SYNC in that it eliminates the requirement that the
LGWR waits for a acknowledgment from the LNS, creating a "near zero" performance on the primary
database regardless of distance between the primary and the standby locations. The LGWR will continue
to acknowledge commit success even if the bandwidth prevents the redo of previous transaction from
being sent to the standby database immediately. If the LNS is unable to keep pace and the log buffer is
recycled before the redo is sent to the standby, the LNS automatically transitions to reading and sending
from the log file instead of the log buffer in the SGA. Once the LNS has caught up it then switches back
to reading directly from the buffer in the SGA.
The log buffer ratio is tracked via the view X$LOGBUF_READHIST a low hit ratio indicates that the LNS is
reading from the log file instead of the log buffer, if this happens try increasing the log buffer size.
The drawback with ASYNC is the increased potential for data loss, if a failure destroys the primary
database before the transport lag is reduced to zero, any committed transactions that are part of the
transport lag are lost. So again make sure that the network bandwidth is adequate and that you get the
lowest latency possible.
Controls whether a redo transport destination acknowledges received redo data before or after writing
it to the standby redo log:
● LGWR transmission
● All writings into the online redo log are synchronously or asynchronously transmitted to the
standby database. If there is astandby redo log on the standby site, it is used. If there is no
standby redo log on the standby site, an archive log will be gradually filled. However, the
uncompletely filled archive log cannot be used in case of a disaster. Therefor, it is recommended
to use standby redo logs.
● LGWR transmission is specified through the log_archive_dest_noption LGWR:
● log_archive_dest_2='service=to_standby lgwr'
● If LGWR transmission is used, there should be a row havingclient_process=LGWR
in v$managed_standby.
● ARCH transmission
● Data is transmitted as an archived redo logs.
● ARCH transmission is specified through the log_archive_dest_noption ARCH:
● log_archive_dest_2='service=to_standby arch'
● If ARCH transmission is used, there should be a row havingclient_process=ARCH
in v$managed_standb
18. What is Data Guard broker (or) what is the use of dgmgrl?
The Log Transport Service and Log Apply Service form the backbone of the Data Guard environment. The
log transport service starts on the primary database and completes on the standby database. The
following processes facilitate the log transport service on the primary and the standby site:
- Archiver Process ? The archiver process (ARCn or ARCH) is responsible for archiving online
redo logs. The archival destination could be a local destination or a remote standby database
site. In the case of a Data Guard configuration, one of the archival destinations must be a
standby database. The archiver process of the primary database writes the redo log file.
For a better data protection mode, the standby redo log files can be configured on the standby
database. In this case, the archiver process on the standby site will be used to archive the
standby redo log files.
- Log Writer (LGWR) ? The log writer process on the primary database writes entries from the
redo log buffer to the online redo log file. When the current online redo log file is full, it triggers
the archiver process to start the archiving activity. In some cases, the log writer process writes
redo entries to the online redo log file of the primary database and the standby redo log file of
the standby database. Usually, in this kind of arrangement the LGWR works as the log transport
agent that is setup to achieve high data protection modes.
- Remote File Server (RFS) Process ? The RFS process runs on the standby database and is
responsible for communication between the primary and the standby database. For the log
transport service, the RFS on the standby database receives the redo records from the archiver
or the log writer process of the primary database over Oracle Net and writes to filesystem on the
standby site.
- Fetch Archive Log (FAL) ? The FAL process has two components: FAL Client and FAL Server.
Both processes are used for archive gap resolution. If the Managed Recovery Process (MRP) on
the standby database site detects an archive gap sequence, it initiates a fetch request to the FAL
client on the standby site. This action, in turn, requests the FAL server process on the primary
database to re-transmit the archived log files to resolve the gap sequence. Archive gap
sequences will be discussed later in this chapter.
Once the log transport service completes the transmission of redo records to the standby site,
the log apply service starts applying the changes to the standby database. The log apply service
operates solely on the standby database. The following processes on the standby site facilitate
the log apply operations:
- Managed Recovery Process (MRP) ? The MRP applies the redo entries from the archived
redo logs onto the physical standby database.
- Logical Standby Process (LSP) ? The LSP applies the redo records from archived redo logs to
the logical standby database. The Oracle database log miner engine is used by the logical
standby process for the SQL apply operations. Using the log miner engine, the LSP process
recreates the SQL statements from redo logs that have been executed on the primary database.
These statements are then applied to the standby database to keep it current with the primary
database.
Maximum protection:
This protection mode ensures that no data loss will occur if the primary
database fails. To provide this level of protection, the redo data needed to
recover a transaction must be written to both the online redo log and to at
least one standby database before the transaction commits. To ensure that
data loss cannot occur, the primary database will shut down, rather than
continue processing transactions.
Maximum availability:
This protection mode provides the highest level of data protection that is
possible without compromising the availability of a primary database.
Transactions do not commit until all redo data needed to recover those
transactions has been written to the online redo log and to at least one
standby database.
From Oracle 11g, convert physical standby to snapshot standby, let him do
updates, convert to physical standby, start MRP.