You are on page 1of 31

ASM Cluster File System (ACFS) in Oracle 11gR2

Oracle in 11gR2 extends the functionality of ASM and introduces a new ASM Cluster
File System (ACFS) based on ASM. ACFS is a general purpose cluster file system that
allows storing all type of data files in similar manner to any Linux file system for
example ext3. Oracle recommends using ASM for storing database files as it was
conceptually done since the first introduction of ASM in release10g. ACFS cannot be
used to install the Oracle 11gR2 Grid Infrastructure that is, Oracle 11gR2 also uses
ASM to store the Grid Infrastructure OCR and the voting disk if a shared file system
option is not used while installing Grid Infrastructure. ACFS can be used as a file
system for Oracle homes storing the Oracle binaries. In Oracle 11gR2 ASM is
already a part of the Grid Infrastructure and is installed with Grid Infrastructure in
comparison to earlier releases where ASM was part of RDBMS. Oracle 11gR2 new
features enable us to create, mount and manage ACFS using familiar Linux
commands. ACFS supports snapshots and dynamically online resizing of existing file
systems using internally ASM Dynamic Volume Manager (ADVM). ACFS is based on
volumes that are created in a disk group. Once created volume is identified by a
volume device, that is used by Linux to address the volume and this volume device
is used to create the ACFS. In the article we will look at how to create volumes and
ACFS based on the volumes. We will look at various ways to create ASM volumes
such as:

• ASMCA
• OEM
• ASMCMD
• sqlplus

To use and deploy ACFS the compatibility in ASM has to be at least 11.2 for ASM,
RDBMS and ADVM. The article is based on two node RAC cluster on OEL 5.5. All
utilities and commands will be executed while logged in as Linux user owner of
Oracle Grid Infrastructure. In order to create and manage ACFS Oracle Grid
Infrastructure must be started on the cluster as ADVM and ASM drivers and libraries
are loaded. Similar Approach can be used in Oracle Restart to manage ACFS though
there some limitations related to automatically performed tasks such as:

• Loading ACFS drivers


• Mounting ACFS systems registered with acfsutil utility.

In Oracle Restart the libraries and ACFS drivers need to be loaded using acfsload
start –s as a root user.

The latter does not need to be done if using RAC.

1. Using ASMCA for ACFS creation.


Start asmca from Linux command line. Once loaded all tabs will be available if the
ADVM drivers are loaded on all nodes of the cluster, otherwise the tabs will be
dimmed and not available for access.

Disk Groups tab shows the available disk groups along with their properties and
state. Here we can create new disk groups or mount or dismount existing disk
groups.
Volumes tab shows existing volumes and their properties and state. Here we can
create new volumes and respectively enable or disable existing volumes. Press the
Create button to create a new volume.
Enter the volume name, specify the disk group where the volume will be created
and specify the size of the volume.
Press Show Advanced Options if you want to modify the defaults.

Here we will keep the defaults and will press OK to continue. Wait for the volume to
be created.
Acknowledge the message for the successful completion.

The newly create volume ASM_VOL1 is listed in the Volumes tab.


Select the ASM Cluster File Systems tab. Here we see the existing ACFS. We will use
the newly created volume ASM_VOL1 to create a new ACFS. Press Create button.
As the volume is already created we select the ASM_VOL1 and specify General
purpose file system while leaving the default mount point.
Press Show Command to see the steps involved to create and register the ACFS.
Press OK to exit and OK to start the ACFS creation. Wait for the process to
complete.
The new ACFS based on ASM_VOL1 is created and listed in the ASM Cluster File
System tab.
Note that acfsutil registers and mounts the ACFS. Thus, after restart of the Oracle
Grid Infrastructure the ACFS will be mounted.

2. Using sqlplus to create an ACFS volume.

Invoke sqlplus while logged in as Linux user owner of Grid Infrastructure. Create a
volume ACFS_VOL2 with 2GB size as shown below. Query V$ASM_VOLUME for the
volume name and volume device. The output confirms that the volume is created
successfully.
3. Using ASMCMD to create an ACFS volume.

Invoke asmcmd while logged in as a Linux user owner of the Oracle Grid
Infrastructure. Use the asmcmd volcreate command to create a volume
ACFS_VOL1 with 1GB size in disk group DATA as shown in the example. Use the
asmcmd volinfo command to obtain information related to the newly created
volume ACFS_VOL1.
In similar fashion use the volinfo command to obtain information related to the
ACFS_VOL2 volume created with sqlplus.
Use the mkfs command to make the file systems based on the ACFS volumes that
we created with sqlplus and asmcmd. The –t option specifies that the file system is
ACFS type.
Create /u01/acfs1 and /u01/acfs2 directories. Use the acfsutil utility to register the
created ACFS file systems in the registry. The registry serves a similar purpose to
/etc/fstab in that the file systems get mounted automatically upon Oracle Grid
Infrastructure restart. The acfsutil needs the ACFS volume device and the mount
point. Note that, when registering an ACFS file system acfsutil mounts the ACFS file
system as well.
The new ACFS file systems /u01/acfs1 and /u01/acfs2 are now available.

We can dynamically resize the ACFS on the fly as shown below.

4. Resize ACFS file systems

The acfsutil utility can be used to resize the ACFS utility online. Look at the example
below.
5. Creating Snapshots

The acfsutil utility can be used to create a snapshot of the ACFS system. Upon
creation of ACFS file system a . ACFS directory is created as a subdirectory to the
ACFS file system. In the .ACFS directory there are two directories snaps and repl.
The snaps directory is used to store the snapshots. In the example below a
snapshot named snap1 is created for the ACFS mounted on /u01/acfs1. The
information for the snap1 snapshot is stored in /u01/acfs1/.ACFS/snaps/snap1. The
test confirms that ACFS snapshot behaves as expected as the snapshot cannot be
deleted if the current directory is the directory dedicated to store the snapshot
data.
Here we create a snapshot named snap1 for the ACFS system /u01/acfs1.
Automatically with the creation of the snapshot the existing file is transferred to the
snapshots directory /u01/acfs1/.ACFS/snaps/snap1. If the file is deleted then, it can
be restored from the snapshot. In the example we have an existing rpm file in the
ACFS file system /u01/acfs1. The snapshot snap1 is created. The rpm is transferred
to /u01/acfs1/.ACFS/snaps/snap1 directory. If we delete the rpm from /u01/acfs1 we
can always restore the file from the snapshot snap1.
The acfsutil utility can also be used to gather information about a specific ACFS file
system as specified in the example below.
The acfsutil utility can be used to query the content of the registry. Note that the
pupose of the registry is similar to /etc/fstab in Linux file systems that is, to ensure
that ACFS file systems are mounted either on node reboot or upon Oracle Grid
Infrastructure restart.
6. Using OEM Grid Control to manage ACFS

OEM Grid control can also be used to create and manage ACFS volumes and file
systems.

From the ASM page on OEM Grid Control navigate to Disk Groups tab.
We can see that the DATA disk Group is mounted. Navigate to ASM Cluster File
System.

Here we have different options to manage ACFS. Press Create button.


Press Create ASM Volume.

We will create a volume named ASM_VOLOEM with size 2GB within the DATA disk
group.
The Show Command button shows the SQL statement to create the volume. Press
Return to return to ACFS creation.

Upon successful volume creation we continue with ACFS creation. We specify the
directory to serve as a mount point (pre-created prior to ACFS creation), the volume
device and the volume label.
Show Command displays the steps to make the ACFS and to register it.

Return to the Create ASM Cluster File System page and press OK. Enter the Grid
Infrastructure Linux credentials for the creation and registration of the ACFS.
The ACFS is created. If it takes time to get mounted we can opt to mount it
explicitly. Select the newly created ACFS and press Mount button.

Specify the mount point. Press Generate Command to see the command.
Press Return.

The /u01/acfs3 ACFS based on ASM_VOLOEM volume is mounted as shown below.


We can use OEM Grid Control to resize the ACFS /u01/acfs3 from 2GB to 6GB. Select
the /u01/acfs3 ACFS and in the Actions choose Resize and press Go. On the page
that appears enter 6GB size as shown. Press Show Command.

This is the Linux command that will be executed as show below. Press Return and
Press OK to continue.
Enter the Oracle Grid Infrastructure owner credentials and press Continue.

OEM Grid Control resizes the ACFS as requested and we can see the result below.
The ACFS file system /u01/acfs3 is now 6GB from the initial size of2GB.
This concludes how to use the OEM Grid Control for managing ACFS.

Summary

We looked at the ASM volume creation using asmca, asmcmd, OEM Grid Control and
sqlplus. We created ACFS based on the ASM volume using mkfs. We explored the
acfsutil utility enabling ACFS management and registration. We resized online ACFS
file system and created a snapshot to restore files residing on ACFS using acfsutil
utility.

You might also like