Monday, June 13, 2016

Connected to idle instance while database is up

While database is up , whenever i would like to connect database with sqlplus it gives me "Connected to idle instance" message.ORACLE_SID enviroment variable seems true by checking pmon process with this command

[bash$]# ps -ef | grep pmon
oracle   30607     1  0 Jun09 ?        00:01:35 ora_pmon_testdb

[bash$]# echo $ORACLE_SID
testdb

But ORACLE_HOME enviroment variable is not the same as that the instance was started with.Oracle user which owns the database has ORACLE_HOME enviroment variable

/oracle/product/11.2.0/dbhome_2

But instance was started with ,

/oracle/product/11.2.0/dbhome_2/

In order to check which enviroment variables has been used when Oracle instance started ,following commands give detail.These commands are run with root user.

Pid of process is determined at OS level,
[bash$]# ps -ef | grep pmon

Enviroments of process (pmon) are get

[bash$]# cat /proc/<pid of process taken above>/environ

Output of above command gives all detail about enviroment variable of smon process.ORACLE_SID,ORACLE_HOME,ORA_CRS_HOME can be seen at output.In my case i have seen ORACLE_HOME env variable was with slash at the end of variable.After setting ORACLE_HOME with slash on oracle user , I can be able to login to the instance.