Saturday, 27 February 2016

ADVM (ASM Dynamic Volume Manager)

In 11g R2 New Feature

ADVM volume is created in ASM diskgroup. You can use "ALTER DISKGROUP ADD VOLUME" or "asmcmd volcreate" commands.

ACFS file system is created in ADVM volume with "mkfs -t acfs" command.
After this you can manage it with "acfsutil" command.


NOTE: In simple word prior to 12c non-database file (like Vedios, Doc., mp4 ..etc) only Stored in ACFS and after 12c onword non-database file + database files are stored in ACFS.

A new device driver which is integrated into the Oracle Kernel called ASM Dynamic Volume Manager (ADVM) is loaded at ASM startup and functions as a standard I/O interface for normal file systems to utilize ASM functionalities.

This driver communicates with the ASM instance about ASM extent maps, rebalancing operations and I/O failure issues.
Files used as ASM Disks are not supported by ADVM. For example on NetApp Filer only real disks or Netapp Devices using ISCSI, SCSI or Fibre Channel can be used.

For the first version of ADVM Oracle Corporation claims to support up to  64 million files per file system, and up to 64 mounts on 32 bit systems, and 256 mounts on 64 bit systems.


ADVM is also integrated with new commands for the asmcmd interface.
*. volcreate
*. voldelete
*. voldisable
*. volenable
*. volinfo
*. volresize
*. volset

The new diskgroup attribute COMPATIBLE.ADVM must be set 11.2 as well as COMPATIBLE.ASM to add a new volume.



Oracle has introduced ADVM ( ASM Dynamic Volume Manager in 11g R2 ), this feature allow DBA's / SA to create a dynamic volume
out of an existing diskgroup and mount it like a normal partition to store files inside it ( Not necessarily a database file ).

Benefits of Using ADVM 

ADVM will benefit from Mirroring and striping done at the ASM Level.
ADVM allows to use ACFS Snapshots to ensure quick recovery of data in case of failure.

See how to create ADVM managed volumes

You need to have compatible set to 11.2.0 at diskgroup level before you proceed with volume creation.


$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 6 15:46:05 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: / as sysasm

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Automatic Storage Management option


SQL> col NAME for a10
SQL> col COMPATIBILITY for a15
SQL> col DATABASE_COMPATIBILITY for a15
SQL> select GROUP_NUMBER,NAME,COMPATIBILITY,DATABASE_COMPATIBILITY,VOTING_FILES from v$asm_diskgroup;



SQL> alter diskgroup TEST set attribute 'compatible.asm'='11.2.0';
 Diskgroup altered.


SQL> alter diskgroup TEST set attribute 'compatible.rdbms'='11.2.0';
 Diskgroup altered.

SQL> exit


Now check at the asmcmd level with volume information
  

$ asmcmd
ASMCMD> volinfo -a
no volumes found

Now create a volume out of the existing diskgroup TEST


ASMCMD> lsdg
State    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB Name
MOUNTED  EXTERN  N         512   4096  1048576      2048     1972                0            1972 TEST/
MOUNTED  NORMAL  N         512   4096  1048576      9216     5705              883            2411 DATA/
MOUNTED  EXTERN  N         512   4096  1048576      9216     8982                0            8982 FRA/

ASMCMD> volcreate -G TEST -s 256M TVOL

ASMCMD> volinfo -a
Diskgroup Name: TEST

         Volume Name: TVOL
         Volume Device: /dev/asm/tvol-77
         State: ENABLED
         Size (MB): 256
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage:
         Mountpath:

ASMCMD>
ASMCMD> exit

Now you need to login through root user and run the mkfs and mount command at the server with the new volume created above


su -
Password:
$ ls -ltr /dev/asm/tvol-77
brwxrwx--- 1 root dba 252, 102401 Oct  6 15:49 /dev/asm/tvol-77

-- ACFS Stands for ASM Cluster file System

[root@rac1 bin]# mkfs -t acfs /dev/asm/tvol-77
mkfs.acfs: version                   = 11.2.0.1.0.0
mkfs.acfs: on-disk version           = 39.0
mkfs.acfs: volume                    = /dev/asm/tvol-77
mkfs.acfs: volume size               = 268435456
mkfs.acfs: Format complete.

[root@rac1 bin]#

# mkdir /advm
# df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             113G   48G   59G  46% /
/dev/sda2              23M  6.7M   15M  31% /boot
tmpfs                 1.2G  430M  723M  38% /dev/shm
/dev/sda1              30G   11G   20G  35% /mnt/cdrive


Now mount the recently created partition out of diskgroup

# mount -t acfs /dev/asm/tvol-77 /advm
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5             113G   48G   59G  46% /
/dev/sda2              23M  6.7M   15M  31% /boot
tmpfs                 1.2G  430M  723M  38% /dev/shm
/dev/sda1              30G   11G   20G  35% /mnt/cdrive
/dev/asm/tvol-200     256M   37M  220M  15% /advm

# cd advm
# ls -ltr
total 102484
drwx------ 2 root   root     65536 Oct  6 15:50 lost+found

# chown -R oracle:dba /advm

So Now you could see a partition created with the name advm and you can utilize it for storing file. 
in the next step we would be logging from database instance and we would create a tablespace with 
datafile in advm partition.



$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 6 15:51:22 2011
Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: / as sysdba

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> create tablespace TESTNEW datafile '/advm/testnew01.dbf' size 100M;
 Tablespace created.


SQL> create table t1  tablespace testnew as select * from t;
 Table created.

SQL> exit


Now login from the ASM instance and see volinfo -a


 asmcmd
ASMCMD> volinfo -a
Diskgroup Name: TEST

         Volume Name: TVOL
         Volume Device: /dev/asm/tvol-77
         State: ENABLED
         Size (MB): 256
         Resize Unit (MB): 256
         Redundancy: UNPROT
         Stripe Columns: 4
         Stripe Width (K): 128
         Usage: ACFS
         Mountpath: /advm

ASMCMD>

the last lines shows that this volume is mounted as ADVM with the use of ACFS file system.



-------- Install again driver ---------

 ] # ./acfsroot  install

su – oracle

grid_env

asmcmd

--Enable ACFS volume

Volinfo –h

lsdg

volenable –G TEST –a

[root@rac1 bin]# mount -t acfs /dev/asm/tvol-77 /advm


No comments: