oracle dataguard - aioug€¦ ·  · 2017-07-01navneet upneja (manager, database &...

29
© 2015 Oceaneering International, Inc. All rights reserved. Rev B 11. Navneet Upneja Manager, Database & Applications Oracle DataGuard

Upload: trinhthien

Post on 15-Apr-2018

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

© 2015 Oceaneering International, Inc. All rights reserved. Rev B 11.

Navneet Upneja

Manager, Database & Applications

Oracle DataGuard

Page 2: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

Data

?

?

?

?

Page 3: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

Types of Disaster

Page 4: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

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

Page 5: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 6: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 7: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 8: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

Primary

Database

SGA LNS Standby

DatabaseRFS Apply

CO

MM

IT

Oracle Net Services

1 2 2 2 2

SR Logs

Page 9: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

Types of Standby Databases

Page 10: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 11: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 12: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 13: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 14: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

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

Page 15: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

Does this have an Overhead on Primary?

Page 16: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

Protection Methods and Redo Transport Methods

Page 17: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

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

Page 18: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 19: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

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

Page 20: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 21: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

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)

Page 22: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 23: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

What if You have an Human Error?

Page 24: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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

Page 25: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

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

Page 26: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

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

Page 27: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified
Page 28: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

• 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?

Page 29: Oracle DataGuard - AIOUG€¦ ·  · 2017-07-01Navneet Upneja (Manager, Database & Applications) 10 Years of Experience in Oracle Databases and Middleware Applications Oracle Certified

Thank You for Your attention!