Monday, January 23, 2012

ACFS Snapshot setup & views


In this below note, I have configured the ADVM & ACFS mount point already. So I am creating snapshot for the existing ACFS mount points. If you don’t have ACFS mount points then we have to create it first.

What is ACFS Snapshot

Oracle ACFS snapshot is an online, read-only or read-write, point in time copy of an Oracle ACFS file system.
The snapshot copy is space-efficient and uses Copy-On-Write functionality. Oracle ACFS snapshots are immediately available for use after they are created. The snapshots are created in the .ACFS/snaps/ directory of the file system. They are always online while the file system is mounted. Oracle ACFS read-write snapshots enable fast creation of a snapshot image that can be both read and written without impacting the state of the Oracle ACFS file system 

1)    We can use the snapshot before installing & removing patches for the $ORACLE_HOME or any application which are in   production environment. We will have original copy of data in the snapshot which we can move it at any time.
2)    Testing of new versions of application software on production file data reflected in the read-write snapshot image without    modifying the original production file system
3)    Running test scenarios on a real data set without modifying the original production file system
4)    Oracle ACFS snapshot can support the online recovery of files inadvertently modified or deleted from a file system.

View detail information on each file system

To Collect more information about ACFS, you will get it through the below view

oracrs +ASM1 > /sbin/acfsutil info fs –h

It has penalty of option available on this view

To collect the statistics for the ACFS Mount point

oracrs +ASM1 > /sbin/acfsutil info fs /oracle/dbdump -s
    amount of change since mount:       0.11 MB
    average rate of change since mount: 0 KB/s

CREATE ACFS SNAPSHOTS
TO create a snapshot in read-write or read-only mode

oracrs +ASM1> /sbin/acfsutil snap create SNAP_PREUPGRADE /oracle/dbadmin
acfsutil snap create: Snapshot operation is complete.

VIEW ACFS SNAPSHOTS
                          
To know about the snapshot for the particular mount in the ACFS, below command will work from 11.2.0.3 onwards

$ /sbin/acfsutil snap info /oracle/dbdump

To view current snapshot files. All the snapshot will be located under the mount point of the ACFS file system .ACFS/snaps folder

oracrs +ASM1 > cd /oracle/dbadmin/

oracrs +ASM1 > pwd
/oracle/dbadmin/.ACFS/snaps
oracrs +ASM1 > ls -lrt
total 4
drwxrwxr-x 22 oracle oinstall 4096 Jan 20 11:42 SNAP_PREUPGRADE
oracrs +ASM1 >

To view the specific mount point information and it gives us total no of snapshot available for the current mount point

oracrs +ASM1 > /sbin/acfsutil info fs /oracle/dbadmin
/oracle/dbadmin
    ACFS Version: 11.2.0.2.0
    flags:        MountPoint,Available
    mount time:   Thu Jan 12 09:58:51 2012
    volumes:      1
    total size:   20669530112
    total free:   20450643968
    primary volume: /dev/asm/acfs_vol1-98
        label:
        flags:                 Primary,Available,ADVM
        on-disk version:       40.0
        allocation unit:       4096
        major, minor:          252, 50177
        size:                  20669530112
        free:                  20450643968
        ADVM diskgroup         ACFS
        ADVM resize increment: 268435456
        ADVM redundancy:       unprotected
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  1
    snapshot space usage: 3198976

To view the snapshot information through sqlplus

SQL> SELECT SUBSTR(fs_name,1,34) FILESYSTEM,SUBSTR(snap_name,1,28) SNAPSHOT, CREATE_TIME TIME FROM V$ASM_ACFSSNAPSHOTS;

FILESYSTEM                         SNAPSHOT                     TIME
---------------------------------- ---------------------------- -----------
/oracle/dbadmin                    SNAP_PREUPGRADE                    20-JAN-2012


DELETE ACFS SNAPSHOTS

oracrs +ASM1 > /sbin/acfsutil snap delete SNAP_PREUPGRADE /oracle/dbadmin
acfsutil snap delete: Snapshot operation is complete.

To identify the file system which are allocated through the ACFS
SQL> col FS_NAME format a15
SQL> select * from V$ASM_FILESYSTEM;

FS_NAME         AVAILABLE_T BLOCK_SIZE STATE         CORRU    NUM_VOL TOTAL_SIZE
--------------- ----------- ---------- ------------- ----- ---------- ----------
TOTAL_FREE TOTAL_SNAP_SPACE_USAGE
---------- ----------------------
/oracle/dbadmin 12-JAN-2012          4 AVAILABLE     FALSE          1      19712
19492.9375                      0

To know about the mount point and volumes allocated in the ACFS

SQL> col FS_NAME format a15
SQL> col VOL_DEVICE format a15
SQL> col VOL_LABEL format a15     
SQL> select * from v$asm_acfsvolumes;

FS_NAME         VOL_DEVICE      VOL_LABEL       PRIMA   TOTAL_MB    FREE_MB
--------------- --------------- --------------- ----- ---------- ----/oracle/dbadmin /dev/asm/acfs_v                 TRUE       19712 19492.9375
                ol1-98

TO understand more about the current volume statistics for ACFS volumes

SQL> col VOLUME_NAME format a15
SQL> select * from V$ASM_VOLUME_STAT;

GROUP_NUMBER VOLUME_NAME     COMPOUND_INDEX VOLUME_NUMBER      READS     WRITES
------------ --------------- -------------- ------------- ---------- ----------
 READ_ERRS WRITE_ERRS  READ_TIME WRITE_TIME BYTES_READ BYTES_WRITTEN
---------- ---------- ---------- ---------- ---------- -------------
           1 ACFS_VOL1             16777217             1      23342       5887
         0          0     12.073     18.228   34204672       5329920



SQL> col VOLUME_NAME format a15
SQL> col USAGE format a15
SQL> col MOUNTPATH  format a15
SQL> select VOLUME_NAME,SIZE_MB,STRIPE_COLUMNS,USAGE,MOUNTPATH from v$asm_volume;

VOLUME_NAME        SIZE_MB STRIPE_COLUMNS USAGE           MOUNTPATH
--------------- ---------- -------------- --------------- ---------------
ACFS_VOL1            19712              4 ACFS            /oracle/dbadmin


In side the ASMCMD tool, we can find about the volumes through the below commands

volcreate
voldelete
voldisable
volenable
volinfo
volresize
volset
volstat

No comments:

Post a Comment