Clonedb: The quick and easy cloning solution you never knew you had.

Slides:



Advertisements
Similar presentations
2 Copyright © 2005, Oracle. All rights reserved. Installing the Oracle Database Software.
Advertisements

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
ITEC474 Control File Maintenance
1 Chapter 15 Duplicating Databases and Transporting Data.
1 Getting The Most Out of RMAN By: Charles Pfeiffer CIO, Remote Control DBA (888)
Backup The flip side of recovery. Types of Failures Transaction failure –Transaction must be aborted System failure –Hardware or software problem resulting.
5 Copyright © 2006, Oracle. All rights reserved. Database Recovery.
Database Backup and Recovery
INTRODUCTION TO ORACLE Lynnwood Brown President System Managers LLC Data Loading & Backup And Recovery Lecture 5 Copyright System Managers LLC 2003 all.
RMAN Restore and Recovery
Backup and Recovery Part 1.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
CHAPTER 16 User-Managed Backup and Recovery. Introduction to User Managed Backup and Recovery Backup and recover is one of the most critical skills a.
4 Copyright © 2008, Oracle. All rights reserved. Configuring Backup Specifications.
Chapter 5 Configuring the RMAN Environment. Objectives Show command to see existing settings Configure command to change settings Backing up the controlfile.
CHAPTER 5 Managing Control Files, Online Redo Logs, and Archiving.
9 Copyright © Oracle Corporation, All rights reserved. Oracle Recovery Manager Overview and Configuration.
CHAPTER 17 Configuring RMAN. Introduction to RMAN RMAN was introduced in Oracle 8.0. RMAN is Oracle’s tool for backup and recovery. RMAN is much more.
The Oracle Recovery Manager (RMAN)
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
CHAPTER 18 RMAN Backups and Reporting. Introduction to RMAN Backups and Reporting The focus of this chapter is backups of: Datafiles Control files Archived.
Agenda  Overview  Configuring the database for basic Backup and Recovery  Backing up your database  Restore and Recovery Operations  Managing your.
Oracle backup and recovery strategy
Introduction to Oracle Backup and Recovery
Using RMAN to Perform Recovery
Oracle Database Administration
Clonedb: The quick and easy cloning solution you never knew you had. Tim Hall Oracle ACE Director Oracle ACE of the Year 2006.
13 Copyright © Oracle Corporation, All rights reserved. RMAN Complete Recovery.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Recovery Manager Overview Target Database Recovery Catalog Database Enterprise Manager Recovery Manager (RMAN) Media Options Server Session.
5 Copyright © 2008, Oracle. All rights reserved. Using RMAN to Create Backups.
Chapter 7 Making Backups with RMAN. Objectives Explain backup sets and image copies RMAN Backup modes’ Types of files backed up Backup destinations Specifying.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
11 Copyright © Oracle Corporation, All rights reserved. RMAN Backups.
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
15 Copyright © 2005, Oracle. All rights reserved. Performing Database Backups.
11g(R1/R2) Data guard Enhancements Suresh Gandhi
RMAN: Your New Best Friend for Backup and Recovery Ruth Gramolini ORACLE DBA Vermont Department of Taxes.
9 Copyright © 2004, Oracle. All rights reserved. Flashback Database.
CHAPTER 5 Managing Control Files and Online Redo Logs.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
17 Copyright © Oracle Corporation, All rights reserved. Recovery Catalog Creation and Maintenance.
Chapter 8Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 8 Complete Recovery with Recovery Manager.
15 Copyright © Oracle Corporation, All rights reserved. RMAN Incomplete Recovery.
Database Storage Structures
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Week 2 Lecture 1 Creating an Oracle Instance. Learning Objectives  Learn the steps for creating a database  Understand the prerequisites for creating.
3 Copyright © 2006, Oracle. All rights reserved. Using Recovery Manager.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
Overview of Oracle Backup and Recovery Darl Kuhn, Regis University.
Oracle Applications 11i Concepts II Brian Hitchcock OCP 11i DBA -- OCP 10g DBA Sun Microsystems Brian Hitchcock.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
2 Copyright © 2007, Oracle. All rights reserved. Configuring for Recoverability.
2 Copyright © 2006, Oracle. All rights reserved. Configuring Recovery Manager.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
19 Copyright © 2004, Oracle. All rights reserved. Database Backups.
9 Copyright © 2004, Oracle. All rights reserved. Incomplete Recovery.
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
Oracle 10g Administration Database Architecture, Creation and Interfaces Copyright ©2006, Custom Training Institute.
Sharing experience on RMAN backups ...
You Inherited a Database Now What?
Performing Database Backups
The powerhouse PL/SQL upgrade option: Edition-Based Redefinition (EBR)
Duplicating a Database
You Inherited a Database Now What?
Performing Database Recovery
Presentation transcript:

Clonedb: The quick and easy cloning solution you never knew you had. Tim Hall Oracle ACE Director Oracle ACE of the Year 2006 OakTable Network OCP DBA (7, 8, 8i, 9i, 10g, 11g) OCP Advanced PL/SQL Developer Oracle Database: SQL Certified Expert http://www.oracle-base.com Books Oracle PL/SQL Tuning Oracle Job Scheduling http://www.oracle-base.com

Clonedb: The quick and easy cloning solution you never knew you had. What is a clone? Why clone databases? How do we clone databases? What is Clonedb? Demo of Clonedb Considerations http://www.oracle-base.com

What is a Clone? An exact copy of the original. http://www.oracle-base.com

Why Clone Databases? Set up new databases as copies of existing ones. Data refresh for development and test environments from production. Test backup & recovery. Create standby databases. Recover lost data or objects (where flashback is not appropriate). http://www.oracle-base.com

How do we Clone Databases? There are already several methods for cloning databases including: Manually copy files and recreate the database. RMAN DUPLICATE - active database (11g). RMAN DUPLICATE - backup. 3rd Party solutions. All require copying or restoring files to new location requiring: Additional disk space. Time to perform the copy. Clonedb makes cloning quicker and saves space. http://www.oracle-base.com

What is Clonedb? In 11.1 Oracle added the Direct NFS Client to the database. The 11.2.0.2 patch set introduced Clonedb functionality, built on top of Direct NFS. Clonedb uses Copy-On-Write (COW) technology for clones. http://www.oracle-base.com

Copy-On-Write (COW) NFS C.O.W. Files Clone Database Datafile Image Copies NFS C.O.W. Files Clone Database Clones use read-only image copies of datafiles as source. Only modified blocks are written to NFS location. http://www.oracle-base.com

What is Clonedb? (continued) Clonedb saves space when you have multiple clones as they can all reference the same source files. One-time server setup, then repeated cloning is super-quick. Only documented in My Oracle Support (MOS) Note 1210656.1 http://www.oracle-base.com

Demo (cleanup.sql) http://www.oracle-base.com

NFS Server Setup Create a directory to hold the copy-on-write files. # mkdir -p /u01/nfs-share Append the share into the “/etc/exports” file. /u01/nfs-share *(rw,sync,no_wdelay,insecure, insecure_locks,no_root_squash) Make sure the NFS service is turned on. # chkconfig nfs on # service nfs restart http://www.oracle-base.com

Production Backup Make an image copy backup of the database. The copy can be placed on a share (CIFS/NFS) or copied to the local file system of the server running the clone. configure controlfile autobackup off; sql 'alter database begin backup'; run { set nocfau; backup as copy database format ’/u01/backups/prod/%U’; } sql 'alter database end backup'; (backup.sh) http://www.oracle-base.com

Copy Production PFILE Take a copy of the production PFILE by running the following command as the SYS user. (create_pfile.sh) CREATE PFILE='/u01/backups/prod/initTEST.ora' FROM SPFILE; Edit the PFILE, changing all references to the original SID and database name. http://www.oracle-base.com

Clonedb Server Setup Turn on Direct NFS for the ORACLE_HOME on the clonedb server. (dnfs.sh) $ cd $ORACLE_HOME/rdbms/lib $ make -f ins_rdbms.mk dnfs_on Make the necessary directories for the NFS mount and to support the instance. (directories.sh) http://www.oracle-base.com

NFS Mount Add the NFS mount to the “/etc/fstab” file, along with any other necessary shares. nas1:/u01/nfs-share /u01/copy-on-write nfs rw,bg,hard,nointr,tcp,vers=3,timeo=600, rsize=32768,wsize=32768,actimeo=0 0 0 Mount the copy-on-write location. # mount /u01/copy-on-write http://www.oracle-base.com

Clone the database Set the required environment variables and run the “clone.pl” script. (create_clone_script.sh) Review the contents of the generated files. Run the files to create the clone. (create_clone.sh) http://www.oracle-base.com

Clone the database If you did hot backup you may need to recover database. SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL; SQL> ALTER DATABASE OPEN RESETLOGS; Make sure the TEMP tablespace has been handled properly. (manage_temp.sql) Check the database. (datafiles.sql) http://www.oracle-base.com

Considerations - Performance Copy-On-Write location is NFS. Is that an issue for you? If a cloned database is to be used for performance testing, do you really want a different storage technology in the mix? Possible performance improvements on the horizon? http://www.oracle-base.com

Considerations - Space Savings Over time more changed blocks will be written to NFS location, so space savings will reduce. Only works with image copies. If you don’t use image copy backups how much space are you really saving? http://www.oracle-base.com

Considerations - Others Very little documentation. Very new. http://www.oracle-base.com

Where would I use it? For short-lived clones used for functional, not performance testing. To test backups. To recover lost objects. http://www.oracle-base.com

Where would I NOT use it? Setting up long-term clones. For clones used for performance testing. For setting up a standby database. http://www.oracle-base.com

Summary Very quick cloning. Potential for big space savings. Need to be on at least 11.2.0.2. Need to use NFS for COW location. http://www.oracle-base.com

The End… Download slides and example code at: http://www.oracle-base.com/workshops Article: http://www.oracle-base.com/articles/11g/Clonedb_11gR2.php http://www.oracle-base.com