Saturday, August 20, 2011

Setting the Oracle Environment for various Oracle Database versions

Hi,
When in we install different Oracle Software in our machine.It is very important we set the correct PATH and ORACLE_HOME environment variables in order to connect them always.Below is one such way which will be helpful.

Error messages:

C:\Windows\system32>sqlplus
Error 6 initializing SQL*Plus
Message file sp1.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

Pre-requistic step:

On Windows OS:

Delete the environment variable 'PATH' by going to computer=>properties=>Advanced
system properties=>Advanced=>Environment variable=>path and delete this Click OK.

On linux OS:
We have to remove the 'PATH' variable from .bash_profile or we can set separate .bash_profile for each Oracle Database versions and we have to use export in place of set command.

C:\>set ORACLE_HOME=
C:\>set PATH=%ORACLE_HOME%\bin;%PATH%
C:\>set ORACLE_SID=
C:\>sqlplus "/ as sysdba"

Oracle 11g:

Pre-requistics step:Make sure you started the services for Oracle 11g listener
and Database in your machine(services.msc at run prompt and start Oracle 11g listener and Database services).

set ORACLE_HOME=D:\app\RafiAlvi\product\11.2.0\dbhome_1
set PATH=%ORACLE_HOME%\bin;%PATH%
set ORACLE_SID=ORCL
sqlplus "/as sysdba"

Oracle 10g:

Pre-requistics step: Make sure you are started services for Oracle 10g listener and Database in your machine.

set ORACLE_HOME=D:\oracle\product\10.2.0\db_1
set PATH=%ORACLE_HOME%\bin;%PATH%
set ORACLE_SID=TESTDB
sqlplus "/as sysdba"

Hope it helps.


Best regards,

Rafi.





No comments:

Post a Comment