Oracle DataGuard - AIOUG€¦ · · 2017-07-01Navneet Upneja (Manager, Database & Applications)...
-
Upload
trinhthien -
Category
Documents
-
view
220 -
download
3
Transcript of Oracle DataGuard - AIOUG€¦ · · 2017-07-01Navneet Upneja (Manager, Database & Applications)...
© 2015 Oceaneering International, Inc. All rights reserved. Rev B 11.
Navneet Upneja
Manager, Database & Applications
Oracle DataGuard
Data
?
?
?
?
Types of Disaster
Navneet Upneja (Manager, Database & Applications)
10 Years of Experience in Oracle Databases and Middleware
Applications
Oracle Certified Professional
Hand on experience on OLTP, Datawarehouse, Oracle BI, APEX…
Co-Founder of AIOUG - North India Chapter.
Email: [email protected]
Blog: http://navneetupnejadba.wordpress.com/
Twitter: @navneetupneja
Presentations: http://www.slideshare.net/navneetupneja
Navneet Upneja
• Oracle Data Guard
– Physical Standby Database
– Logical Standby Database
• Oracle Active Data Guard
– Read only Physical Standby Database
• Oracle Golden Gate
– Sort of Active Read/Write Logical Standby Database
• Oracle RAC
– HA option within Data Center
Oracle High Availability Options
• Ensures high availability, data protection, and disaster recovery for
enterprise data.
• Provides a comprehensive set of services that create, maintain,
manage, and monitor one or more standby databases.
• Maintains these standby databases as transactionally consistent
copies of the production database.
• Switchover – Planned Maintenance
• Failover – Unplanned Outage
Oracle Dataguard – Insurance to your Data
• Consists of one production database and one or more standby
databases.
• Connected by Oracle Net and may be dispersed geographically.
• No restrictions on where the databases are located, provided they
can communicate with each other
• Operates on a simple principle:
– Ship Redo
– Apply Redo
Dataguard - Overview
Primary
Database
SGA LNS Standby
DatabaseRFS Apply
CO
MM
IT
Oracle Net Services
1 2 2 2 2
SR Logs
Types of Standby Databases
• Exact, block for block copy of a primary database
• Maintained through a process called as Redo Apply
• Redo Received from Primary is continuously applied to a physical Standby
database
• Can be opened for a read only access
• Redo Apply can still be active while Database is open – Active Data
Guard
• Additional License is required.
Physical Standby Database
• Initially created as Identical copy of Physical database
• Can be altered to have different Structure at later stage
• It always remain “OPEN”.
• Maintained through a process called “SQL APPLY”
• Additional objects,schema’s can be created apart from what is maintained by SQL
APPLY.
• Tricky part is to protect the data set being maintained by Dataguard (SQL Apply).
Logical Standby Database
• This is an Updatable Standby database
• Additional Feature over and above Physical Standby Database.
• Database is open for read write operations while Redo Apply is stopped.
• Still receives Redo data and store as Archive Log files.
• Uses Flashback and Guaranteed Restore Points to perform the action.
• Useful in for performing any testing when it cannot be done on Primary.
• Need to maintain FRA with adequate size depending on the load.
Snapshot Standby Database
• New in Oracle 12c
• Accepts Redo from Primary Database
• Send Redo to other Standby databases
• Contains Control Files and Standby Redo Logs
• Does Not have Datafiles.
• Require very less disk and memory resources
• Preferred to be in same geographic location as of Primary
• Useful during the time of maintenance on Standby Site
• Require Additional License (Oracle Active Dataguard)
Far Sync Instance
Primary
DatabaseStandby
DatabaseRFS Apply
Oracle Net Services
SR Logs
Control
File
Archive Redo Logs
SR Logs
Oracle Net Services
Primary and Physical Standby Still Need to be Connected
Does this have an Overhead on Primary?
Protection Methods and Redo Transport Methods
1
Synchronous Redo Transport (SYNC) – Zero Data Loss
Primary
Database
SGA
LNS
LGWR
Standby
Database
RFS Apply
CO
MM
IT
Oracle Net Services
1
1
2
3
2 2 2
3
Online Redo Logs
SR Logs
User Session Waiting
• Standby Database is ALWAYS in SYNC with Primary
• SYNC method of Redo Transport Services is used
• Primary Waits for the Acknowledgement from RFS process on Standby before it
sends Commit message to User Session
• RFS Sends Acknowledgement to LNS on primary once Redo Data is written to
Standby Redo Logs on Standby.
• In case of Failure on Standby Side, This mode Shuts the Primary database
down. This is 100% protection.
• This Mode can impact performance on Primary Database.
Maximum Protection Mode
1
Synchronous Redo Transport (SYNC) – Zero Data Loss
Primary
Database
SGA
LNS
LGWR
Standby
Database
RFS Apply
CO
MM
IT
Oracle Net Services
1
1
2
3
2 2 2
3
Online Redo Logs
SR Logs
User Session Waiting
Net_Timeout
• Works Same as Maximum Protection Mode with a condition “As Long as it
can”
• In the event of No Acknowledgement from the Standby, LNS waits for
certain duration of time defined by “Net_Timeout” parameter
• Inform LGWR about no acknowledgement
• LGWR continue and send Commit notification to the User Session
Maximum Availability Mode
Primary
Database
SGA
LNS
LGWR
Standby
Database
RFS Apply
CO
MM
IT
1
1
2
1
2 2 2
Online Redo Logs
SR Logs
2
Asynchronous Redo Transport (ASYNC)
• Default Mode
• Minimum Overhead on the Primary Database
• Primary Database does not wait for Standby
• ASYC Method of Redo Transport Service is Used
• LNS tries to keep Standby in sync with reading Redo from Log Buffer
• Fall back to Online Redo Log files in case of failure to keep the pace with amount of
Redo Generated
• Most Commonly Used
Maximum Performance Mode
What if You have an Human Error?
• Enable Oracle’s Flashback Just on Standby Database
• No Change Required on Primary Database
• Can go back in time on Standby Database
– Restore Drop Table
– Recover Deleted Data or Truncated Table
– Resetlogs on Primary?? No need to create the standby Again
Just Flashback!!!!
Flashback- Oracle’s Time Machine
1. Missing Archive Log on Standby
– RFS should automatically request ARCH on primary for missing log
– Restore using RMAN on Primary, if required Archive not available
2. Datafile Added on Primary is added as “Missing” on standby
– Ensure Standby_File_Management Set to Auto on Standby
– Manually Rename file to correct location and name.
3. Huge Log Gap
– Ship Archive Log backup’s from Primary to Standby and Recover using RMAN
– Incremental Backup and Recover (Very Useful for Large Databases)
4. Primary Database Hung
– CONFIGURE ARCHIVELOG DELETION POLICY TO NONE;
Real Time Issues & Resolutions
1. Offload Backup’s
– Can run Full and Incremental backup’s on Standby
– Standby Backup’s can be used to create Clone Databases
2. Reporting Database
– Open Database in Read only Mode.
3. Issue/Fix Testing – Snapshot Standby
– Snapshot Standby can be used for immediate Issue Fix Testing when cloning an
environment is not possible
4. Upgrade Primary with Standby Intact
– Start Standby with new database version lets say 12.1.0.2, and run upgrade on Primary.
You don’t need to re-create Standby.
– Really of great use with huge databases.
Some Freebee’s
• Oracle’s Dataguard Feature
• Need Addition License “Advanced Compression Option”
• What about Network Compression?
• Use “SSH” Tunnel to compress Redo over Network
• ssh -f -C -L 9022:standby.site.com:1521 [email protected]
• Uses same algrithm as “gzip(1)” on server
• Useful for Slow networks
Redo Compression?
Thank You for Your attention!