Category Archives: DB

Oracle SNMP subagent

I had to pass through some hell in order to enable some SNMP Oracle functionality (Oracle 10g for Linux).

This post tries to give instructions for configuring Oracle SNMP features; it might be very boring (even for technical hardcore people), I post it mainly for spreading the knowledge. ("emsubagent" gives ~70 results in Google!)

Continue reading

An Embarrassing Linux-RAC bug

People who use RAC to control additional, non-oracle resources, probably also create a "Virtual IP" resource.

After patching 10.2.0.1 -> 10.2.0.3, the file usrvip (handles creation/deletion of Virtual IPs) gets two buggy lines:

ORACLE_HOME=%ORA_CRS_HOME%
ORA_CRS_HOME=%ORA_CRS_HOME%

Yes, it looks like windows, and yes, it doesn't work 😉

To fix it, just replace %ORA_CRS_HOME% with $ORA_CRS_HOME or put the actual path, depends if $ORA_CRS_HOME is available at that context.

I've learned some things from this issue:

1. Patching up does not always help to fix bugs, sometimes it creates them! (I know it's trivial, but first time I actually SEE that)

2. Open Source (this time it was a bash script), even non-GPL, is soo important. With hardly any mentioning on the net*, we could find the bug only by inspecting the VIP scripts.

3. Community developed software such as Linux-HA, would've fixed that in two days, I believe.

* Afterwards we've found out there's a relevant Metalink Note ID: 413077.1 , and that Oracle would fix that in 10.2.0.4.

Setting a raw device in RedHat/CentOS 5 for Oracle RAC

Apparently the issue got changed since RedHat 4, which had /etc/sysconfig/rawdevices, /etc/init.d/raw & /usr/bin/raw.

This version introduces /etc/udev/rules.d/60-raw.rules & /bin/raw.

A. Doing it manually (example):

/bin/raw /dev/raw/raw1 /dev/sdb1

of course, it'll be forgotten after reboot. so:

B. Doing it the right way - udev (example):

  1. Add to /etc/udev/rules.d/60-raw.rules:
  2. ACTION=="add", KERNEL=="sdb1", RUN+="/bin/raw /dev/raw/raw1 %N"

  3. [Optional] to set permissions, create a new /etc/udev/rules.d/99-raw-perms.rules containing lines such as:
  4. KERNEL=="raw[1-2]", MODE="0640", GROUP="oinstall", OWNER="oracle"

The header of rules.d/60-raw.rules file mentions that this method of using raw devices is deprecated. But still, I think that's the only available way if one wants to use raw devices with Oracle RAC, Either for cluster issues (Voting+OCR) or simple Oracle data files.

C. Oracle RAC raw device permissions

You might ask: what permissions should I give the Oracle RAC disks? This is what I've found out with Roman, a DBA expert who came to help:

  • OCR Device(s): root:oinstall , mode 0640
  • Voting device(s): oracle:oinstall, mode 0660
    • CRS cannot run if user oracle can't access the device!
  • Other devices (i.e. data): I guess also oracle:oinstall mode 0660, because oracle user might need to access them.

Disclaimer: I'm not a DBA expert; I hope this helps. Don't blame me if it ruins important data; send comments if you think I'm wrong/right.

Browsing Oracle ASM disks

ASM is Oracle's volume manager technology.

First it felt like a real voodoo: I created volumes but the OS cannot really access them (i.e. how the hell do I list the files, check out free space, etc).

Then a quick search revealed the very useful (RAC-builtin) command asmcmd which reminds of a crippled Unix shell, supporting ls, cd, du commands, and some more.

(Maybe someone wants to write a FUSE plugin to ASM, so we could actually mount it? 🙂 )