Oracle ASM on Linux with single Hard Drive

hunterjoy發表於2008-03-01

Automatic Storage Management (ASM) is a feature in Oracle Database 10g that provides the database administrator with a simple storage management interface that is consistent across all server and storage platforms. As a vertically integrated file system and volume manager, purpose-built for Oracle database files, ASM provides the performance of async I/O with the easy management of a file system. ASM provides capability that saves the DBAs time and provides flexibility to manage a dynamic database environment with increased efficiency. For more Information on ASM visit


Its quite easy to create raw devices on unix/linux for testing out the ASM feature provided by oracle 10g, however it is not recommended for the production environment. It works fine for me and tested ASM feature in Fedora. The following processes I followd to create virtual raw device on hard device.

Create directory to store the files

# mkdir /asm

Usedd command to create files full of zeros, if specifies the input path. of specifies the output path. bs sets both input and output block sizes to n bytes, count copies only n input blocks.

# dd if=/dev/zero f=/asm/disk1 bs=1024 count=2097152
# dd if=/dev/zero f=/asm/disk2 bs=1024 count=2097152
# dd if=/dev/zero f=/asm/disk3 bs=1024 count=2097152 

Here three files are created of Size 2GB each. Now change the ownership of the files on the /asm directory

# chown :: /asm/disk* 

losetup is used to associate loop devices with regular files or block devices.

# losetup /dev/loop1 /asm/disk1
# losetup /dev/loop2 /asm/disk2
# losetup /dev/loop3 /asm/disk3 

The final step is to associate the character block device with a raw block device. Use the raw command to make the association.

# raw /dev/raw/raw1 /dev/loop1
# raw /dev/raw/raw2 /dev/loop2
# raw /dev/raw/raw3 /dev/loop3
# chown oracle:dba /dev/raw/raw[1-3]

It always a best practice to zero out the first few megabytes of any raw partition to be used for Oracle ASM.

# dd if=/dev/zero f=/dev/loop1 bs=1024 count=10240
# dd if=/dev/zero f=/dev/loop2 bs=1024 count=10240
# dd if=/dev/zero f=/dev/loop3 bs=1024 count=10240

At this point, these are three (3) raw devices in the /dev directory, ready to be used by Oracle ASM. Note: All the loopback devices and association to raw devices are lost if the system is rebooted. If you want to make these persistent, place all of those above commands into /etc/rc.local.

For more information on ASM feature refer oracle documentation.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/543979/viewspace-198179/,如需轉載,請註明出處,否則將追究法律責任。

相關文章