Académique Documents
Professionnel Documents
Culture Documents
April 2014
Executive Overview
The growing volume of data and the cost associated with storing, managing and provisioning
this data is an increasing concern in IT management today. IDC cites managing storage
growth as the biggest pain point for IT managers and estimates exponential growth in
capacity-optimized storage for 2013-20161. A significant portion of that data growth is
attributed to copy data - copies of production data used for application development, testing,
reporting, compliance, analytics and multi-user access.
Oracle Multitenant in-database virtualization is an innovative consolidation solution for the
Oracle RDBMS. Multiple pluggable databases are fully functional Oracle databases hosted in
a container root database which provides database infrastructure for shared database
operations. Oracle Multitenant works seamlessly with the Oracle Cloud File System (Oracle
CloudFS is the 'umbrella' suite of ASM storage features and products) to provide a highly
scalable, capacity-optimized database storage management solution. Leveraging copy-on-write
storage technology, Oracle Multitenant pluggable databases are provisioned in seconds,
an operation that would normally take days to weeks to complete.
The integration of Oracle CloudFS and Oracle Multitenant allows database administrators to
rapidly provision databases using a simple SQL command, thus eliminating the over-head
currently required for these tasks. Application development teams for the respective lines of
business are now empowered to provision and manage their own databases, independent
from the production environment and from each other. Using the free Oracle Multitenant
Self-Service provisioning application, database administrators, developers and
analytics engineers can quickly provision new databases and/or database clones at
the click of a button. This empowers lines of business to be more responsive and innovative
in application development by provisioning and managing their own development data sets.
This paper describes the advantages of Oracle Multitenant snapshot cloning using Oracle
CloudFS, and offers a brief description of the Oracle Multitenant architecture, Oracle
CloudFS architecture and a step-by-step walk through of pluggable database thin provisioning
using snapshot cloning. This illustrates the complete integration of the two technologies,
which together offer:
a cost-effective storage and consolidation solution
a fully integrated, agile data management solution
a self-service database provisioning environment
The copy data phenomenon was described in a blog by Ashish Nadkarni, IDC, June 7, 2013. It has been
discussed before and after by various other storage blogs and online IT trade journals.
1
Figure 1.
Each PDB is a self-contained database with schemas, objects, roles, privileges, and metadata
stored in the PDBs system, sysaux and user tablespaces. Each PDB has its own set of data
files independent of other containers in the CDB. This distinction allows for agile data
mobility and management through PDB unplug/plug operations and rapid, thin provisioning
of PDBs through snapshot clones.
The new architecture that allows for this level of segregation, PDB data and metadata
segregation from Oracle metadata, may be thought of as in-database virtualization. Oracle
Multitenant features a horizontally partitioned data dictionary (see figure 2). Oracle database
metadata is stored in the Root metadata dictionary and user data and metadata is stored in the
For a complete description of Oracle Database 12c and Multitenant and the returns on CAPEX/OPEX, please see
http://oracle.com/goto/multitenant.
2
PDBs metadata dictionary. User metadata dependencies on Oracle metadata are resolved
through metadata and object reference links.
Figure 2. Horizontally partitioned Data Dictionary segregating user data/metadata from Oracle
metadata with dependencies resolved through metadata and object reference links
It is this level of segregated data and metadata that allows for independent snapshot copies of
a PDB distinct from the host container (CDB).
ADVM provides common volume management services and a standard device driver
interface for system administrators to manage volumes across different platforms. A device
file is created automatically when a volume is created in an ASM disk group. This allows ASM
Cluster File System (ACFS) and 3rd party file systems to use this device interface to create
and manage file systems on ADVM Dynamic Volumes.
Oracle ASM Cluster File System (ACFS)
Oracle ACFS is a general-purpose POSIX, X/OPEN and Windows compliant file system
designed for single node and cluster configurations. Oracle ACFS is managed using native
operating system commands as well as the Oracle ACFS command line tool, acfsutil. Oracle
ACFS is also fully integrated with Oracle Enterprise Manager Cloud Control. ACFS supports
Figure 3. Oracle CloudFS components and Multitenant storage options for ASM or ACFS3
As shown in Figure 3, when using ASM, database files for the various containers in a
multitenant configuration (CDB$Root and the various PDBs) can be stored in ASM or, when
configured, ACFS. For snapshot cloning of PDBs, only ACFS is supported.4
In the following step-by-step exercise, the CDB is stored in ASM and the snapshot clones are stored in ACFS.
Oracle Multitenant supports snapshot copy provisioning on ACFS, ZFSSA and NetApp. This paper focuses
solely on ACFS support.
3
4
An Oracle ACFS snapshot is an online, point-in-time copy of an Oracle ACFS file system. It
may be read-only or read-writeable. The snapshot copy is space-efficient, using copy-on-write
storage technology. Before an Oracle ACFS file extent is modified or deleted, its current value
is copied to the snapshot to maintain the point-in-time view of the file system.
Oracle ACFS snapshots are immediately available for use after they are created. The
snapshots are created in the .ACFS/snaps/ directory of the ACFS file system. They are
always online and available while the file system is mounted. In the event of data loss, an
Oracle ACFS snapshot can support the online recovery of files inadvertently modified or
deleted from a file system by using the snapshot version for recovery.
Oracle ACFS supports up to a total of 63 read-only, read-write, or combination of read-only
and read-write snapshot views per file system. An Oracle ACFS snapshot can also be used as
the source of a file system or database backup, as it can be created on demand to deliver a
current, consistent, online view of an active file system.
You can create a snapshot from an existing snapshot in the same Oracle ACFS file system. In
addition, you can convert a snapshot between read-only and read-write formats. To create
snapshots, the disk group compatibility attribute for ADVM must be set to 12.1 or higher.
Oracle ACFS snapshot storage is maintained within the file system, eliminating the
management of separate storage pools for file systems and snapshots. Oracle ACFS file
systems can be dynamically resized to accommodate additional file and snapshot storage
requirements.
For more information on Oracle ACFS refer to the Oracle Automatic Storage Management
Administrator's Guide 12c Release 1 (12.1.) E17612020.
Oracle Multitenant leverages the underlying ACFS snapshot capability, allowing DBAs to
create snapshot clones of PDBs from the SQL command line. PDB snapshots are managed
using SQL through CREATE, DROP, and ALTER commands. Although the ACFS
command line tool acfstuil can be used to manage snapshots in the snapshot file system. All
snapshots related to PDB cloning must use SQL, Oracle Enterprise Manager or the Oracle
Multitenant Self-Service Provisioning Application. Do not use acfsutil to manage snapshot
clone PDBs.
Oracle Multitenant provides two cloning modes for PDBs - full clones and snapshot clones.
A full clones is a complete copy of the source PDB data files. This is the default if you do not
explicitly invoke the SNAPSHOT COPY clause in the CREATE PLUGGABLE
DATABASE statement. The statement CREATE PLUGGABLE DATABASE will create a
full-copy clone of the PDB$SEED, a pre-seeded database present in each CDB.
The following requirements must be met to use the SNAPSHOT COPY clause:
All of the pluggable data files of the source PDB must be stored on ACFS.
The source PDB cannot be in a remote CDB.5
The source PDB must be in read-only mode.
If the PDB is created with the SNAPSHOT COPY clause, you can issue the drop
pluggable database command on the parent PDB, e.g. source PDB for snapshot copy,
with the INCLUDING DATAFILES clause, however, with ACFS, as the files are still
in use by dependent snapshots, the files will have to be manually removed when the
snapshot dependencies are removed.
Storage credentials
ACFS is tightly integrated with the Oracle RDBMS, the Oracle Grid Infrastructure and ASM
volume management. For this reason, there is no requirement for separate storage credential
key management and authentication.
OMF or non-OMF compliance
Oracle Managed Files (OMF) is a service that automates naming, location, creation and
deletion of database files. Oracle Multitenant is fully OMF compliant for both ASM and
ACFS data file storage. A globally unique identifier (GUID) will be automatically generated
and embedded in the data file pathname for snapshot clones and OMF data files will have an
OMF generated file name.
Alternatively, Oracle Multitenant supports non-OMF directory naming conventions. It is
possible to snapshot clone between the different directory naming conventions, however, file
name or directory name conversion is required.
The FILE_NAME_CONVERT clause determines how the database generates the absolute
path names of the data files for the PDB. The Oracle database will substitute the absolute
path name for the target PDB directory. If you omit this clause, the default is OMF generated
file names. If OMF is not used, the database will attempt to use the session or system
parameter PDB_FILE_NAME_CONVERT.
PDB_FILE_NAME_CONVERT
The following step-by-step PDB snapshot cloning assumes that the Oracle Grid
Infrastructure with ASM is installed, configured and operational following the guidelines
described in the Oracle Grid Infrastructure Installation Guide 12c Release 1 (12.1). The step-
For a complete description and examples of these and other file name conversion clauses for PDB creation,
please see the Oracle Database SQL Language Reference 12c Release 1 (12.1.) and/or the Oracle Database
Administrators Guide 12c Release 1 (12.1) Chapter 38.
6
by-step instructions also assume that an Oracle Multitenant Container Database (CDB) has
been deployed and configured correctly.
Demo Environment
PATH
TOTAL_MB
--------------- ---------/dev/sdf
285148
/dev/sde
285148
/dev/sdd
285148
/dev/sdc
285148
/dev/sdb
285148
An Oracle Multitenant Container Database (CDB) with the CDB$ROOT and PDB$SEED is
configured in ASM storage7. The file system for snapshot cloning is a 1TB ACFS volume and
file system created from the common +DATA disk group and mounted on /snapclones.
The choice to segregate the CDB$ROOT and PDB$SEED by configuring them on ASM rather than ACFS is
to provide isolation from the snapshot environment. Further isolation can be achieved by configuring a separate
disk group mapped to a separate controller.
7
Step-by-Step
ASM Disk Group Management, Volume and ACFS creation can be executed either on the
command line or using the ASM Configuration Assistant, asmca, found in the
$GRID_HOME/bin directory. This step-by-step instruction uses the asmca utility so that the
work flow is clearly illustrated.
10
11
12
The acfs_script.sh simply mounts the ACFS file system as type ACFS and sets the correct
ownership and permissions:
#!/bin/sh
/bin/mount -t acfs /dev/asm/snapclones-248 /snapclones
if [ $? = "0" ]; then
chown oracle:oinstall /snapclones
chmod 775 /snapclones
exit 0
fi
13
The ACFS file system is ready for hosting PDB snapshot clone data files. The production
database is stored in the ASM disks. For this exercise a full copy clone of the production
database is copied to /snapclones/gold_image and plugged in to the container database for
snapshot provisioning for test, dev, UAT, analytics and reporting environments.
Plug-in PROD_DB in ASM from a backup copy of the PDB8:
SQL> alter session set db_create_file_dest='+DATA';
Session altered.
SQL> set timing on
SQL> set time on
10:05:49 SQL> create pluggable database prod_db using
'/snapclones/gold_image/gold_image.xml';
Pluggable database created.
Elapsed: 00:56:36.03
11:03:10 SQL>
In this exercise the PROD_DB was recovered from a backup. Had the PROD_DB PDB existed in this
environment, a full copy clone to the /snapclones ACFS file system, as in the step below, would be executed.
8
14
Review size:
SQL> alter session set container=prod_db;
Session altered.
SQL> @size
Database size in GB
------------------315.791138
ASM:
ASMCMD> ls -l
Type
Redund
DATAFILE UNPROT
DATAFILE UNPROT
DATAFILE UNPROT
DATAFILE UNPROT
Striped
COARSE
COARSE
COARSE
COARSE
Time
APR 12
APR 12
APR 12
APR 12
12:00:00
12:00:00
12:00:00
12:00:00
Sys
Y
Y
Y
Y
Name
SOE.280.844682795
SYSAUX.275.844682795
SYSTEM.282.844682795
USERS.281.844682795
ASMCMD> pwd
+DATA/ORCL/F3FCB399D04FCA84E043C88E810A091F/DATAFILE
15
Review size:
12:45:52 SQL> show con_name
CON_NAME
-----------------------------GOLD_IMAGE
12:46:00 SQL> @size
Database size in GB
------------------315.791138
Review files:
DATABASE:
12:46:03 SQL> select file_name from dba_data_files;
FILE_NAME
-------------------------------------------------------------------------------/snapclones/ORCL/F6DE198B113F07B8E043C88E810A9BDB/datafile/o1_mf_system_9nm3hjdk
_.dbf
/snapclones/ORCL/F6DE198B113F07B8E043C88E810A9BDB/datafile/o1_mf_sysaux_9nm3hjh7
_.dbf
/snapclones/ORCL/F6DE198B113F07B8E043C88E810A9BDB/datafile/o1_mf_users_9nm3hjjb_
.dbf
/snapclones/ORCL/F6DE198B113F07B8E043C88E810A9BDB/datafile/o1_mf_soe_9nm3hjkc_.d
bf
16
17
CON_NAME
-----------------------------PDB$SEED
PROD_DB
GOLD_IMAGE
OPEN MODE
---------READ ONLY
READ WRITE
READ ONLY
RESTRICTED
---------NO
NO
NO
Review size:
DEV_20141012 DATABASE:
15:12:57 SQL> alter session set container=dev_20141012;
Session altered.
Elapsed: 00:00:00.00
15:13:13 SQL> show con_name
CON_NAME
-----------------------------DEV_20141012
18
Check OS sizes:
[oracle@myhost
bin]$ df -h /snapclones
Filesystem
Size Used Avail Use% Mounted on
/dev/asm/snapclones-248 1.0T 318G 707G 32% /snapclones
[oracle@myhost bin]$ du -h /snapclones
du: cannot read directory `/snapclones/lost+found': Permission denied
64K
/snapclones/lost+found
316G
/snapclones/ORCL/F6DE198B113F07B8E043C88E810A9BDB/datafile
316G
/snapclones/ORCL/F6DE198B113F07B8E043C88E810A9BDB
21M
/snapclones/ORCL/F6E09DAD63871D0FE043C88E810A1E3D/datafile
21M
/snapclones/ORCL/F6E09DAD63871D0FE043C88E810A1E3D
316G
/snapclones/ORCL
316G
/snapclones
SQL> select file_name from dba_data_files;
FILE_NAME
-------------------------------------------------------------------------------/snapclones/ORCL/F6E09DAD63871D0FE043C88E810A1E3D/datafile/o1_mf_soe_9nmg1517_.d
bf
/snapclones/ORCL/F6E09DAD63871D0FE043C88E810A1E3D/datafile/o1_mf_users_9nmg1512_
.dbf
/snapclones/ORCL/F6E09DAD63871D0FE043C88E810A1E3D/datafile/o1_mf_sysaux_9nmg150v
_.dbf
/snapclones/ORCL/F6E09DAD63871D0FE043C88E810A1E3D/datafile/o1_mf_system_9nmg150l
_.dbf
Check acfsutil:
[oracle@myhost bin]$ acfsutil info fs /snapclones
/snapclones
ACFS Version: 12.1.0.2.0
on-disk version:
43.0
flags:
MountPoint,Available
mount time:
Fri Apr 11 17:56:51 2014
allocation unit:
4096
volumes:
1
total size:
1099511627776 (
1.00 TB )
total free:
758131781632 ( 706.06 GB )
file entry table allocation: 2129920
primary volume: /dev/asm/snapclones-248
label:
state:
Available
major, minor:
250, 126977
size:
1099511627776 (
1.00 TB )
free:
758131781632 ( 706.06 GB )
ADVM diskgroup
DATA
19
Check /snapclones/.ACFS/snaps:
[oracle@myhost datafile]$ pwd
/snapclones/.ACFS/snaps/F6E09DAD63871D0FE043C88E810A1E3D/ORCL/F6DE198B113F07B8E0
43C88E810A9BDB/datafile
[oracle@myhost datafile]$ ls -l
total 330959912
-rw-r----- 1 oracle oinstall 337691811840 Apr 12 15:05 o1_mf_soe_9nm3hjkc_.dbf
-rw-r----1
oracle
oinstall
901783552
Apr
12
15:09
o1_mf_sysaux_9nm3hjh7_.dbf
-rw-r----1
oracle
oinstall
283123712
Apr
12
15:18
o1_mf_system_9nm3hjdk_.dbf
-rw-r----- 1 oracle oinstall
20979712 Apr 12 12:50 o1_mf_temp_9nm3hjj8_.dbf
-rw-r----- 1 oracle oinstall
5251072 Apr 12 15:05 o1_mf_users_9nm3hjjb_.dbf
[oracle@myhost datafile]$ pwd
/snapclones/ORCL/F6E09DAD63871D0FE043C88E810A1E3D/datafile
[oracle@myhost datafile]$ ls -l
total 20504
lrwxrwxrwx 1 oracle oinstall
127 Apr 12 15:03 o1_mf_soe_9nmg1517_.dbf ->
/snapclones/.ACFS/snaps/F6E09DAD63871D0FE043C88E810A1E3D/ORCL/F6DE198B113F07B8E0
43C88E810A9BDB/datafile/o1_mf_soe_9nm3hjkc_.dbf
lrwxrwxrwx 1 oracle oinstall
130 Apr 12 15:03 o1_mf_sysaux_9nmg150v_.dbf ->
/snapclones/.ACFS/snaps/F6E09DAD63871D0FE043C88E810A1E3D/ORCL/F6DE198B113F07B8E0
43C88E810A9BDB/datafile/o1_mf_sysaux_9nm3hjh7_.dbf
lrwxrwxrwx 1 oracle oinstall
130 Apr 12 15:03 o1_mf_system_9nmg150l_.dbf ->
/snapclones/.ACFS/snaps/F6E09DAD63871D0FE043C88E810A1E3D/ORCL/F6DE198B113F07B8E0
43C88E810A9BDB/datafile/o1_mf_system_9nm3hjdk_.dbf
-rw-r----- 1 oracle oinstall 20979712 Apr 12 15:03 o1_mf_temp_9nmg1510_.dbf
lrwxrwxrwx 1 oracle oinstall
129 Apr 12 15:03 o1_mf_users_9nmg1512_.dbf ->
/snapclones/.ACFS/snaps/F6E09DAD63871D0FE043C88E810A1E3D/ORCL/F6DE198B113F07B8E0
43C88E810A9BDB/datafile/o1_mf_users_9nm3hjjb_.dbf
Note that ACFS Copy-on-Write creates pointers for the snapshot which point back to the
primary file system files. The above sequence of commands identifies the PDB
DEV_20141012 data files and pointers back to the source file system files.
Open PDB for use:
SQL> alter pluggable database dev_20141012 open;
20
CON_NAME
-----------------------------PDB$SEED
PROD_DB
GOLD_IMAGE
DEV_20141012
OPEN MODE
---------READ ONLY
READ WRITE
READ ONLY
READ WRITE
RESTRICTED
---------NO
NO
NO
NO
21
Registration is through the APEX-based self-service interface. The account and notification is
managed by the CDB Administrator. Role delegation for PDB Administrative privileges can
be assigned by the CDB Administrator to registered users.
PDBs can be defined as 'clonable' in the management interface. PDB Administrators may be
granted the ability to define access, roles, quotas and other aspect of management of the
PDBs that they control.
22
When PDBs are defined 'clonable' in the PDB attribute page, a 'clonable' PDB may be used
as a source of either full clones or snapshot clones as specified in the provisioning page.
23
24
Conclusion
Data growth and data management are unquestionably a main concern for IT managers. There
are expensive point solutions on the market that tout database virtualization and agile data
management, but such solutions are segmented and lack end-to-end integration with the Oracle
database stack. Oracle Multitenant, coupled with Oracle CloudFS, offers complete, integrated
database virtualization with storage snapshot clones driven through SQL or the Oracle Multitenant
self-service application.
As demonstrated in the working examples above, a full copy clone of the 315GB PROD_DB
copied in to ASM storage took 56 minutes. A subsequent full copy clone of this database as a gold
image from ASM to ACFS storage took 34 minutes. A snapshot copy of the full copy clone gold
image on ACFS took 12 seconds, on the described hardware, and consumed only an additional
176MB of storage.
A database provisioning task that normally takes days to weeks to complete is provisioned in
seconds, without impacting the source database with disruptive I/O and excessive space
consumption. More than this, individual Lines of Business are empowered to manage their own
data sets. Using the Multitenant database self-service provisioning app, available for free
download on the Oracle Technical Network (OTN), developers, support, QA and other users, as
'subscribers' to the data, are enabled to clone, archive their clones, clone from their clones, and/or
drop their individual clones completely autonomous to the source data.
Oracle Multitenant PDB snapshot cloning using ACFS is a fast, cost-effective solution to
address data growth management.
25
26
January 2014
Author: John P. McHugh
This document is provided for information purposes only, and the contents hereof are subject to change
Contributing Authors:
without notice. This document is not warranted to be error-free, nor subject to any other warranties or
Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
conditions, whether expressed orally or implied in law, including implied warranties and conditions of
merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this
document, and no contractual obligations are formed either directly or indirectly by this document. This
document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for
any purpose, without our prior written permission.
Worldwide Inquiries:
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of
Phone: +1.650.506.7000
Fax: +1.650.506.7200
Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are
oracle.com
used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron,
the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro
Devices. UNIX is a registered trademark of The Open Group. 0113