The primary db must run in archivelog mode and with forced logging.
Standby databases
Standby databases are (transactionally consistent) copies of the primary database.
Up to 30 standby databases are supported.
Physical and logical standby databases
A standby DB is either a physical or logical standby database. (A standby database can also become a snapshot standby database).
A physical database is an exact byte-wise copy of the primary database.
A logical database has the same data as the primary database, but is not necessarily stored in the same database blocks.
The physical database is kept synchronized with redo apply, the logical database with SQL apply.
Cascading standby database
A physical standby database might be configured to receive redo from a primary database and relay it to a another standby database.
In this case, the relaying database is (also) called a cascading standby database. The receiveing standby databases are also known as a terminal destination.
With such a configuration, the load on the primary database can be reduced.
SQL*Plus
Some SQL*Plus statements come with the standby keyword which indicates that the statement should be applied on the standby databases.
Finally, using media recovery, the redo is used to roll forward the standby database.
Preventing physical errors
A standby database validates the redo it receives from the primary DB.
Thus, physical errors (such as data corruption) on the primary DB are not propagated to standby databases.
Changing roles of databases
The role (primary vs standby) of a database can be changed by either a
switchover or
a failover
A switchover is a planned role transition. In a switchover, the primary database becomes a standby database while (one of) the standby databases becomes the primary database.
A switchover is performed in two steps: 1) the primary DB becomes a standby DB 2) a standby DB becomes a primary DB.
A failover occurs when the primary database becomes unavailable. In this case, one of the standby databases becomes the new primary database.
RAC
The primary db and the standby databases can be run as single instance or real application clusters (RAC).
Active Data Guard
Active data guard offers the same features as data guardplus that it standby databases are opened read only while the copying of data takes place
Thus, it allows to query the standby databases without impacting the performance of the production database (for example to create resource-intensive reports).
The standby database is called physical standby database.
The buzzword is real time query.
Active data guard must be licenced separately.
Data protection modes
Data Guard runs in one of three data protection modes. This allows to balance data availability against system performance requirements.
These protection modes are:
Maximum performance (default)
Maximum protection
Maximum availability
Automatic gap detection
If connectivity is lost between the primary and one or more standby databases …k
Configuration
Each primary and standby database needs its own control file.
select
protection_mode,
protection_level,
database_role,
switchover_status,
--
-- Columns related to fast-start failover status
--
fs_failover_status,
fs_failover_current_target,
fs_failover_threshold,
fs_failover_observer_present
from
v$database;
Redo apply and transport status on a physical standby database:
select
process,
status,
thread#,
sequence#,
block#,
blocks
from
v$managed_standby;
Archived redo log files that have been received by a physical or snapshot standby database:
select
thread#,
sequence#,
first_change#,
next_change#
from
v$archived_log;