Top Banner
DATA GUARD and FLASHBACK Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g
20

DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

Jun 04, 2018

Download

Documents

dotu
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

DATA GUARD and

FLASHBACK – Stress

Testing, HotFixes and Data

Recovery

April Sims

Southern Utah University OCP 8i,9i,10g

Page 2: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

Contributing Editor

If you want to become an

author or reviewer….

Page 3: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

Standbys - 10gR2

Physical

• Block for Block Copy

• REDO APPLY

• Data Loss

Protection Modes

• Can be used for

reporting – not kept

current with

production

Logical

• Read-only

• SQL APPLY

• Add R/W schemas

• Some DDL skipped

• Datatype issues

• Reporting Instance

– current with

primary

Page 4: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

DATA GUARD

• Role Management Services – Failovers and

Switchovers

• Reduces Errors

• Less Manual Intervention

• Faster Transitions

• More work to fail over different clients

• Heterogeneous Environment – More support

in 11g

Page 5: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

Node BNode A

REDO APPLY

PRIMARY STANDBY

STANDBYPRIMARY

Node BNode A

REDO APPLY

DOWNSTANDBY

STBY> ALTER DATABASE

RECOVER MANAGED

STANDBY DATABASE FINISH

FORCE;

Page 6: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

STBY> ALTER DATABASE

COMMIT TO SWITCHOVER

TO PRIMARY;

STANDBYPRIMARY

Node BNode A

REDO APPLY

DOWN STANDBY

STANDBYPRIMARY

Node BNode A

REDO APPLY

DOWN PRIMARY

PRMY> ALTER DATABASE

OPEN;

Page 7: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

April Sims

DATA GUARD

DBA

Page 8: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

Multiple Disaster Recovery Sites

Local Site

• Different Building, Same

City Block

• Different Subnet

• RTO* – 30 minutes

• Linux RH 4 (64-bit) AMD

• No data loss

• Logical Standby –

Reporting only

Remote Site

• 80 miles away

• Different IP, Exterior DNS

• VPN Tunnel

• RTO* – 24 hours

• SAME HARDWARE as

production

• No data loss

• Logical Standby data

already duplicated

*RTO – Recovery Time Objective

Page 9: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

FLASHBACK

PRIMARY DATABASE

• Revert Logical Corruption

• Unroll patch or hot fix

• Similar to a full database

restore

• Affects ALL USERS!

STANDBY DATABASE **

• Physical Corruption

• Logical Corruption

• Vendor Upgrade

• Batch Job Reversal

• Untested Hot Fix, Patch

• Stress Testing

• Restore datafile *see Notes

• Oracle Upgrades

• Reinstate Primary

• ASM or RAC Migration

• Affects minimal number of

USERS!

**Different init.ora parameters

Page 10: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

GUARANTEED RESTORE POINTS

• Requires FLASHBACK to be enabled

• Highly recommended

• Easy to convert back to correct SCN

• Resume role as physical standby

Page 11: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

FLASHBACK STANDBY

PRMY> ALTER SYSTEM ARCHIVE LOG CURRENT;

PRMY> ALTER SYSTEM SET DG_BROKER_START=FALSE;

PRMY> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=DEFER;

REDO APPLY is no longer running, Broker is automatically re-

enabled if not turned off. Logs aren’t shipping. All of these

things change in 11g!

STBY> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

STBY> CREATE RESTORE POINT HOTFIX1 GUARANTEE FLASHBACK DATABASE;

STBY> ALTER DATABASE ACTIVATE STANDBY DATABASE;

TEST……..…..remember Recovery Time Objective

Page 12: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

After Testing….Revert

STBY> STARTUP MOUNT FORCE;

STBY> FLASHBACK DATABASE TO RESTORE

POINT HOTFIX1;

STBY> ALTER DATABASE CONVERT TO PHYSICAL

STANDBY;

STBY> STARTUP MOUNT FORCE;

STBY> ALTER DATABASE RECOVER MANAGED

STANDBY DATABASE USING CURRENT

LOGFILE DISCONNECT;

(*using REAL-TIME APPLY)

Page 13: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

11g Features and Benefits

• Snapshot Database

• Active DATA GUARD

• RMAN

• Real Application Testing

• Flashback Transaction

• Fast Start Failover

• Redo – Compression and SSL Authentication

• Lost-Write Detection

• Live Database Duplication Over Network

Page 14: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

11g

Snapshot

Database

• Data Frozen

• Receives Redo but not

applied

• Can be read-only

(reporting)

• Can be read-write (testing)

• Requires Flash Recovery

Area

• Less steps than in 10g

• Archival Purpose?? *

Third type of

standby….

* Not to be confused with RMAN Archival Backups

Page 15: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

11g - ACTIVE DATA GUARD

• PHYSICAL Standby

• Open for reporting

• Current with Primary

• Unable to add additional R/W schemas,

summations, indexes, MV as with Logical

Standby

• Dual functionality - disaster recovery &

reporting solution.

• Less Errors, Issues as with Logical

• $$$$

Page 16: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

11g - RMAN Changes

• DBID – Identical for Primary and Physical

Standby, Identical is option for Logical

• BLOCK CHANGE TRACKING – Faster

incremental backups

• DB_UNIQUE_NAME – backups available for

restore to all standbys and primary but they

may not be accessible – disk or image

backups

• ARCHIVE DELETION POLICY – critical for

DG implementations

Page 17: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

Must restore application

data to SCN by….

• Point-in-time recovery

• Flashback Database

• Import/Export

TAKE A SNAPSHOT

11g- Real

Application

Testing

Page 18: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

More 11g Stuff….

• FLASHBACK TRANSACTION – useful for

primary instance

• FAST START FAILOVER – conditions

• REDO TRANSPORT – protects archive logs

(can be data mined) with SSL authentication

• LOST WRITE DETECTION – writes that don’t

make it to disk

Page 19: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

11g DATABASE DUPLICATION

OVER NETWORK

• Live Backup – can use either the primary or

the standby database or backups of either

DUPLICATE TARGET DATABASE FOR

STANDBY FROM ACTIVE DATABASE

DORECOVER;

• If duplicated on same box use

SET NEWNAME FOR DATAFILE,TEMPFILE…

( * docs/references - couple of wrong examples)

http://download.oracle.com/docs/cd/B28359_01/server.111/b28294

/rcmbackp.htm#sthref1563 equal signs and “ instead of ‘

Page 20: DATA GUARD and FLASHBACK - Oracle High Availability · DATA GUARD and FLASHBACK –Stress Testing, HotFixes and Data Recovery April Sims Southern Utah University OCP 8i,9i,10g

http://www.dbaexpert.com/blog/?p=27

Oracle Database Experts

Maintained by Charles Kim

Data Guard 11g Database Duplication Over Network Logfile

Posted in August 13th, 2007

by ckim in Data Guard

orapwd file=$ORACLE_HOME/dbs/orapwDBA11g entries=25 password=oracle123

DBA11gDR > ./dup.ksh

Recovery Manager: Release 11.1.0.6.0 - Production on Mon Aug 13 21:46:38 2007

Copyright (c) 1982, 2007, Oracle. All rights reserved.

RMAN>

connected to target database: DBA11G (DBID=231973368)