Using OUI or DBCA, ASM instances can be
graphically created over the RAC cluster.
It is also possible to create the
instances manually by creating ASM
initialization parameter files and adding the
instances to the cluster.
Once ASM has been configured, adding diskgroups
can be done in DBCA, in Enterprise Manager, or
at the SQL prompt.
Using DBCA is extremely simple; the DBA
must enter a name, a redundancy option, and
choose the disks that will be part of the ASM
diskgroup.
Creating ASM diskgroups at the SQL prompt is
much the same, but the selections must be made
through commands.
For example:
CREATE DISKGROUP DATA
EXTERNAL REDUNDANCY
DISK 'ORCL:DATA1',
'ORDL:DATA2';
This command will create a diskgroup called DATA
that contains the disks marked DATA1 and DATA2
by ASMlib.
It is also possible to specify a search string
for the location of the disks:
CREATE DISKGROUP DATA
EXTERNAL REDUNDANCY
DISK '/dev/rdsk/*';
Redundancy
In the above examples, the EXTERNAL REDUNDANCY
clause was used.
This means that ASM will provide no extra
redundancy support and, therefore, cannot help
in the case of disk failure.
This is usually an option only when using
RAID
1 (mirroring).
However, redundancy can be set up within
ASM using failure groups.
Failure groups allow a DBA to specify two pools
of disks that can hold copies of each other's
data.
ASM allows NORMAL redundancy, in which a diskgroup is composed of two
failgroups, or HIGH redundancy, in which a
diskgroup is composed of three failgroups.
When files are written to the ASM diskgroup
under NORMAL
redundancy, the files will be written to both
failgroups in a round-robin fashion. Files are
read from the primary failgroup.
For example:
CREATE DISKGROUP DATA
NORMAL REDUNDANCY
FAILGROUP failgrp1 DISK
'/dev/sdb1', '/dev/sdb2'
FAILGROUP failgrp2 DISK
'/dev/sdc1', '/dev/sdc2';
In this example, a file will first go to
failgrp1 and be copied to failgrp2.
The next file will be written to failgrp2
and copied to failgrp1.
In Oracle 11g, the DBA can also specify Fast
Failure Repair options.
This means that if a disk in a failgroup
is damaged, Oracle can repair the damaged
portion of the disk instead of cloning all files
to the disk from scratch.
A repair time must be set as an attribute
of an ASM diskgroup, specifying how long Oracle
should keep the information necessary to rebuild
a
damaged disk.
For example:
ALTER DISKGROUP DATA SET
ATTRIBUTE 'disk_repair_time' = '3H';
This command will change the maximum repair time
of the DATA diskgroup to three hours, as opposed
to the default of 3.6.
Another new feature of 11g AS< is preferred read
groups.
An ASM parameter called
asm_preferred_read_failure_groups
can be set per instance.
This means that one instance in a
two-node cluster
can read primarily from one set of mirrored
disks, and the other instance can read from
another set of mirrored disks.
There are other new features of ASM in Oracle
11g that are outside the scope of this book.
For more information about these
features, please consult Oracle 11g New Features
by Rampant Tech Press.
RAC Using NFS with Direct NFS (DNFS)
Oracle 11g comes with enhanced support for
Oracle over NFS using the new Direct NFS
feature.
Direct NFS allows for costs savings by
sticking with one connection model: the network.
This allows for multipathing and unified
storage.
In addition, Direct NFS even works in
Windows, even though Windows has no NFS support.
Another nice feature of NFS is that files are
directly accessible via standard OS commands
like ls, mv, cp, and such.
Lastly, Oracle's Direct NFS feature allows for
Direct I/O and Asynchronous I/O by default. To
use Direct NFS, the client must be installed on
RAC nodes.
This can even be performed on nodes where
Oracle RAC is already running.
The Oracle 11g Direct NFS Client is shipped with
Oracle 11g.
Once installed, it is very simple to put
it in place:
Stop any RAC databases
-
Navigate to
$ORACLE_HOME/lib
-
Move the
libodm11.so file to a backup
-
Create a symbolic link called
libodm11.so which uses
libnfsodm11.so as its source
ln -s libfsodm11.so
libodm11.so
-
Start the RAC databases
Direct NFS information can then be queried from
the following fixed views:
-
v$dnfs_channels
-
v$dnfs_files
-
v$dnfs_servers
-
v$dnfs_stats
Note:
Oracle 11g Direct NFS only works with NFS V3
compatible NAS devices.
NFS must be set up at the OS level before using
the Direct NFS client.
Each OS has different requirements for
configuring and using NFS.
Conclusion
There are many options for data storage in a RAC
environment.
This is much different from the days
where the only options were raw volumes or third
party cluster file systems.
With these options, it is possible for
the DBA and System Administrators to work
together to find an optimal environment for
their RAC cluster.