Friday, July 13, 2007

Setup ASM with Loopback device on FC6

First, this document is very helpfull for me:
Here are some steps that I was doing to try ASM on my notebook with Oracle10g R 2 on FC 6:
  • I create a disk image for 500M with this command (as root):
dd if=/dev/zero of=/disk2.img bs=516096c count=1000
dd if=/dev/zero of=/disk3.img bs=516096c count=1000

  • then i mount those disk image as local device, so that file will be threaded as phisycal disk
losetup /dev/loop0 /disk2.img
losetup /dev/loop1 /disk3.img


Note: if you want to detach loopback device from disk image, you can use this command:
losetup -d /dev/loop?
  • We should configure and run CSS (Cluster Synchronization Service) before configure ASM
$ORACLE_HOME/bin/localconfig add

that command will create init.cssd service in /etc/init.d and /etc/oracle directory store some information and location to store any information from cssd service.
You can call CSS service with this command:

/etc/init.d/init.cssd start
  • download the latest ASMlib source from OracleASM project. (please read some discussion at this). In that directory, there is no configure script, so I download ASMLib kernel module (oracleasm-2.0.3.tar.gz) and use configure script from that. The compilation is success. After make install, we will get /etc/init.d/oracleasm service script.
  • now, I have to make oracleasm kernel module is launched safely.
/etc/init.d/oracleasm configure
Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
Start Oracle ASM library driver on boot (y/n) [y]: n
Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Unmounting ASMlib driver filesystem: [ OK ]
  • in my case, kernel module oracleasm can't be found by modprobe -r oracleasm, so, I try to call with
insmod /lib/module/{kernel_version}/extra/oracleasm.ko

I changed modprobe -s "$MODNAME" command with insmod command like above.
  • To make our local loopback disk become ASM disk, I have to make ASM disk with /etc/init.d/oracleasm createdisk command :

/etc/init.d/oracleasm createdisk ASMD0 /dev/loop0
/etc/init.d/oracleasm createdisk ASMD1 /dev/loop1

With those command, there are trow ASMD* disk that will create in my /dev/oracleasm/disks. I can check with this command:
/etc/init.d/oracleasm listdisks
ASMD0
ASMD1

  • Based on dizwell.com blog, I should prepare ASM instance with these commands:
as oracle user, I create /tmp/init+ASM.ora that have some parameters declaration like these:
INSTANCE_TYPE=ASM
DB_UNIQUE_NAME=+ASM

LARGE_POOL_SIZE=8M


$ export ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL> create spfile from pfile='/tmp/init+ASM.ora';
SQL> startup nomount;
SQL> alter system set ASM_DISKSTRING=''/dev/oracleasm/disks/*';
SQL> shutdown;

  • now, I will configure ASM with dbca. I choose Configure Automatic Storage Management, and give the group disk with DGROUP1 and choose all of ASMD* as the members.

  • Now, with dbca I can create a new database which is using ASM as the database storage.
This is my first experience using ASM with loopback device as 'phisical' storage for Oracle. I still need to learn more about Oracle RAC. I have blogroll that may be can help you too to learn about OracleRAC. If you have any other great tutorial about this, please share with me. Thanks.

3 comments:

Anonymous said...

Cool blog as for me. It would be great to read more about that matter. The only thing it would also be great to see on this blog is a few photos of some gadgets.
Nickolas Karver
Phone Blocker

Unknown said...


OS : OEL 5.5 (32 bit)

# /etc/init.d/oracleasm configure
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 without typing an
answer will keep that current value. Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: oinstall
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 ]


Few lines missing, they are following below ?
what's the reason ? how can i solve it ?

Fix permissions of Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: [ OK ]
Creating /dev/oracleasm mount point: [ OK ]
Loading module "oracleasm": [ OK ]
Mounting ASMlib driver filesystem: [ OK ]

Anonymous said...

It is a very nice blog. Really it is a very international destination post. Thanks for sharing this post.
Website development company in Bangladesh