HOW TO IMPLEMENT ORACLE DATABASE 12C SNAPSHOTCLONES USING ACFS (ASM Cluster Filesystem)?

Snapshot technology is becoming predominant to perform Data protection and Data cloning.

Volume based snapshots can be performed from hardware/software side. In this blog I will be discussing on the software based snapshot, one such feature is ACFS which is part of Oracle Enterprise edition.

 

I will be discussing on its features and steps to implement the same on oracle 12C.

 

Applies to:

Oracle Database – All versions of Oracle 12C Enterprise Edition.

 

Author: Anurag

 

Problem

How to Implement Oracle Database 12C Snapshotclones using ACFS?

 

Solution:

Overview:-

Oracle ACFS snapshot is a point in time copy of filesystem. The ability to perform snapshots of ACFS file system is very powerful feature which can be read-only, read-write, space efficient and it is available immediately to users for testing. It supports up to 63 snapshots per filesystem. We can also create new snapshot from an existing snapshot on same ACFS filesystem.

 

It is a layer on ORACLE ASM and which uses copy-on-write technology.

-Copy-on-write

A snapshot is created by pre-allocating space on ASM diskgroup. When the snapshot is created from gold copy only the metadata is copied which points to the actual data.

When there are any changes to the relevant blocks snapshot copies its current value to ACFS to maintain point-in time view of filesystem.

Note:-

Goldcopy is the actual production data which is copied to ACFS.

 

 

 

-Oracle ASM Dynamic Volume Manager (ADVM)

It is an interface which allows us to create and manage the volumes on ASM diskgroup. ADVM allows ACFS and the 3rd party filesystem to utilize ASM features and functionalities.ADVM ensures Volumes to remain consistent during abnormal system shutdown or any ASM instance failures.

 

Implementation step by step:-

 There are 3 ways to create ACFS on Oracle 12C.

  • ASM Configuration Assistant (ASMCA)
  • Oracle Enterprise Manager (OEM)
  • Command Line

 

   Please find the below steps to implement ACFS using ASMCA:-

 

1)      ASM DISK GROUP CONFIGURATION – Login as a grid user from  node 1, Invoke ./asmca

 

  

2)      Edit the attributes on the ASM diskgroup as shown below if you are using the 12c database.

 

 

3)      Choose the Diskgroup name for creating ASM volume.

         

 

 

 

 

4)      Enable the ASM volume.

  

 

5)      Create ASM cluster filesystem.

          

 

 

6)      Run ACFS below script as root user on any one node.

  

 

The above acfs_script.sh mounts the ACFS filesystem with correct ownership and permissions.

Note: - Make sure the path /snapclones exists on both the nodes before executing the script

 

7)      Make  sure  /snapclones is accessible on both nodes as shown below:-

 

#df –h /snapclones

 

8)      Create full copy of production database as gold image to take snapshots

 

SQL> alter session set db_create_file_dest=’/snapclones’;

 

SQL>set time on

12:01:41 SQL> set timing on

12:01:48 SQL> create pluggable database gold_image from prod_db;

 

 

 

 

 

9)      Review the database size

 

SQL> @Size

 

Database size in “GB”

---------------------------------

                1568.68

       10)  Review the database files from dba_data_files.

               SQL> select file_name from dba_data_files;

 

      11)   Check the ACFS file system usage.

        df –h /snapclones

               Filesystem              Size     Used      Avail     Use%      Mounted on

                  --------                    ----        -----         ----         ----          -------

 12)  Review the ACFS /snapclones file system from acfsutil as an Oracle user.

             $ acfsutil info fs /snapclones

              ACFS Version: 12.1.0.2.0

              On disk version: 39.0

              flags: MountPoint,Available

              mount time: Fri Apr 11 17:56:51 2014

              allocation unit: 4096

              volumes: 1

              total size: 1099511627776 ( 1.5 TB )

              total free: 1097290489856 ( 500GB )

              file entry table allocation: 32768

              primary volume: /dev/asm/snapclones-248

              label:

              state: Available

              major, minor: 250, 126977

              size: 1099511627776 ( 1.00 TB )

              free: 1097290489856 ( 1021.93 GB )

              ADVM diskgroup DATA

              ADVM resize increment: 67108864

              ADVM redundancy: unprotected

              ADVM stripe columns: 8

              ADVM stripe width: 1048576

              number of snapshots: 0

              Snapshot space usage: 0 ( 0.00)

 

 

 

13)    Create snapshots on ACFS from gold copy.

              SQL> create pluggable database snap1 from gold_image snapshot copy;

 

14)    Review the Database size.

       SQL> @ size

 

15)    Check acfsutil again

$acfsutil info fs /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.50 TB )

           free: 758131781632 ( 486 GB  )

           ADVM diskgroup DATA

           ADVM resize increment: 67108864

           ADVM redundancy: unprotected

           ADVM stripe columns: 8

           ADVM stripe width: 1048576

           number of snapshots: 1

snapshot space usage: 184889344 ( 14 GB ) à  14GB space is consumed for snapshot of 1.5TB Goldcopy

          replication status: DISABLED

 

 

Note:-

For optimal disk performance make sure to set the parameter FILESYSTEMIO_OPTIONS to SETALL on   both the nodes to distribute the I/O across each nodes.