Oracle Dataguard Concepts:
Oracle dataguard consists of one Primary database which is production and one or more standby databases, connected with oracle net.
Primary database is the one which serves as production.
Standby databases are always in synch with the primary database and are ready to serve as production in any case where primary is unavailable. Standby databases are of three types:
- Physical Standby: Physical standby database is a block to block copy of primary database built using a dataguard service call Log Apply. Redo logs are transported to the Standby side and there standby redo logs are applied according to the recovery mechanism. This is the frequently used configuration of Oracle Dataguard.
- Logical Standby: Logical standby keeps the same logical information of data precisely as the primary database. Although the physical structure of the database may be different from primary because in this configuration the redo logs transported to the standby side are translated into SQL statements and then these SQL statements execute to build the data in the standby database. This process is called SQL APPY.
- Snapshot Standby: This is created by converting Physical Standby database in Snapshot standby database. This is a fully update- able standby database. In this configuration it does receive redo logs from the primary but these redo logs are not applied. Redo logs are applied only when the snapshot standby database is converted back to the physical standby database. And also when Snapshot standby is converted back to physical standby database then all the changes made to it while it was in snapshot standby state, are discarded. So this setup is mostly used for testing and development purposes without disturbing the production.
- Redo Transport Services: This controls automated transfer of redo log files from primary database to any archival destination/s. Redo transport services perform following tasks:
- Manage transmission of data from primary to standby database/s.
- Manage process of resolving LOG_GAPS, i.e., gaps in the archived redo log files between the primary and the standby database.
- Redo transport services enforce protection modes.
- It verifies and replaces all the corrupt redo log files and missing ones, from the primary database or another standby database.
- It involves below background processes:
- ARCn: Archiver provcess
- LGWn: Log writer process.
- RFS: Remote file server process
- FAL: Fetch Archive Log process.
- MRP: Managed Recovery Process.
- LSP: Logical standby process.
- Log Apply Services: This service applies the redo data to the standby database to bring it in synch with the primary database. Log Apply services are categorised as below:
- REDO APPLY: Redo apply is done in case of physical standby databases.
- SQL APPLY: This is done in case of logical standby databases.
- Role Transition Services: In dataguard setup Oracle databases operate in two roles: Primary and standby. We can switch the roles of the databases using switchover or failover:
- Switchover: One of the standby is converted into primary in case of any planned activity.
- Failover: failover is done to switch standby to primary in case the primary is not available due to some failure.
Dataguard Broker: Dataguard broker is distributed management framework which can help us automate the creation, maintenance and monitoring of Oracle Dataguard configuration.
- Maximum Protection: This is based on the transmission of redo log files. This protection mode ensures zero data loss so every transaction must be written to the online redo log files local and standby redo log files of at least one of the standby database which is transactionally consistent. In case due to some fault the redo stream is prevented to write data to the standby redo log file the database shuts down in max protection mode.
- Maximum Availability: This is based on the transmission of redo log files. It works exactly the same way Maximum protection mode does just the difference is that instead of shutting down in case of failure of redo stream being written to standby redo logs, it starts working in Maximum performance mode until the issue is resolved.
- Maximum Performance: This is the default Protection mode. This is based on transmission of archived redo log files. This protection mode provides maximum protection without compromising with the performance of the database. In this the commit is accepted as soon as the data is written to the local online redo log files.