Scenario: you have a fibre channel and a couple of LUNs and you want to setup an ASM instance using those LUNs. Forget about ASMLib, just go with the raw (not the Smackdown
). We’ll use EMC as an example, but you can use any other manufacturer:
1. Check if you see the LUNs:
[oracle@Dgrnbdpitij06-old100 ~]$ ll /dev/emcpower*
crw-r–r– 1 root root 10, 62 Jul 15 05:18 /dev/emcpower
brw-r—– 1 root disk 120, 0 Jul 15 05:18 /dev/emcpowera
brw-r—– 1 root disk 120, 1 Jul 15 05:18 /dev/emcpowera1
brw-r—– 1 root disk 120, 16 Jul 15 09:11 /dev/emcpowerb
brw-r—– 1 root disk 120, 17 Jul 15 05:18 /dev/emcpowerb1
brw-r—– 1 root disk 120, 32 Jul 15 11:59 /dev/emcpowerc
brw-r—– 1 root disk 120, 33 Jul 15 05:18 /dev/emcpowerc1
$ ll /dev/emcpower*
crw-r–r– 1 root root 10, 62 Jul 15 05:18 /dev/emcpower
brw-r—– 1 root disk 120, 0 Jul 15 05:18 /dev/emcpowera
brw-r—– 1 root disk 120, 16 Jul 15 09:11 /dev/emcpowerb
brw-r—– 1 root disk 120, 32 Jul 15 11:59 /dev/emcpowerc
Nice. If you don’t, probably you’ve just created them using Navishpere and now either you need resync or just a good plain reboot.
2. No partitions please. Just raw-ger that!
$ sudo raw /dev/raw/raw1 /dev/emcpowerb
Password:
/dev/raw/raw1: bound to major 120, minor 16
We’re using just one device (LUN) called “emcpowerb” whereas the letter “b” means it’s the second LUN created at the fibre.
You can repeat the process, creating as many raw devices as you would want for the available LUNs.
3. Now setup your perms:
$ sudo chown oracle:oinstall /dev/raw/raw1
$ sudo chmod 666 /dev/raw/raw1
$ ll /dev/raw/r*
crw-rw-rw- 1 oracle oinstall 162, 1 Jul 16 09:33 /dev/raw/raw1
4. Create (if you haven't already) an ASM instance:
There are two methods (manual or DBCA), but I’ll recomend using DBCA just because it’s faster:
4.1. Startup the CRS Daemon
$ sudo /u01/app/oracle/product/database/10.2.0/bin/localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘root’..
Operation successful.
Configuration for local CSS has been initialized
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process…
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
myserver-01
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)
4.2. Get DBCA going
If you’re at the server console just type (as user “oracle”):
$ dbca
But you’re doing it remotly, just startup an X Emulator on your PC and type the following before invoking “dbca”:
$ export DISPLAY=<your_PC_ip_address>:0.0
After typing dbca you should see the following Welcome Screen:

Hit “Next” to go to the next screen:

In this screen choose the last option “Configure Automatic Storage Management” and hit “Next”:

In this screen you have to do 3 things:
- Type in an ASM password two times
- If you have a Grid Agent installed decide you would want to add this ASM instance as a target or not
- Hit the “ASM Parameters” button

At this screen type on the column “Value” in the second row the following text: “/dev/raw/*” (like on the image).
If you’re keyboard changed during editing this field just remember the / is where the “-” is, the delete is the back key and that the “*” is done with SHIFT+8.
Hit button “Close” and then the “Next” button:

Acklowledge this message and wait. In the meanwhile the following message will be displayed:

If the ASM Instance creation is successfull the following screen will appear:

Now you’ve successfully seted up ASM but it’s worth nothing unless you create diskgroups. To create the first one just hit the “Create New” button:

At this screen you will see right away the raw device because of the ASM parameter of the Disk Discovery Path was previously changed to “/dev/raw/*”. If you don’t see any raw devices at this screen try change the parameter by hitting the “Change Disk Discovery Path” button. If still you don’t see nothing, its because you have skipped or mistyped the “chown” or “chmod” commands previously. Check if the raw device has the permission stated before when we listed the raw devices. If there’s something you need to do again at the permissions level, exit DBCA, do whatever step you’ve skipped, and then invoke DBCA again, choose the last option and you’ll end up in the Disk Group creation screen again.
If you see the raw device use it to create a disk group called “TEST” and don’t forget to select “External” on the Redundancy area, since you only have one raw device you can’t produce redundancy at all!
Hit the “OK” button and you should see something like this:

And then back to the Disk Group creation screen:

You’re done! Exit and log on the database to test:
$ sqlplus / as sysdba
SQL> create tablespace my_asm_tbs datafile ‘+TEST’ size 5m;
Tablespace Created.
Done!
Now remember that you should create diskgroup with lots of disks instead of lots of disk groups with few disks.
Enjoy ASM!