Wednesday, February 27, 2008

Configure ASM Using Files Instead of Real Devices in Linux

Sharing this doc from metalink Note:266028.1
This document is for Users intending to test the ASM (Automatic Storage Manager). It explains how to set up ASM, if there are no free partitions on own disk or no free disk device is available. This set-up should be used for testing or educational purposes only.
Steps needed from Linux OS point of viewFirst step: create the files, which will be used as free devices for ASM. As oracle user you can create files using 'dd' command

1- Create virtual disk file with 'dd' command of size 1Gb
$ dd if=/dev/zero of=_file_disk1 bs=1k count=1000000
$ dd if=/dev/zero of=_file_disk2 bs=1k count=1000000
$ ls -l total 200208
-rw-r--r-- 1 oracle dba 1024000000 Mar 19 23:58 _file_disk1
-rw-r--r-- 1 oracle dba 1024000000 Mar 19 23:58 _file_disk2
2- Using 'losetup' command, we will associate a loop device with a file.This time, you need the root account to execute these commands:
# losetup /dev/loop1 _file_disk1
# losetup /dev/loop2 _file_disk2
3- ASM is able to pick up block devices - i।e। /dev/loopXXX - directly without involving 'raw' interface.
If you want to use the raw devices, you need to bind a raw device to an existing block device:
# raw /dev/raw/raw1 /dev/loop1 /dev/raw/raw1: bound to major 7, minor 1 #raw /dev/raw/raw2 /dev/loop2 /dev/raw/raw2: bound to major 7, minor 1

Change the ownership of the raw devices :-
# chown oracle:dba /dev/raw/raw1
# chown oracle:dba /dev/raw/raw2
# chmod 660 /dev/raw/raw1
# chmod 660 /dev/raw/raw2

No comments: