This is going to be my first post of Year 2010 so i am going to post about Oracle ASM (Automatic Storage Management) the super hit feature of Oracle10g database it has many benefits most commonly i m explaining here like
- Logical Volume management DBAs are not required to further think about the physical location of the indexes, tables etc etc.
- Performance of Raw Devices
- Centralized Storage management.
- Mirroring / stripping at DB level.
1. 2 Raw Partitions
- Not formatted with any file system i.e ext3 etc etc Minimum 3 GB each for basic software install one for data files and one for flash recovery area.
- Oracle recommends that you create a single whole-disk partition on each disk that you want to use.
- Use fdisk command to setup partitions run the partprobe command after partitioning all disks so your kernel will becomes aware of partition changes.
2. OS user oracle and group dba
#useradd oracle -g dba
Here are the Steps to follow
1. Download ASM Libs for your OS and Kernel from http://www.oracle.com/technology/tech/linux/asmlib/index.html
(In my case i have downloaded Redhat Linux AS 4 Kernel 2.6.9-34.EL)
2. Install ASMLibs in following order to avoid package dependency errors make sure you are logged in as root
install using this command (rpm -ihv i - install / -h --hash to display / -v verbose)
rpm -ihv package-namee.g
# rpm -ihv oracleasm-support-2.1.3-1.el4
# rpm -ihv oracleasm-2.6.9-34.EL-2.0.3-1
# rpm -ihv oracleasm-2.6.9-34.ELsmp-2.0.3-1
# rpm -ihv oracleasmlib-2.0.4-1.el4
3. After successfully installing all required ASM packages next is to configure ASMLibs run the following command as root
Output would be like this
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (''). Hitting
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface [oracle]: oracle
Default group to own the driver interface [dba]: dba
Start Oracle ASM library driver on boot (y/n) [y]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
Note: All ASM configuration will be stored at /etc/sysconfig/oracleasm
4. To enable ASM run the following command
# /etc/init.d/oracleasm enable
5.Labeling Disk with ASM run the following command
(i am using Volume Management as OS level so my device path is different)
# /etc/init.d/oracleasm createdisk disk-label device-path
# /etc/init.d/oracleasm createdisk DF1 /dev/sda2
# /etc/init.d/oracleasm createdisk DF2 /dev/mapper/VolGroup00-ASMDf
# /etc/init.d/oracleasm createdisk FRA1 /dev/mapper/VolGroup00-ASMFra
There u go we have completely configured our Linux system to use Oracle ASM still installation part is remaining.
Run Oracle database Installer and select software only then install ASM instance in separate Oracle HOME after that you can create database using dbca and select Automatic Storage Management to install ASM Instance. (I will write separate blog post for this installation procedure)
There are bunch of ASM related commands
Usage: oracleasm [--exec-path=
The basic oracleasm commands are:
configure Configure the Oracle Linux ASMLib driver
init Load and initialize the ASMLib driver
exit Stop the ASMLib driver
scandisks Scan the system for Oracle ASMLib disks
status Display the status of the Oracle ASMLib driver
listdisks List known Oracle ASMLib disks
querydisk Determine if a disk belongs to Oracle ASMlib
createdisk Allocate a device for Oracle ASMLib use
deletedisk Return a device to the operating system
renamedisk Change the label of an Oracle ASMlib disk
update-driver Download the latest ASMLib driver
For further info on ASM i recommend this book from Oracle Press.
Feel free to comment on this post if i missed something plz inform me. i hope this post will help someone to implement Oracle ASM