Scenario:
Today one of the DBA requested to have the ASM instance based on raw devices. I provided the below as a quick demo.1- Create the partition for the attached storage.
[root@PK3-IUB-RV-OD03 etc]# fdisk -l
Disk /dev/sda: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 13054 104751832+ 8e Linux LVM
Disk /dev/sdb: 536.8 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 2491 20008926 83 Linux
# raw device bindings
# format:
#
# example: /dev/raw/raw1 /dev/sda1
# /dev/raw/raw2 8 5
/dev/raw/raw1 /dev/sdb1
3- Restart the rawdevices service
[root@PK3-IUB-RV-OD03 sysconfig]# service rawdevices restart
Assigning devices:
/dev/raw/raw1 --> /dev/sdb1
/dev/raw/raw1: bound to major 8, minor 17
done
[root@PK3-IUB-RV-OD03 ~]# chkconfig rawdevices on
4- Run the following commands and add them the "/etc/rc.local" file.
[root@PK3-IUB-RV-OD03 sysconfig]# chown oracle:oinstall /dev/raw/raw1
[root@PK3-IUB-RV-OD03 sysconfig]# chmod 600 /dev/raw/raw1#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
chown oracle:oinstall /dev/raw/raw1
chmod 600 /dev/raw/raw1
Note:
The rawdevices service can only initialize devices named according to the /dev/raw/rawN format. However, devices in this location do not have the correct ownership or permissions for an Oracle database file by default. Additionally, because these device names are owned by the dev package, each time the package is updated (for example, as part of an operating system update), all devices are recreated with the default ownership and permissions at boot. It is therefore necessary to set ownership and permissions each time the dev package is updated.
1 comment:
Dear Bro,
Great work, keep it up...
You are resolving different scenarios for common dba tasks.
May Allah give you reward for this.
Cheers.
Ali
Post a Comment