New Cloning Features Available in Oracle 11g R2 John ... - DBAK

23
New Cloning Features Available in Oracle 11g R2 John Darrah RMOUG Training Days February 11-13, 2013

Transcript of New Cloning Features Available in Oracle 11g R2 John ... - DBAK

New Cloning Features Available in Oracle 11g R2

John Darrah

RMOUG Training DaysFebruary 11-13, 2013

©  DBAK 2013 2

About DBAKOracle Database, Technology and E-Business Suite applicationsCo-founded in 2005Colorado owned and operatedAverage 15 Years of Oracle Expertise Awards• “Top 250 Private Companies, 2011 and 2012” ” – CoBIZ Magazine • “Fastest-Growing Private Companies” – 2012 Finalist, Denver Business Journal• “Colorado Companies to Watch” – 2012 Finalist, Colorado Office of Economic

Development and International Trade• “Emerging Business of the Year, 2008” – South Metro Denver Chamber of Commerce

100+ Clients200+ Implementations, Upgrades, Conversions, Support ProjectsOracle Gold Partner• Oracle Accelerate Solution – Hosted Financials• “Specialized”

- Oracle Database- Oracle Enterprise Manager

AgendaTypes of Database ClonesReasons for CloningChallengesCloning enhancements in 11gActive DataGuardSnapshot StandbyClonedbEdition Based Redefinition

© DBAK 2013 3

© DBAK 2013 4

Types of Database ClonesFull Copy Clone• The source database is copied• The copy is restored to a new environment• The copied database is opened for use• RMAN Duplicate is an example of a Full Copy Clone

Delta Clone• A baseline of the database is created• The baseline and special files containing deltas are used

together to display database content Code Only Clone• Only VIEWS, TRIGGERS, and PL/SQL Objects are cloned

© DBAK 2013 5

Reasons for cloningReporting environments• Many reporting tools require read / write access to the

databaseDevelopment Environments• Developers want and sometimes require fresh data for

effective unit testing

QA environments• Effective integration and performance testing require recent

copies of production data

Environment Management• Test build scripts against production data

© DBAK 2013 6

Challenges with environment cloningCloning can be time consuming and expensive• Large databases take a long

time to duplicate• Enterprise Disk is expensive

– Enterprise Class Storage != Best Buy Hard drive

– Justifying the disk budget for a full development copy can be difficult.

© DBAK 2013 7

Challenges with environment cloningDifferent teams have different development requirements• Development, QA, Reporting, and Environment

Management all have different needs requiring environments.

– If multiple development projects run concurrently there is a need for even more environments

Development Requirements …

QA Requirements …

Reporting Requirements …

Environment Management Requirements …

© DBAK 2013 8

Cloning enhancements available in 11gThree new ways to create a clone environment in 11g• Full Copy Clone

– Active Data Guard– Snapshot Standby

• Delta Clone– Direct NFS and clonedb

• Code Only Clone– Edition Based Redefinition

© DBAK 2013 9

Active Data Guard, What it isA physical Standby database that can be Queried while being recovered• Read only• Requires an additional license (Active Data Guard)• Great for report offload

Active Data Guard has other benefits• Automatic Block Repair• Fast Incremental Backups

Best used for leveraging existing DR instances• ODS• Reporting Environment• Backup Offload

© DBAK 2013 10

Active Data Guard, How it worksExtends Oracle’s standard CR technology

• No ‘dirty reads’ for queries on the standby• Repeatable Reads available• Data Dictionary Caches are kept up to date• In short ACID properties not compromised• Query guaranteed to return the same result it would have returned on the

primary at a given SCN

10

© DBAK 2013 11

Active Data Guard Use CasesActive Data Guard is good choice for• Reporting databases• Read only applications• Leveraging existing DR investment without comprising

RTO / RPO SLAsActive Data Guard is not a good choice for• Reporting Environments that require writes• Development Environments (obviously)• Reporting Environments that need a static data set

11

© DBAK 2013 12

Snapshot Standby What it isA set of commands to change a physical standby database into a read write database and back again• Does not require additional licenses beyond EE for

standby environment• Database is read write• Recovery is stopped while database is open• Technology to create Flashback standby is available in

10g– 11g automates the process via DGMGRL or OEM

12

© DBAK 2013 13

Snapshot Standby, How it WorksLeverages Flashback database• Guaranteed Restore Point created• Database Opened Read Write• Archive Logs continue to ship but are not applied• To re-instantiate standby:

– Flashback to restore point– ALTER DATABASE CONVERT TO PHYSICAL

STANDBY;– Resume Archive Log application

• Snapshot Standby databases can be refreshed from incremental backups as well as Archive Logs

13

© DBAK 2013 14

Snapshot Standby Use CasesSnapshot Standby is good for:• Reporting environments that require DML/DDL access

– Discoverer– Micro Strategies

• Reporting environments that need a consistent and static data set

– All reports assume data as of midnight Snapshot standby should not be used if:• Opening the database jeopardizes the RTO SLA for the

environment– Flashback can take a long time– Log application can take a long time

14

© DBAK 2013 15

DNFS Clonedb; what it is A sparsely documented new feature available as of 11.2.0.2• Requires Oracle Direct NFS• Uses a Datafile copy for its base data set• Creates separate delta datafiles to hold block changes• Uses Copy on Write (COW) to write changes to the

delta files instead of the base backup files• Metalink Note: 1210656.1 is the only Oracle

documentation I have found on this feature

15

© DBAK 2013 16

Clonedb; How it worksClonedb leverages Oracle Direct NFS• Datafile copies are placed on disk accessible to the

server where the clone will be created (local,SAN,NFS,DNFS)

• A mount that supports Direct NFS is used to hold changes to blocks

• Changes are stored in sparse files. Bitmaps in the files show what blocks live where

• Oracle uses Copy on Write to write changes to the delta files instead of the base

• Oracle silently merges the base with the changes in the delta files during queries.

16

© DBAK 2013 17

Clonedb; usesClonedb is good for:• Providing one or more non production environments

from a single set of backup datafiles• Creating an environment to test build scripts for

releases• Leveraging existing backups for non produciton

environmentsClonedb is not ideal for:• Performance testing*• Environments that do not use NAS storage

17

© DBAK 2013 18

Edition Based Redifinion; what it isAn 11g feature that allows several versions of the same code to exist in the same schema• A new level of granularity:

– Schema» Object Name

– Edition• Stored code can have several versions

– Ora$base» R2

– R3

18

© DBAK 2013 19

Edition Based Redefinition; how it worksEBR gives a new level of granularity for certain objects• Views, Stored PL/SQL objects, Types, and Synonyms

are all editionable• Tables and Materialized Views are not• Two new objects are used with EBR

– Editioning Views– Cross Edition Triggers

• Editioning Views and Cross Edition Triggers compensate for object types that are not editionable

19

© DBAK 2013 20

Edition Based Redefinition; Use CasesEBR is good for:• Hot Code Upgrades in production• Providing a quick fallback to prior code base• Multiple development environments using the same

data but different versions of editionable objects• Beta version of code in production

EBR is not:• EBR is not a true clone• The underlying data is shared amongst all editions

20

© DBAK 2013 21

Demos Active Data GuardSnapshot standbyClonedbEdition Based Redefinition

21

Questions?

22© DBAK 2013

23© DBAK 2013

Contact

John Darrah

720.475-8600 [email protected]

www.dbak.com