Resolving SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
If you set up Oracle Database XE 11G in Linux and you encounter the following error when starting up SQL Plus:
$ sqlplus
SP2-0667: Message file sp1.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
To resolve it try the following. It‘s assumed Oracle XE 11G is installed at:
/u01/app/oracle/product/11.2.0/xe/
If you have a different set up, adjust your directory path accordingly.
1) Find out the path to sqlplus
bash-3.2$ which sqlplus
/u01/app/oracle/product/11.2.0/xe/bin/sqlplus
2) Set your Oracle_HOME (upto xe directory)
bash-3.2$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe/
3) Set the path to the directory where sqlplus is located to your PATH variable:
bash-3.2$export PATH=/u01/app/oracle/product/11.2.0/xe/bin:$PATH
You should now be able to use sqlplus.
4) Now you need to edit youbash_profile so all these takes effect everytime you log in.
bash-3.2$ cd ~/
bash-3.2$ vim .bash_profile
5) In the .bash_profile you will need to add those export lines so every time you log in the same settings take effect.
bash-3.2$vim .bash_profile# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsORACLE_SID=XEexport ORACLE_SIDORACLE_HOME=/u01/app/oracle/product/11.2.0/xeexport ORACLE_HOMEPATH=$ORACLE_HOME/bin:$PATHexport PATHunset USERNAME
6) Run the following:
bash-3.2$ . .bash_profile
After following these 6 steps you should be able to connect to sqlplus any time.
原文:http://www.cnblogs.com/wincai/p/5850102.html