Prior to Oracle 11.2, ASM was used to store database related files, but was not suitable to act as a general purpose file system to store Oracle binaries, core dump files, parameter or trade files. With the introduction of grid infrastructure in Oracle 11.2, ACFS also got introduced as part of grid. ACFS is a POSIX compliant general purpose cluster file system built on top of the ASM Dynamic Volume Manager (ADVM). ADVM provides so called volumes on which the ACFS can be created. An ADVM volume is created as part of an ASM disk group. Volumes are not partitioned which is equivalent to using LVM in a linux system.
In addition to using ACFS for shared Oracle Homes, it is used to store application data that previously could not be stored in ASM. For instance, external tables refer to directory files to load data from the file system to the database. If this directory file exists on the file system on the first node, a user trying to access the external table from the third node will not be able to do it. If we move this file to a directory on the ACFS mount, this problem is solved as the ACFS mounts are shared across all nodes.
Creating an ACFS using ACMCA
First create a diskgroup as described in the blog below.
Adding a new Shared disk group in RAC in VM Workstation 10sqlplus / as sysasm
SQL> CREATE DISKGROUP DG2 EXTERNAL REDUNDANCY DISK 'ORCL:DG2';
Diskgroup created. $ srvctl start diskgroup –g DG2
Once the diskgroup is created, you can create an ADVM volume and add it to the diskgroup created with the following command.
SQL> Alter diskgroup DG2 add volume VOL2 size 1G mirror strip _width 128k stripe_columns 4;
You can see the details of the volume created from the v$asm_volume view.
This view will give the details of the volume device created. Lets say it is /dev/asm/VOL2-777 and the volumne_name is ACFSDGVOL2
SQL} SELECT volume_name, state, volume_device FROM V$ASM_VOLUME
WHERE volume_name ='ACFSDGVOL2';
volume_name | state | volume_device |
---|---|---|
ACFSDGVOL2 | ENABLED | /dev/asm/VOL2-777 |
ASMCMD> volinfo -a
Diskgroup Name: DATA1
Volume Name: ACFSDGVOL2
Volume Device: /dev/asm/VOL2-777
State: ENABLED
Size (MB): 5120
Resize Unit (MB): 32
Redundancy: UNPROT
Stripe Columns: 4
Stripe Width (K): 128
Usage:
Mountpath:
The next step is to create a filesystem on the volume just created.
$/sbin/mkfs -t acfs /dev/asm/VOL2-777
We then create a mount point to mount the file system.
$mkdir $ORACLE_BASE/acfsmounts
$mkdir $ORACLE_BASE/acfsmounts/dg2_vol2
Login as root user to mount the filesystem created on the mount point.
$mount –t acfs /dev/asm/VOL2-777 /u01/app/oracle/acfsmounts/dg2_vol2
You can register the acfs with the mount registry with the following command.
$ /sbin/acfsutil registry –a /dev/asm/VOL2-777 /u01/app/oracle/acfsmounts/dg2_vol2
You can view the details of the filesystem created with the following command.
$ /sbin/acfsutil info fs
This filesystem can then be used like any normal linux filesystem.
df -k will give the details of the filesystem and the mountpoint.
Any directories or files created in the filesystem can be accessed on all other nodes of this filesystem.
# chown -R oracle:dba /u01/app/oracle/acfsmounts/dg2_vol2
You can create a test file and check if it is accessible on the other node.
For instance, on node 1, create a file as follows
# echo “Testing ACFS file system” > /u01/app/oracle/acfsmounts/dg2_vol2/acfsfile.txt
You can access this file on Node 2 as follows
# cat /u01/app/oracle/acfsmounts/dg2_vol2/acfsfile.txt.
The output will be
# Testing ACFS file system
No comments:
Post a Comment