Yesterday, I wanted to log on to an ASM instance of a recently installed 11gR2 RAC system. This should be as easy as logging in as the user who owns the clusterware home (grid) and executing this:
grid@sun1os:~$ export ORACLE_SID=+ASM1
grid@sun1os:~$ sqlplus sys/x as sysdba
SQL*Plus: Release 220.127.116.11.0 Production on Thu Aug 12 09:22:31 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
Excuse me? idle instance? The asm instance was clearly running (there was a database running on top of it, srvctl reported it to be running and so did ps), I triple-checked the ORACLE_SID environment but that was not it. Luckily, I found this blog entry that deals with a very similar problem. Long story short: This is what I had put in my .bash_profile file:
grid@sun1os:~$ which sqlplus
I have never had any problems with a double-slash in solaris before but apparently Oracle does not like this. The solution was obvious at this point. Simply remove the trailing slash in ORACLE_HOME and that was it.