To perform the check, he issues the
following SQL:
SQL> select compatibility,
database_compatibility
2 from v$asm_diskgroup
3 where name = 'ACFSDG1';
Code Listing 1: Using mkfs to create the file system
mkfs -t acfs -b 4k /dev/asm/acfsvol1a-153
mkfs.acfs: version = 11. 2.0.1.0.0
mkfs.acfs: on-disk version = 39.0
mkfs.acfs: volume = /dev/asm/acfsvol1a-153
mkfs.acfs: volume size = 1073741824
mkfs.acfs: Format complete.
COMPATIBILITY DATABASE_COMPATIBILITY
————————————————— ——————————————————————————————
11. 2.0.0.0 11. 2.0.0.0
If the result had shown something other
than 11. 2, he would have had to set the
compatibility to 11. 2 by issuing the following
series of SQL statements:
SQL> alter diskgroup acfsdg1 set
attribute 'compatible.asm' = ' 11. 2';
Code Listing 2: Verifying that the file system is mounted
mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid= 5,mode=620)
/dev/sda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/asm/acfsvol1-153 on /acfsdir1 type acfs (rw)
Diskgroup altered.
SQL> select volume_name, volume_device
2 from v$asm_volume;
directory named /acfsdir1, as the root user,
as shown below.
SQL> alter diskgroup acfsdg1 set
attribute 'compatible.rdbms' = ' 11. 2';
Diskgroup altered.
SQL> alter diskgroup acfsdg1 set
attribute 'compatible.advm' = ' 11. 2';
Diskgroup altered.
Next John creates the Oracle Automatic
Storage Management dynamic volume. He
mentions the four different ways to accomplish this task: using regular SQL statements, using the ASMCMD command line,
using the ASMCA utility, and using Oracle
Enterprise Manager. To keep it simple, John
shows everyone the approach that involves
regular SQL.
To create a 10 MB volume called
ACFSVOL1A, John issues the following SQL:
alter diskgroup acfsdg1 add volume
acfsvol1a size 10M;
Afterward he confirms that the volume
was correctly created, by checking a view
called V$ASM_VOLUME, in which the
volume will appear if it was created successfully. The following query confirms that the
volume was successfully created:
VOLUME_NAME VOLUME_DEVICE
——————————————— —————————————————————————————
ACFSVOL1A /dev/asm/acfsvol1a-153
ACFSVOL1B /dev/asm/acfsvol1b-153
CREATING AN ORACLE AUTOMATIC
STORAGE MANAGEMENT CLUS TER
FILE SYS TEM
The preceding ALTER DISKGROUP statement initiated an action that created an
Oracle Automatic Storage Management
dynamic volume file as well as an associated Linux dynamic volume device that
is directly addressable by the operating
system. (The name of the device is shown
in the VOLUME_DEVICE column of the
V$ASM_VOLUME view.) This device
enables Linux to identify the Oracle
Automatic Storage Management volume
as a device and makes it possible to create
a file system on the volume by using the
mkfs command. John demonstrates this
by issuing the command shown in Listing 1
to create a file system on the Oracle
Automatic Storage Management volume.
The -t flag in the mkfs statement indicates that the file system should be of type
acfs. Note that although the mkfs statement
prepared the volume to be mounted as a
file system, it did not actually mount it. To
mount the file system, John first creates a
mkdir -p /acfsdir1
He then mounts the file system /acfsdir1,
using the regular Linux mount command:
mount -t acfs /dev/asm/acfsvol1a-153
/acfsdir1
To verify that the file system was
mounted properly, he then uses the mount
command shown in Listing 2.
The output clearly shows that Linux
has mounted the file system /acfsdir1.
Once the file system is mounted, users can
access /acfsdir1 as a regular file system.
John then changes the directory ownership
to oracle by issuing the following Linux
command:
chown oracle:dba /acfsdir1
With this command, the oracle user can
now read from and write to this file system.
Furthermore, because Oracle Automatic
Storage Management Cluster File System is a
regular file system, any application can now
access files on this file system without any
special access mechanisms.
And John has accomplished everything
without any additional software. Everyone
breathes a sigh of relief.