Oracle Data Guard
Oracle Data Guard helps protect your database by keeping standby copies synchronized with the primary. This post covers key Data Guard concepts, setup, roles, failover, and management to help DBAs prepare for interviews.
1. What is Oracle Data Guard and why is it used?
Oracle Data Guard creates and manages standby databases to protect data and provide disaster recovery. It ensures data availability and minimizes downtime.
2. What are the different types of Oracle Data Guard configurations?
There are two main types: Physical Standby (exact copy of primary) and Logical Standby (data is transformed for reporting or other uses).
3. Explain the role of Primary and Standby databases.
The Primary database handles user transactions. The Standby database receives and applies changes from the Primary to stay synchronized.
4. What is the difference between Physical Standby and Logical Standby?
Physical Standby applies redo logs exactly, maintaining the same data. Logical Standby transforms and applies SQL changes, allowing different structures and queries.
5. What are the Data Guard protection modes?
There are three: Maximum Protection (no data loss), Maximum Availability (minimal data loss), and Maximum Performance (best performance, some data loss possible).
6. How does Data Guard ensure data synchronization between primary and standby?
Using Log Transport Services to send redo data and Log Apply Services to apply it on the standby.
7. What is the role of Redo Apply and SQL Apply?
Redo Apply replays redo logs on Physical Standby. SQL Apply executes SQL on Logical Standby to keep data consistent.
8. How do you perform a switchover in Data Guard?
Switchover is a planned role reversal where primary becomes standby and vice versa, with minimal downtime.
9. How do you perform a failover in Data Guard?
Failover is an unplanned switch to standby when primary fails. It makes standby the new primary but may cause some data loss.
10. What is a Broker in Oracle Data Guard?
The Broker automates management and monitoring of Data Guard configurations via commands or GUI.
11. How can you monitor Data Guard status and performance?
Using views like V$DATAGUARD_STATS, DG Broker commands, and alert logs.
12. What are the key initialization parameters for Data Guard setup?
Parameters like LOG_ARCHIVE_CONFIG, LOG_ARCHIVE_DEST_n, FAL_SERVER, FAL_CLIENT, and STANDBY_FILE_MANAGEMENT.
13. How does Data Guard handle network failures?
It retries redo transmission and queues redo logs locally until the network is restored.
14. What is a Far Sync instance?
A lightweight standby that receives redo from primary and forwards it to physical standbys, improving zero data loss protection.
15. What are the common errors in Data Guard and how to troubleshoot them?
Errors like log gaps, apply errors, and network issues. Troubleshooting involves checking alert logs, Data Guard views, and fixing network or configuration problems.
16. How does Data Guard integrate with RMAN for backups?
You can back up the standby database using RMAN to offload backup workload from primary.
17. What is fast-start failover?
An automated failover feature that quickly switches to standby if the primary fails, using the Data Guard Broker.
18. How do you configure Data Guard Broker?
By creating a broker configuration file and enabling the broker on primary and standby with relevant parameters.
19. What is the role of the Log Transport Services and Log Apply Services?
Log Transport sends redo data from primary to standby. Log Apply applies redo or SQL changes on standby.
20. What considerations are there for Data Guard with RAC?
Ensure all RAC nodes send redo properly, use services for failover, and configure broker to handle RAC environments.