Pluggable DB Snapshot

Cloning a database.Very simple to say, massive business value and can be on of the hardest things to do. Let’s quickly review some of the ways to clone a database.

Method Pros Cons
RMAN Not Complex
Error Free
Somewhat Fast
Cross Storage
Only DBA Skills
Initial Setup Can Be Painful
Slow backup devices
DataPump Cross Platform
Partial Clones
Cross Storage
Only DBA Skills
Slow
Error Prone
SAN Clone Fast
Simple
DBA and SAN Skills
Extra SAN License
Storage Vendor Lock In

With Oracle Database 12c there is a new method that combines most of the strengths of SAN cloning with only needing a DBA. If you have a PDB that you need to clone and the clone PDB will be in the same CDB you can use a new snapshot clone feature. There a few requirements

    The cloned PDB and source PDB must be in the same CDB
    The storage must be ACFS, ZFS Storage Appliance or NetApp
    The source PDB can’t be deleted as long as the cloned PDB is present

The source PDB must be in read only mode

For this example we are going to use ACFS. First we confirm there are zero ACFS snapshots.

# acfsutil snap info /u01/acfsmounts/data_vol1/
    number of snapshots:  0
    snapshot space usage: 0

Then we can run the create pluggable database command using the snapshot copy command. The path_prefix specifies where the new PDB data files will be stored.

SQL> create pluggable database oltpdev2 from oltpdev1 snapshot copy path_prefix = '/u01/acfsmounts/data_vol1/MYCON/';

Pluggable database created.

Next we can confirm a snapshot has been created. Then we can open the new cloned PDB.

# acfsutil snap info /u01/acfsmounts/data_vol1/
snapshot name:               E2741E022F0469AAE0432902A8C0C382
RO snapshot or RW snapshot:  RW
parent name:                 /u01/acfsmounts/data_vol1/
snapshot creation time:      Fri Jul 26 20:12:51 2013

    number of snapshots:  1
    snapshot space usage: 135536640

SQL> alter pluggable database oltpdev2 open;

Pluggable database altered.

In less than 60 seconds we have a clone of our PDB ready. After we are done with the clone we can drop the PDB and see the ACFS snap go as well.


SQL> drop pluggable database oltpdev2 including datafiles;

Pluggable database dropped.

# acfsutil snap info /u01/acfsmounts/data_vol1/
    number of snapshots:  0 (active)
                          1 (delete pending)
    snapshot space usage: 155922432

The PDB has been deleted and ACFS is in the process of cleaning up the snap.

5 thoughts on “Pluggable DB Snapshot

  1. Hi ,
    I am facing issue while Creating pluggable database using snapshot copy.
    ORA-12805: Parallel Query died unexpectedly

    I am using RHEL 6.2 , 64 bit ,4CPU,12 G.B standalone box.
    Can you please share the complete installation Document and also let me parallel parameters too.
    Thank you very much for your time.
    Thanks,
    Ramesh

    • I am using OL 6.4 64 bit. 8GB 2 CPUs. The parallel settings are all default. Look in your alert log and it should have a location to a trace if one was created.

  2. Hi. You wrote: “The storage must be ACFS, ZFS Storage Appliance or NetApp”. Do you know that the copy-on-write (snapshot copy) technology can be used within local filesystem, for example EXT4?

    • You are correct, there has been a few changes since the post was made. Another change is EMC is also supported now as well as Exadata. Ext4 is support but the major difference between using ACFS and Ext4 is the parent or source PDB must remain in read only mode when using Ext4 since the clonedb is providing the snapshot. With ACFS,Netpp etc the parent or source can remain in read/write mode.

Leave a comment