Friday, March 11, 2011

Creating and Removing ACFS

Oracle Automatic Storage Management Cluster File System (Oracle ACFS) is a multi-platform, scalable file system, and storage management technology that extends Oracle Automatic Storage Management (Oracle ASM) functionality to support customer files maintained outside of Oracle Database.

Creating ACFS


1. Set the diskgroup attribute parameters. Compatible.asm and compatible.advm should be >= 11.2
$ sqlplus  / as sysasm
SQL> alter diskgroup flash set attribute 'compatible.asm'='11.2';
SQL> alter diskgroup flash set attribute 'compatible.advm'='11.2';
2. Create a volume in the appropriate diskgroup
SQL> alter diskgroup flash add volume volume1 size 1g;
This could also be done using asmcmd. Volume device could be identified with
select volume_name,volume_device from v$asm_volume;
VOLUME_NAME VOLUME_DEVICE
-------------- ---------------------
VOLUMNE1 /dev/asm/volumne1-398
This could also confirmed with ls /dev/asm/*

3. Create a file system on the created volume
# mkfs -t acfs /dev/asm/volumne1-398
mkfs.acfs: version = 11.2.0.2.0
mkfs.acfs: on-disk version = 39.0
mkfs.acfs: volume = /dev/asm/volumne1-398
mkfs.acfs: volume size = 1073741824
mkfs.acfs: Format complete.
(Update 2013/10/30)
mkfs could also be run as grid user provided that user has the permission on the device
[grid@rhel6m1 ~]$ ls -l /dev/asm/volume1-149
brwxrwx---. 1 root asmadmin 252, 76289 Oct 30 15:31 /dev/asm/volume1-149
[grid@rhel6m1 ~]$  mkfs -t acfs /dev/asm/volume1-149
mkfs.acfs: version                   = 11.2.0.3.0
mkfs.acfs: on-disk version           = 39.0
mkfs.acfs: volume                    = /dev/asm/volume1-149
mkfs.acfs: volume size               = 1073741824
mkfs.acfs: Format complete.
4. Register the file system with
acfsutil registry -a /dev/asm/volumne1-398 /opt/acfsvol
/opt/acfsvol will be the mountpoint for this file system.

5. Mount the file system
# mount -t acfs /dev/asm/volumne1-398 /opt/acfsvol

ASMCMD> volinfo -G flash VOLUMNE1
Diskgroup Name: FLASH

Volume Name: VOLUMNE1
Volume Device: /dev/asm/volumne1-398
State: ENABLED
Size (MB): 1024
Resize Unit (MB): 256
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage: ACFS
Mountpath: /opt/acfsvol
6. Change ownership to Oracle user to allow oracle user processes to use the file system
# chown oracle:oinstall /opt/acfsvol
6. As oracle user create a file in the mount point
cd /opt/acfsvol
touch x
In a RAC system the volume will be mounted on all nodes after server reboots and requires selinux to be permissive.




Removing ACFS

1. Unmount the file system
# umount /opt/acfsvol
2. De-register the file system
# acfsutil registry -d /opt/acfsvol
acfsutil registry: successfully removed ACFS mount point /opt/acfsvol from Oracle Registry
3. Drop the volumne from the diskgroup
SQL> alter diskgroup flash drop volume volume1;

Diskgroup altered.

SQL> select volume_name,volume_device from v$asm_volume;

no rows selected