Saturday 27 February 2016

ACFS SNAPSHOT


Demonstrate you on how to secure your ADVM Volumes by creating a snapshot copy of it.
A snapshot copy is a widely used concept with Storage Vendors, where they use it to reduce backup and recovery
time.

Snapshot Copy is the read only copy of a partition at a particular point in time. It doesn't take much time to create the snapshot partition regardless of the size or use of the partition. Thus it gives good amount of benefit for large sized partition.

Utility used to create acfs snapshot is acfsutil, once a snapshot is creates a read only copy of the partition is made 
and would be accessible from inside the .ACFS directory

Volume Allocation Unit (VAU) if the stripe column is 4 and AU is 1 MB
64 MB is the size of extenet

[root@rac1 advm]# acfsutil snap create snap_01 /advm
acfsutil snap create: Snapshot operation is complete.

[root@rac1 advm]# cd /advm

[root@rac1 advm]# ls -la
total 102500
drwxr-xr-x  4 oracle dba       4096 Oct  6 16:37 .
drwxr-xr-x 36 root   root      4096 Oct  6 16:11 ..
-rw-r--r--  1 oracle dba         57 Oct  6 16:30 a
drwxr-xr-x  5 root   root      4096 Oct  6 15:50 .ACFS
-rw-r--r--  1 root   root        61 Oct  6 16:37 check
drwx------  2 root   root     65536 Oct  6 15:50 lost+found
-rw-r-----  1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf

# cd .ACFS/snaps/snap_01

# ls -ltr
total 102420
?--------- ? ?      ?            ?            ? lost+found
-rw-r----- 1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf
-rw-r--r-- 1 oracle dba         57 Oct  6 16:30 a
-rw-r--r-- 1 root   root        61 Oct  6 16:37 check

# pwd
/advm/.ACFS/snaps/snap_01

# cd /advm

[root@rac1 advm]# ls -ltr
total 102484
drwx------ 2 root   root     65536 Oct  6 15:50 lost+found
-rw-r----- 1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf
-rw-r--r-- 1 oracle dba         57 Oct  6 16:30 a
-rw-r--r-- 1 root   root        61 Oct  6 16:37 check

[root@rac1 advm]# vi check

[root@rac1 advm]# cat check
Step 1 : Checking Files
Step 2 : Before we create a snaphost
step 3 : After creating the snapshot

[root@rac1 advm]# rm check
rm: remove regular file `check'? y

# cd .ACFS/snaps/snap_01

# ls -ltr
total 102420
?--------- ? ?      ?            ?            ? lost+found
-rw-r----- 1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf
-rw-r--r-- 1 oracle dba         57 Oct  6 16:30 a
-rw-r--r-- 1 root   root        61 Oct  6 16:37 check

[root@rac1 advm snap_01]# cp check /advm

[root@rac1 advm snap_01]# cd /advm

[root@rac1 advm]# ls -ltr
total 102484
drwx------ 2 root   root     65536 Oct  6 15:50 lost+found
-rw-r----- 1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf
-rw-r--r-- 1 oracle dba         57 Oct  6 16:30 a
-rw-r--r-- 1 root   root        61 Oct  6 16:40 check

[root@rac1 advm]# acfsutil info fs
/advm
    ACFS Version: 11.2.0.1.0.0
    flags:        MountPoint,Available
    mount time:   Thu Oct  6 15:50:23 2011
    volumes:      1
    total size:   268435456
    total free:   58609664
    primary volume: /dev/asm/tvol-200
        label:
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          252, 102401
        size:                  268435456
        free:                  58609664
        ADVM diskgroup         ABC
        ADVM resize increment: 268435456
        ADVM redundancy:       unprotected
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  1
    snapshot space usage: 40960

/orcl
    ACFS Version: 11.2.0.1.0.0
    flags:        MountPoint,Available
    mount time:   Thu Oct  6 16:11:13 2011
    volumes:      1
    total size:   2147483648
    total free:   71909376
    primary volume: /dev/asm/orclvol-200
        label:
        flags:                 Primary,Available,ADVM
        on-disk version:       39.0
        allocation unit:       4096
        major, minor:          252, 102402
        size:                  2147483648
        free:                  71909376
        ADVM diskgroup         ABC
        ADVM resize increment: 268435456
        ADVM redundancy:       unprotected
        ADVM stripe columns:   4
        ADVM stripe width:     131072
    number of snapshots:  1
    snapshot space usage: 470855680

# ls -tlr
total 102484
drwx------ 2 root   root     65536 Oct  6 15:50 lost+found
-rw-r----- 1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf
-rw-r--r-- 1 oracle dba         57 Oct  6 16:30 a
-rw-r--r-- 1 root   root       110 Oct  6 16:41 check

# acfsutil snap delete snap_01 /advm
acfsutil snap delete: Snapshot operation is complete. 

# acfsutil snap create snapnew /advm
acfsutil snap create: Snapshot operation is complete.

# cd /advm

# ls -tlr
total 102484
drwx------ 2 root   root     65536 Oct  6 15:50 lost+found
-rw-r----- 1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf
-rw-r--r-- 1 oracle dba         57 Oct  6 16:30 a
-rw-r--r-- 1 root   root       110 Oct  6 16:41 check

# cd .ACFS/snaps/snapnew

# ls -ltr
total 102420
?--------- ? ?      ?            ?            ? lost+found
-rw-r----- 1 oracle dba  104865792 Oct  6 16:21 testnew01.dbf
-rw-r--r-- 1 oracle dba         57 Oct  6 16:30 a
-rw-r--r-- 1 root   root       110 Oct  6 16:41 check


Check the video to understand it on a practical note.


-       Multiple snapshot
[root@rac1 advm]# acfsutil snap create snap_01 /advm
[root@rac1 advm]# acfsutil snap create snap_02 /advm
[root@rac1 advm]# acfsutil snap create snap_03 /advm
[root@rac1 advm]# acfsutil snap create snap_04 /advm





Queries

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

-----------------------------------------------------------------------------------------------------
To know about the mount point and volumes allocated in the ACFS
-----------------------------------------------------------------------------------------------------
col FS_NAME format a15
col VOL_DEVICE format a15
col VOL_LABEL format a15    
select * from v$asm_acfsvolumes;

----------------------------------------------------------------------------------------------------------------
TO understand more about the current volume statistics for ACFS volumes
----------------------------------------------------------------------------------------------------------------
col VOLUME_NAME format a15
select * from V$ASM_VOLUME_STAT;

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

-----------------------------------------------------------------------------------------------------------------------------------
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: