Back

Oracle Clone Tutorial: How to Clone a Large Oracle Database, Really, Really Fast!

Oracle Clone Tutorial

Take the pain out of cloning! Take the time out of cloning!

Learn how to duplicate (copy) an Oracle database in minutes – no matter how large – with Oracle DNFS.

Do you need to provide read-write clone databases for testing or development? Do you need to do it fast, simply, and with minimal disc space? This free Oracle Database Clone Tutorial will show you how.

Cloning databases can be slow, painful, and requires lots of disc space. Not any more. We can use copy-on-write technology to create as many independent clones as you want, all based on one backup of the source database. Creating a clone takes minutes, no matter how big the database is. The space used by each clone is only the space needed to record changes made within the clone (so initially, zero.) As far as your users are concerned, each clone is an independent database. They will have no idea that they are all sharing a common source.

This facility (based on Oracle’s Direct NFS technology) was introduced in release 11.2.0.2 and formally documented in 12.1.x.

Presented by Oracle Certified Master John Watson, SkillBuilders’ Director of Oracle Database Services.

This free tutorial is segmented into several separate lessons:

  1. Introduction to John Watson, SkillBuilders Director of Oracle Database Services (1:32)
  2. Agenda (1:19)
  3. Clones, Clones and More Clones. Too Many Clones? (6:19)
    John explains the reasons for creating clones and demonstrates DBMS_WM, the Oracle supplied Workspace Manager package, in the hopes of demonstrating a technique for creating *less clones*.
  4. Cloning the Old Way (1:36)
    John explains the three traditional cloning techniques: manual scripting, Data Guard and RMAN.
  5. Cloning Issues and Sample Script (3:41)
    John demonstrates (examples) cloning via a script we wrote to clone databases daily.
  6. Introducing DNFS Copy on Update to Clone (8:16)
    John explains a new technique for cloning : using Direct Network File System (DNFS) Copy-on-Update
  7. DNFS Cloning Technique and Demonstration (19:06)
    John demonstrates (examples) the new technique for cloning : using Direct Network File System (DNFS) Copy-on-Update
  8. Demo Creating Additional Clones ( In 2 Minutes! ) (3:40) (click on video below)
    In 2 minutes and 11 seconds, John demonstrates creating an additional clone – of any size!
  9. Review Technique and Limitations (3:23)

Date: Aug 14, 2013


NOTE: Some corporate firewalls will not allow videos hosted by YouTube.

Transcript

Demo Creating Additional Clones ( In 2 Minutes! )

Lightning Fast Cloning

 

Session 8 – Demo Creating Additional Clones (In 2 Min.)

 

[music]

 

>> John:  The way it gets really good is the ability to create multiple clones running off the same database. Multiple clones off the same database. And this should show us how fast it really can be.

 

[pause]

 

What I shall try to do is create a second clone. I really should put a stopwatch on and see how long it actually takes. First off, create a directory in which the clone will live, clonedb/clone2. Then I’ll set those four critical environment variables – master copy dir, pointing the same as before. Clone file create test, pointing to my new directory. Clonedb_name ¿ that looks like a typing error in there. Clonedb_name = clone2.

 

[pause]

 

Oracle sid = clone2. I’ve just set the variables for creating a second clone. Then I run the magic file script that will generate the parameter file and the clone creation scripts. So perl cloned.pl, pointing towards the existing long-term storage copy of the parameter file and that will regenerate it. Crtdb and renamedb. So run them again.

 

[pause]

 

sqlplus / as sysdba

 

[pause]

 

And create a second clone.

 

[pause]

 

I ran out of memory on this machine. Using the clone to shut down one of the other clones first.

[pause]

 

Terminate that. That’s not a problem with cloning, it’s the problem with the capacity of this machine. So if I kill off my original Oracle SID database and then we’ll try again.

 

[pause]

 

Now that’s looking a bit better.

 

[pause]

 

Control file created and then we run the script that renames the data files. Done. Open reset logs. And at that point you should have in my clone2 directory, those are the copies, ls – lsh, which of course are taking a minimal amount of disk space. And that’s it. Clone2 is created.

 

[pause]

 

Set style from all users. I hope you’ll agree with me when I say that being able to clone and that could literally be a multi terabyte database. But in effect, I cloned a multi terabyte database in probably about three or four minutes.

 

>> Dave:  Two minutes and 11 seconds.

 

>> John:  Thank you Dave. Including the fact that I have to terminate another instance halfway through. Okay. Two minutes to clone a database. That’s not bad going and the space used is only a few kilobytes for each file.

 

Copyright SkillBuilders.com 2017

×
Free Online Registration Required

The tutorial session you want to view requires your registering with us.

It’s fast and easy, and totally FREE.

And best of all, once you are registered, you’ll also have access to all the other 100’s of FREE Video Tutorials we offer!

 

×
Podcast
×