oracle recovery manager 12 oracle dba, ... recovery manager new features in oracle 12c . ... –...

31
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | Oracle Recovery Manager 12c Data Protection in 12cR1 Sridhar Ranganathan Sr. Principal Product Manager, Oracle Database High Availability Rao S. Kasinadhuni Senior Oracle DBA, Vice President J.P. Morgan, AM Infrastructure October 29, 2015 Presented with

Upload: ngodung

Post on 06-Mar-2018

263 views

Category:

Documents


4 download

TRANSCRIPT

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Recovery Manager 12c Data Protection in 12cR1

Sridhar Ranganathan Sr. Principal Product Manager, Oracle Database High Availability Rao S. Kasinadhuni Senior Oracle DBA, Vice President J.P. Morgan, AM Infrastructure October 29, 2015

Presented with

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Program Agenda

Recovery Manager New Features in Oracle 12c

J.P.Morgan – Cross Platform Migration: Real World Use Case

New Backup Solutions using RMAN

Flashback Technologies in Oracle 12c

Oracle Secure Backup 12.1

Maximum Availability Architecture

1

2

3

4

5

2

6

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

RMAN in Oracle Database 12c Release 1 18 Years of Innovation (Introduced in Oracle 8 Circa 1997)

3

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

RMAN 12c: Table & Table Partition Recovery • Simple RECOVER TABLE command to recover one or more

tables/partitions (most recent or older version) from an RMAN backup

• Eliminates time and complexity associated with manual steps: 1. Regular RMAN backups are taken using DISK and/or SBT

channels. 2. Upon RECOVER TABLE, an auxiliary instance is started using the

primary control file,SYSTEM,SYSAUX,UNDO, and user tablespaces containing the table(s).

3. Auxiliary instance is recovered to the desired time/SCN.

4. Tables are imported to the same schema via SQL*Net.

• Recovers to the same schema

• Use REMAP TABLE or REMAP TABLESPACE to recover to a new name.

Primary Instance

Auxiliary Instance

Data Pump Import

12c

RMAN Backups

RECOVER TABLE SCOTT.EMP UNTIL SCN 123456 AUXILIARY DESTINATION '/tmp/oracle/recover‘;

RMAN Restore

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

RMAN 12c: Network Efficient ACTIVE DUPLICATE

• Uses Auxiliary Channels (clone side) to PULL data from the source database

• Data files are copied as backup sets – Unused block compression, multi-channel, compression,

encryption – Reduced transfer sizes for faster clone creation

• New NOOPEN keyword to not open the clone automatically after the operation

5

Improved for Performance Source Database Clone Database

12c 12c

DUPLICATE TARGET DATABASE TO cloneDB FROM ACTIVE DATABASE USING COMPRESSED BACKUPSET SECTION SIZE 100M NOOPEN;

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

RMAN 12c: Over the Network Recovery for Data Guard

• Scenario: Standby lagged Primary due to prolonged network outage

• Connect to Standby as TARGET • Use the new FROM SERVICE keyword

• Creates incremental backups as of current SCN

on Primary, pulls them over the network and applies on the Standby

6

Fast Standby Synchronization

RECOVER DATABASE FROM SERVICE <PRIMARY TNS ALIAS> {USING COMPRESSED BACKUPSET};

Physical Standby DB

Primary DB 12c 12c

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.

RMAN 12c: Over the Network Recovery for Data Guard

• Scenario: Primary database datafile corrupted due to media error

• Connect to Primary as TARGET

• Use the new FROM SERVICE keyword

• Creates full backup of the datafile from Standby, pulls them over the network and restores on the Primary.

7

Fast Primary Database Recovery

RESTORE DATAFILE <#> FROM SERVICE <STANDBY TNS ALIAS> {SECTION SIZE <#> COMPRESSED BACKUPSET};

Physical Standby DB

Primary DB 12c 12c

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

RMAN 12c: Support for Multitenant Databases • New PLUGGABLE DATABASE and ROOT keywords

• Connect as ROOT common user: Backup, Restore, Recover CDB or selected PDBs • Connect as PDB local user: Backup & Restore PDB (excludes archived logs)

• Backup commands as ROOT user:

• Restore commands as ROOT user:

• Recovery of CDB & PDB: – Complete Recovery:

– PIT Recovery (PITR):

– Open after PITR:

8

RMAN Backup - CDB

RMAN Backup - PDB

BACKUP DATABASE; BACKUP (PLUGGABLE DATABASE <PDB1>, <PDB2>); BACKUP TABLESPACE <PDB1>:<TBS1>, <PDB2>:<TBS1>;

RESTORE DATABASE; RESTORE PLUGGABLE DATABASE <PDB1>; RESTORE TABLESPACE <PDB2>:<TBS1>;

RECOVER {PLUGGABLE} DATABASE;

RECOVER {PLUGGABLE} DATABASE <PDB/CDB> UNTIL …

ALTER {PLUGGABLE} DATABASE <PDB/CDB> OPEN RESETLOGS;

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

XTTS & RMAN for Platform Migration Methods

• Migrate using Manual Procedure – Traditional XTTS Migration with extended downtime

• Phase 1 & 3

• Migrate using Scripts – Reduce Downtime with XTTS & RMAN Incrementals

• Phase 1,2 & 3

– MOS Doc ID 1389592.1 • Reduce Downtime using XTTS & RMAN Incrementals • For Source databases 10.2 and above

– MOS Doc ID 2005729.1 • Scripts Updated using new RMAN 12c Features • For source & destination databases 12.1 and above

9

Phase 3: Transport Last read-only L1 and

transfer Export & Import

metadata

Phase 2: Roll-Forward (Reduce Downtime)

Perform L1 and transfer while source is in r/w

Repeat this until cut-off period

Phase 1: Prepare

Install Target System Perform L0 and transfer

New

Cross-Platform, Cross-Endian Migration Across Versions

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

RMAN 12c: Enhancements for Cross Platform Migration • Support for BACKUPSET format

– Unused block compression, smaller transport size, multi-section

• New keywords in RMAN 12c – FOR TRANSPORT at source platform – TO PLATFORM (conversion at source to a specific platform) – FROM PLATFORM (conversion at destination from a specific platform) – ALLOW INCONSISTENT to create inconsistent backups of tablespace (during incremental backups)

• No longer require CONVERT TABLESPACE or CONVERT DATAFILE procedure • Can include tablespace metadata if that tablespace is read-only (final step)

• XTTS with incremental backups reduces downtime up to 8X

• Backups from 10g, 11g can be restored to a 12c destination

10

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

11

Example: Cross-Platform Transport Steps Using RMAN 12c

1. Level 0 Full Backup

3. Level 1 incremental Backup *

5. Final Level 1 incremental

Tablespaces in Read-Only (Consistent)

2. Restore L0 Backup

4. Recover L1 incrementals *

6. Final Recovery L1

7. Import (Plugin) new Tablespace

8. Make the Tablespace read/write

BACKUP FOR TRANSPORT ALLOW INCONSISTENT INCREMENTAL LEVEL 0 TABLESPACE TBS1 FORMAT '/tmp/TBS1_level0.bck’;

BACKUP FOR TRANSPORT ALLOW INCONSISTENT INCREMENTAL LEVEL 1 TABLESPACE TBS1 FORMAT '/tmp/TBS1_level1.bck’;

BACKUP FOR TRANSPORT INCREMENTAL LEVEL 1 TABLESPACE TBS1 FORMAT '/tmp/TBS1_Finallevel1.bck’ DATAPUMP FORMAT ‘/tmp/dp.dmp’;

RESTORE FROM PLATFORM 'Solaris[tm] OE (64-bit)’ FOREIGN DATAFILE 6 FORMAT '/tmp/aux/mytbs_1.df’, FROM BACKUPSET ’/tmp/TBS1_level0.bck';

RECOVER FROM PLATFORM 'Solaris[tm] OE (64-bit)’ FOREIGN DATAFILECOPY '/tmp/aux/mytbs_1.df’ FROM BACKUPSET '/tmp/TBS1_level1.bck';

RESTORE FROM PLATFORM 'Solaris[tm] OE (64-bit)’ DUMP FILE ‘/tmp/dp.dmp’ DATAPUMP DESTINATION ‘/tmp/dump’ FROM BACKUPSET ‘/tmp/TBS1_Finallevel1.bck’;

CREATE DIRECTORY create DP_DIR IMPDB DIRECTORY=DP_DIR DUMPFILE=/tmp/dp.dmp TRANSPORT DATAFILES = ‘/tmp/aux/mytbs_1.df’ NOLOGFILE=Y;

ALTER TABLESPACE TBS1 READ WRITE;

Source Platform Destination Platform

* Repeat the procedure until the cut-over time

Real World Cross Platform Migration Using Oracle 12c RMAN

Rao S. Kasinadhuni Senior Oracle DBA, Vice President J.P. Morgan, AM Infrastructure October 29, 2015

Source Environment

• Colorado Data Center

• 10+ Oracle Databases

• 11gR1 and 11gR2 • HP-UX RISC Platform

• Stand-alone (non-RAC)

• Database Sizes range from 12 TB to 30 TB

Destination Environment

• Atlanta Data Center

• Oracle Enterprise Linux 6.x Platform

• Oracle 12.1.0.2

• Oracle RAC

13

Challenges & Solution

• Challenges – Migration across data

centers (~800 miles) – Migration across platforms – Migration across versions

• Solution – Use Staging Servers at

Destination – Use Active Data Guard

between Data Centers – Use Cross-Platform

migration (MOS 1389592.1 )

Databases Migration Project

Cross Platform Migration

14

Topology through Big Picture

Step 1: Synchronize Data Between Data Centers

• Build Staging Server at the Destination Data center (Atlanta) – Same OS HP-UX but Different Processor Architecture

• Staging Host: IA-64 based with HP-UX

• Create Physical Standby on Staging Host – Performed RMAN Hot backup from source database – Shipped the storage media to the destination – Restore Media on the staging host

• Keep Synchronizing Physical Standby using Active Data Guard

15

Staging using Active Data Guard

Step 2: Cross-Platform Transport

• Destination Servers: Linux / X86 Blade

• One time Level 0 Backup – Take Initial Level 0 backup from Staging Server (which is a

Standby Server) – Use NFS mount point for backups – Restore Backups at Destination RAC Server

• Repeated Incremental Level 1 Backups – Keep taking Incremental (L1) Backups on Staging – Keep Restoring Incremental (L1) Backups at Destination

16

Data Migration Between Staging & Destination Server

Step 3: Cutting Over to Destination Database

• Ensure Physical standby (Staging) Synchronized to Last Archive log

• Shutdown Source (Production) database

• Final Incremental Backup (L1) – Physical standby is already in read-only mode – Take final incremental L1 backup – Restore the last L1 at Destination

• Meta Data Plug-in – Export Meta Data from the Stage Server – Import Meta data into Destination database

• Open Destination database

17

Final Plug-In Procedure on the Cut-Off Day

Observation, Best Practices & Future Plans • Very smooth & efficient migration completed using Oracle supplied Cross-Platform

Scripts (MOS 1389592.1)

• Performed multiple incremental backups to keep the destination server data as close to production

• Use Multi-Section Incremental Backups

• Use NFS (SAN based) mounted file system for cross-platform migration between staging & destination servers – Avoids additional steps required to copy backups between servrs

• Future Plans – Implement backup & recovery procedures using RMAN 12c capabilities – Identify and Migrate other HP-UX databases to future Oracle version using 12c enhancements

18

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Program Agenda

Recovery Manager New Features in 12c

J.P.Morgan – Cross Platform Migration: Real World Use Case

New Backup Solutions using RMAN

Flashback Technologies in 12c

Oracle Secure Backup 12.1

Maximum Availability Architecture

1

2

3

4

5

19

6

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Zero Data Loss Recovery Appliance

Delta Push • DBs access and send only changes

• Minimal impact on production • Real-time redo transport instantly

protects ongoing transactions

Protected Databases

Protects all DBs in Data Center • Petabytes of data • Oracle 10.2-12c, any platform • No expensive DB backup agents

Delta Store • Stores validated, compressed DB changes on disk • Fast restores to any point-in-time using deltas • Built on Exadata scaling and resilience • Enterprise Manager end-to-end control

Recovery Appliance

Replicates to Remote Recovery Appliance

Offloads Tape Backup

20

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Database Backup Cloud Service Low Cost Offsite Cloud Storage for Oracle Database Backups

Instant Offsite Storage

Cost Effective

On-demand Scalability

End-to-End Security

RMAN Encryption

RMAN Compression

3-Way Protection

24x7 Data Availability

Oracle Database Backup Cloud Service

Oracle DBaaS / Exadata Cloud Service

On-Premises Databases 10.2 and above

https://cloud.oracle.com/database_backup

Platform as a Service

21

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Program Agenda

Recovery Manager New Features in 12c & 12cR2

J.P.Morgan – Cross Platform Migration: Real World Use Case

New Backup Solutions using RMAN

Flashback Technologies in 12c

Oracle Secure Backup 12.1

Maximum Availability Architecture

1

2

3

4

5

22

6

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Flashback Technologies to Protect from Logical Errors

Old Data Lookup for Query & Investigation using FLASHBACK QUERIES

Rewind one or more Tables using FLASHBACK TABLE

Retrieve dropped objects using FLASHBACK DROP

Continuous Data Protection for the entire Database with FLASHBACK DATABASE

23

https://oracle.com/goto/flashback

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Flashback Database for Continuous Data Protection • Flashback Database rewinds the entire database to an older PIT

using Flashback logs in FRA. Protection from Logical Failures. – Normal Restore Point: Do not preserve Flashback logs in FRA

• Flashback Database succeeds only when enough Flashback logs are available.

– Guaranteed Restore Point: Preserves Flashback logs in FRA • Can be used during Batch updates, testing environments etc. • Implicitly used by Data Guard Snapshot Standby.

• In Oracle Database 12c Release 1, Flashback Database capabilities are supported at the Container Database (CDB) level with all PDBs are flashed back together

• For PDB level PITR, perform RMAN restore & recovery

• Note: Cannot perform CDB level Flashback after a PDB PITR

24

CDB/PDBs @ t1 (test_grp)

PDBs @ t2

FLASHBACK to test_grp

ALTER SESSION SET CONTAINER = ROOT; CREATE RESTORE POINT test_grp GUARANTEE FLASHBACK DATABASE; FLASHBACK DATABASE TO test_grp;

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Program Agenda

Recovery Manager New Features in 12c

J.P.Morgan – Cross Platform Migration: Real World Use Case

New Backup Solutions using RMAN

Flashback Technologies Technologies in 12c

Oracle Secure Backup 12.1

Maximum Availability Architecture

1

2

3

4

5

25

6

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Secure Backup – Centralized Backup Management • Oracle Secure Backup (OSB) is an Enterprise Data

Protection solution with tight integration with RMAN

• OSB 12.1 now supports Disk Backups

• Disk / Tape Management – Oracle Database 10g to 12c with RMAN integration – MySQL Enterprise Edition – Heterogeneous file systems (UNIX/ Linux / Windows)

and NAS devices

• Centralized management in distributed environments

• RMAN optimization (unused blocks, UNDO compression, optimized buffer allocation)

26

Oracle EM Cloud

Disk Storage Tape Library

Media Manager

Admin Server

Clients – Unix / Linux/ Windows / NAS

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Program Agenda

Recovery Manager New Features in 12c

J.P.Morgan – Cross Platform Migration: Real World Use Case

New Backup Solutions using RMAN

Flashback Technologies in 12c

Oracle Secure Backup 12.1

Maximum Availability Architecture

1

2

3

4

5

27

6

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Oracle Data Protection Technologies Recovery Point & Time Objectives

Technology Protection

Against Type of Failure

Downtime Recovery Time Objective ,

RTO

Data Loss Exposure Recovery Point Objective , RPO

Oracle Secure Backup Physical Hours/Days Days/Hours

(from last backup)

Recovery Manager (RMAN) Physical Hours/Days Hours (from last backup)

Flashback Technologies Logical Minutes/Hours Minutes/Hours

(from point-in-time)

(Active) Data Guard Site Failure / DR Seconds/Minutes Zero/Seconds

28

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Edition-based Redefinition, Online Redefinition, Data Guard, GoldenGate – Minimal downtime maintenance, upgrades, migrations

Active Data Guard – Data Protection, DR – Query Offload GoldenGate – Active-active replication – Heterogeneous

Active Replica

RMAN, Oracle Secure Backup, Zero Data Loss Recovery Appliance

– Backup to disk, tape or cloud

Enterprise Manager Cloud Control – Site Guard, Coordinated Site Failover Application Continuity – Application HA Global Data Services – Service Failover / Load Balancing

RAC – Scalability – Server HA ASM – Local storage

protection

Production Site

Flashback – Human error

correction

Oracle Maximum Availability Architecture (MAA)

29

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. |

Reference • http://www.oracle.com/goto/rman • http://www.oracle.com/goto/flashback • http://www.oracle.com/goto/ha • http://www.oracle.com/goto/maa • Master RMAN Note (Doc ID 1116484.1) Social

– http://blog.oracle.com/maa – Follow us @OracleMAA

30

[email protected]

Copyright © 2015, Oracle and/or its affiliates. All rights reserved. 31