Once ASMlib is completely configured, the root
user can apply the
/etc/init.d/oracleasm script to
create new ASM disks using block devices.
Other nodes in the cluster can then scan
for these disks and become aware of them. In
order to label disks as ASM disks, the following
command can be used:
/etc/init.d/oracleasm
createdisk DISKNAME /dev/path
-
DISKNAME
- The ASM label for the disk.
The name chosen does not matter, but
it is a good idea to choose names logically
that will help with management down the
road.
-
/dev/path
- The path to the block device to be
labeled.
For instance,
/dev/sdb1 is a block device
that ASM could label for its own use.
Figure 3.2:
Creating ASM Disks with Oracleasm
After the disks have been created, verify the
disk labels with the
listdisks
parameter:
# /etc/init.d/oracleasm
listdisks
DATA1
DATA2
DATA3
It is a good idea to get sysadmins used to the
idea of querying disks to make sure they are not
being used for ASM before performing any
possibly harmful actions against the system's
disks.
The
querydisk argument can be used for
this purpose:
/etc/init.d/oracleasm
querydisk /dev/path
Figure 3.3:
Querying Disks with Oracleasm
If the queried device is not an ASM disk, then
FAILED will be displayed between the brackets.
In a RAC configuration, all nodes must be able
to see the same ASM devices.
The good news is that one does not have
to go through the creation of disks with ASMlib
on each system in the RAC cluster.
However, one must install ASMlib on each
node.
Once disks have been created on one node, the
other nodes can be updated using the
/etc/init.d/oracleasm scandisks
function.
Using the
scandisks argument will instruct
oracleasm to browse the
/dev tree to find devices which
have been labeled for use by ASMlib.
Figure 3.4:
Scanning Disks on Other Nodes with Oracleasm
Note:
Even though disks have been tagged as being
ASM disks, one must still add the disks into
an ASM diskgroup as described in an upcoming
section.
Windows
On Windows, ASM disks will incorporate logical
drives set up using the Windows Disk Management
tool (Start
à
All Programs
à
Administrative Tools
à
Computer Management).
These drives should contain no filesystem
and should not be assigned a drive letter.
ASM can be configured during the installation of
Oracle 11g or later through DBCA.
In Windows, the Stamp Disks button allows
the DBA to select logical drives that should be
used for ASM.
Much like ASMlib, disks that are
available as candidate devices can be labeled as
ASM drives.
Note:
While stamping disks, one may notice the OCR
and voting disks in the list.
These disks will have a status of
“Oracle raw device file” while available
disks will say “Candidate device.”
Once disks have been stamped as ASM candidates,
it will be possible to add them to an ASM
diskgroup.
All disks will have a prefix of
\\.\ORCLDISK plus any prefix added while
stamping.
For instance, during labeling, if the DBA
elects to use a prefix of FLASH, labeled disks
will take the format \\.\ORCLDISKFLASH# where #
is an incrementing number.
Other OS – HPUX, AIX, Solaris
Each OS has its own way of representing disks.
In HPUX, AIX, and SOLARIS, there is
usually a block device and character device pair
that can be used.
On Solaris, for instance, two directories exist
in the
/dev tree:
The
/dev/dsk location is known as a
block device: a single slice or partition of a
disk.
/dev/rdsk, on the other hand, is a
character device, which is the logical
representation of the slice. When creating ASM
disks, these character devices will be
referenced.
The location of character devices depends
upon the OS:
Note:
Multipathing can change the location of
character devices depending upon the system
used.
Consult the specific documentation to
find the path to use for character devices.
Symbolic Links
Symbolic links can be used to ease management.
For example:
ln -s /dev/sdb1 /dev/ocr
ln -s /dev/sdb2 /dev/voting
This allows logical names to be referenced
during setup and makes changing paths/devices
easier.