Working with ACFS Snapshots on top of Clusterware 11.2

Used Software

  • Clusterware: 11.2.0.3.4
  • OEL 6.3
  • VirtualBox 4.2.14

ACFS provides snapshotting capability for the respective filesystem. This snapshot uses the First Copy-on-Write (FCOW) methodology to enable a consistent, version-based, online view of the source filesystem.Snapshots are immutable views of the source file system as it appeared at a specific point in time.Snapshots are initially a sparse filesystem, as the source filesystem files change, the before-image extent ofthat file is copied into the snapshot directory. The before-image granularity is an ACFS extent, thus if any byte in an extent is modified, the extent is COW’ed and any subsequent changes in that extent requires no action for the snap. Note that ACFS snapshots cannot be used on filesystems that house RMAN backups,archived logs, and Datapump dumpsets.

When snapshots are created they are automatically available under the snapped filesystem as a hidden sub-directory inside the source filesystem called .ACFS.  Thus no separate mount operation is needed and no separate file store needs to be maintained for the snapshots. The following example shows how to create  ACFS snapshots.

 

Check whether we already have created any snapshots:
$ /sbin/acfsutil info fs
/u01/app/oracle/acfsmount/acfs_vol1
    ACFS Version: 11.2.0.3.0
    flags:        MountPoint,Available
    mount time:   Mon Aug  5 15:12:14 2013
    volumes:      1
    total size:   838860800
    total free:   763121664
    primary volume: /dev/asm/acfs_vol1-140
        label:                 
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          251, 71681
        size:                  838860800
        free:                  763121664
        ADVM diskgroup         ACFS
        ADVM resize increment: 33554432
        ADVM redundancy:       mirror
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  0
    snapshot space usage: 0
    replication status: DISABLED

As we don't have created any snapshots yet - let's create one and verify the status
$ /sbin/acfsutil snap create snap_001  /u01/app/oracle/acfsmount/acfs_vol1 
acfsutil snap create: Snapshot operation is complete.
$  /sbin/acfsutil info fs
/u01/app/oracle/acfsmount/acfs_vol1
    ACFS Version: 11.2.0.3.0
    flags:        MountPoint,Available
    mount time:   Mon Aug  5 15:12:14 2013
    volumes:      1
    total size:   838860800
    total free:   696012800
    primary volume: /dev/asm/acfs_vol1-140
        label:                 
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          251, 71681
        size:                  838860800
        free:                  696012800
        ADVM diskgroup         ACFS
        ADVM resize increment: 33554432
        ADVM redundancy:       mirror
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  1
    snapshot space usage: 49152
    replication status: DISABLED

Copy 2 files to our ACFS file system and create a 2.nd snapshot
$ ls /u01/app/oracle/acfsmount/acfs_vol1
INFO  INFO2  
$ /sbin/acfsutil snap create snap_002 /u01/app/oracle/acfsmount/acfs_vol1
acfsutil snap create: Snapshot operation is complete.
Checkout .ACFS directory and verify that snap_002 directory displays INFO, INFO2 files 
# find  /u01/app/oracle/acfsmount/acfs_vol1/.ACFS
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/.fileid
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/repl
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/repl/staging
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/repl/ready
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/repl/processed
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/repl/logs
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_001
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_001/lost+found
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_002
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_002/lost+found
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_002/INFO
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_002/INFO2

Remove INFO2 file from current ACFS fs
$ rm /u01/app/oracle/acfsmount/acfs_vol1/INFO2
$ ls  /u01/app/oracle/acfsmount/acfs_vol1
INFO

Restore file from snap_002 
# find  /u01/app/oracle/acfsmount/acfs_vol1/.ACFS | grep INFO2
/u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_002/INFO2
# cp /u01/app/oracle/acfsmount/acfs_vol1/.ACFS/snaps/snap_002/INFO2  /u01/app/oracle/acfsmount/acfs_vol1
#  ls  /u01/app/oracle/acfsmount/acfs_vol1
INFO  INFO2 

 

Reference:

     http://www.oracle.com/technetwork/products/cloud-storage/acfs-technical-overview-514457.pdf

Leave a Reply

Your email address will not be published. Required fields are marked *