Dear
Readers,
My
name is Franz Devantier, creator of this blog. I am an Oracle Certified
Professional (OCP DBA 11g) Security DBA.
I will be sharing with you the basic duties of an Oracle DBA, and also
some of the undocumented, and not so well known tasks.
Oracle Grid
Infrastructure – Part 4
Configuring Disks
for Oracle Automatic Storage Management Using the Automatic Storage Management
Library Driver (ASMLIB)
To do this we need to install
and configure the ASMLIB software, Configure the Disk Devices to use ASMLIB, be
able to administer the ASMLIB and disks.
Now that is quite a task list, so let’s give it a go.
Installing and
Configuring the ASMLIB Software
Firstly you should determine
the kernel version and architecture of the system you are on.
$ uname –rm
Secondly make sure that you
have the required ASMLIB packages available.
oracleasm-support-<version>.<arch>.rpm
oracleasm-<kernel>-<version>.<arch>.rpm
oracleasmlib-<version>.<arch>.rpm
You can download them from http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html
Make sure that you download
the correct packages.
<version> should be the
version of ASMLIB driver
<arch> should march
your system architecture verify against
(uname -rm)
<kernel> is the version
of the kernel that you are using
Thirdly you can install the
packages:
$ rpm -Uvh oracleasm-support-<version>.<arch>.rpm \
oracleasm-<kernel>-<version>.<arch>.rpm \
oracleasmlib-<version>.<arch>.rpm
Fourthly you need to
determine the UID of the Oracle software owner, as well as GID of the OSASM
group.
$ id oracle
Fifthly, you must run the
oracleasm initialization script
$ /etc/init.d/oracleasm
configure
Next you will need to enter
values for the prompts that the above script displays.
Prompt
|
Possible Response
|
Default
UID to own the driver interface:
|
Specify
the UID of the Oracle Grid Infrastructure owner user, which by default may be
grid.
|
Default
GID to own the driver interface:
|
Specify
the GID of the OSASM group which by default may be asmadmin.
|
Start
Oracle Automatic Storage Management Library driver on start (y/n):
|
Recommended
to enter y to start the Oracle
Automatic Storage Management library driver when the system starts.
|
Scan
for Oracle ASM disks on boot (y/n):
|
Recommended
to enter y to scan for the presence of
any Oracle Automatic Storage Management disks when the system starts.
|
Configuring the
Disk Devices to Use the Oracle ASMLIB Driver
If you are going to use IDE,
SCSI, or RAID devices in your ASM disk group then you should:
=> if needed, install or
configure the disk devices intended for the disk group and restart the system.
=> Identify the device
name for the disks that you are going to use.
$ /sbin/fdisk –l
The device name will probably
vary, depending on the type of disk.
Disk Type
|
Device Name
Format
|
Description
|
IDE
disk
|
/dev/hdyn
|
Here
“y” identifies the IDE disk, and “n” is the partition number. The first disk on the IDE bus
could be something like: /dev/hda
|
SCSI
disk
|
/dev/sdxn
|
Here
“y” identifies the SCSI disk, and “n” is the partition number. The first disk on the first
SCSI bus: /dev/sda
|
RAID
disk
|
/dev/rd/cxdypz/dev/ida/cxdypz
|
RAID
devices can have different device names, depending on the RAID controller. Here
“x”
is a
number that identifies the controller, “y” is a number that identifies the disk, and “z” is a number that identifies
the partition. The second logical drive on the first controller: /dev/ida/c0d1 They are numbered from 0 of course.
|
=> Create a
single whole-disk partition on each disk that you are going to use.
You can use fdisk
for this task.
=>
Mark the disk as an Oracle Automatic Storage Management disk with a disk-name
of DISK1.
$
/etc/init.d/oracleasm createdisk DISK1 /dev/sdb1
If you are using a
multipathing disk driver with ASM, then you must make sure that you specify the
correct logical device name for the disk.
Although the disk names must start with an uppercase letter, they can
also contain uppercase letters, numbers and the underscore character
Remember that if
you are going to create a database during the installation of the Oracle
software, using ASMLIB driver, then you must change the default disk discovery
string to ORCL:*
Administering the
Oracle ASMLIB Driver and Disks
You should use the oracleasm
initialization script, to administer the ASMLIB driver and disks.
Option
|
Description
|
configure
|
You
can reconfigure the Oracle ASM library driver, with this option.
$
/etc/init.d/oracleasm configure
|
Enable
/ disable
|
You
can modify the behaviour of the ASMLIB driver when your system starts. The “enable” option will cause the ASMLIB
driver to load when the system starts.
$
/etc/init.d/oracleasm enable
|
Start
/ stop / restart
|
You
can use these options to start or stop or restart ASMLIB driver without
restarting the system.
$
/etc/init.d/oracleasm restart
|
createdisk
|
This
option will mark a disk device for use with ASMLIB driver, and also give it a
name.
$
/etc/init.d/oracleasm createdisk <DISKNAME> devicename
|
deletedisk
|
You
must first drop the disk you want to process from the ASM disk group.
deletedisk
will then unmark
a named disk device:
$
/etc/init.d/oracleasm deletedisk <DISKNAME>
|
querydisk
|
In
order to determine if a disk device or disk is being used by ASMLIB driver.
#
/etc/init.d/oracleasm querydisk {<DISKNAME> | devicename}
|
listdisks
|
To
list disk names of all the marked ASMLIB driver disks.
$
/etc/init.d/oracleasm listdisks
|
scandisks
|
This
option will enable cluster nodes to identify which shared disks have been
marked as ASMLIB driver disks on other nodes.
$
/etc/init.d/oracleasm scandisks
|
Franz
Devantier,
Need
a database health check?
Classifieds