Understanding Oracle Data-guard
Data guard is a feature of Oracle High availability .
We have 2 types of dataguard
1-> logical standby
2- physical Standby
in this section I will discuss about physical standby
Architecture
when a user process connects to the primary server it will perform DML operations as part of this the modified information is recorded in the log buffer. From log buffer data will be updated in to ORL(online redo logs ) using LGWR as redo entries.
The updated information / redo entries are read by the LNS(log network service) from redo buffer and passes through oracle net service and at the other side RFS process receives the redo data and applies on the SRL
LNS Supports 2 types of transfer modes
Synchronous and Asynchronous transmission
In synchronous
- user commits a transaction creates a redo in redo buffer of SGA and it is being updated to ORL and waits for the confirmation from LNS as it reads the same data from redo and transmits to RFS to SRL
- RFS will send a write complete ACK to LNS and it is being notified to LGWR , and this is where user will get commit confirmation
Async:
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.
What is Automatic GAP resolution:
It is a common scenario in DG where a LGWR will send the commit ack to the user irrespective of the redo transmission ACK from LNS by RFS and this could be due to network issue. In this case an archiver process will come into business as it frequently queries the standby control file to determine the last applied redo and then transmits missing archive files(offline redo logs) and RFS to apply to the SRL. Once the GAP got reduced the LNS will come into business by reading the redo buffer and transmits to RFS to apply to SRL.
what is redo Apply:
Redo apply is basically a block by block physical replica of the primary database. it uses MRP to read records from SRLs into memory and apply change vectors to the standby database
It allows you to be able to use the standby database in a read-only fashion, Active Data Guard solves the read consistency problem in previous releases by the use of a "query" SCN. The media recovery process on the standby database advances the query SCN after all dependent changes in a transaction have been fully applied.
Protection Modes:
- Maximum Performance
- Maximum Availability
- Maximum Protection
Maximum Performance :
This mode uses ASYNC redo transport so that the LGWR process never waits for acknowledgment from the standby database, This is the default mode.
Maximum Availability :
This mode uses SYNC redo transport, if standby server is unavailable the primary will wait the specified time in the NET_TIMEOUT parameter before giving up on the standby server and allowing the primary to continue to process. Once the connection has been re-established the primary will automatically resynchronize the standby database.
When the NET_TIMEOUT expires the LGWR process disconnects from the LNS process, acknowledges the commit and proceeds without the standby, processing continues until the current ORL is complete and the LGWR cycles into a new ORL, a new LNS process is started and an attempt to connect to the standby server is made, if it succeeds the new ORL is sent as normal, if not then LGWR disconnects again until the next log switch, the whole process keeps repeating at every log switch, hopefully the standby database will become available at some point in time.
Maximum Protection:
This mode is data protection, even to the point that it will affect the primary database. This mode uses the SYNC redo transport and the primary will not issue a commit acknowledgment to the application unless it receives an acknowledgment from at least one standby database, basically the primary will stall and eventually abort preventing any unprotected commits from occurring.
- Physical Standby - open read-only
- Snapshot Standby - QA and Testing (convert database 'prod' to snapshot standby;)
- Real Application Testing (RAT)
- Active Data Guard
Comments
Post a Comment