Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
Could anybody please tell why this is happening? sqlplus command works in my user login, but when logged in as root, it won't work. I changed root's .profile to include oracle environment variables (root and user login have same lines). It's still not working. Any ideas?
Thanks

When you say "it won't work", do you mean that the shell cannot find sqlplus? If so, that means that $ORACLE_HOME/bin will not be in your $PATH. To confirm, from your root session: echo $PATH

My user environment is already set. I tried running a script in my account as root. It didn't execute as it has slplus in it.
I tried issuing echo $PATH, echo $ORACLE_HOME, echo $ORACLE_BASE etc ... as root and they returned valid values (Both at / and homedir as root).
Thanks

Sorry, I am still confused.
First, please confirm exactly will not work. Can the shell not find sqlplus, or what?
In your root session, you say that $PATH looks OK. Please confirm: Does $PATH contain $ORACLE_HOME/bin?
If $PATH is set up properly, the "which" command will be able to locate sqlplus. What do you get when you do:
which sqlplus

Hi,
This is what the .profile has (some key lines)
[code]
PATH=/usr/sbin:$PATH:/sbin:/home/root[/code]
[code]
ORACLE_HOME=/u01/app/oracle/product/8.1.7; export ORACLE_HOME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_SID=serva; export ORACLE_SID
PATH=:$PATH:.:/opt/perl5/bin:/opt/gcc/bin:/opt/softbench/bin:$ORACLE_HOME/bin:/bin:opt/bin:/opt/softbench/contrib/bin:/opt/emacs/bin:
export PATH
SHLIB_PATH=$ORACLE_HOME/lib:/usr/lib/Motif1.2:/usr/lib; export SHLIB_PATH
[/code]After I changed it, logged out, logged back in, I get the following. PATH doesn't show ORACLE. I guess something is wrong with pATH setting. Any idea? Thanks again.
# which sqlplus
no sqlplus in /usr/bin /usr/sbin /sbin# echo $PATH
/usr/bin:/usr/sbin:/sbin# echo $ORACLE_HOME
/u01/app/oracle/product/8.1.7# echo $ORACLE_BASE
/u01/app/oracle# echo $ORACLE_SID
serva

I can't see anything. Maybe PATH is getting re-declared after your declaration?
For trouble-shooting, right after your PATH declaration in .profile, I would put:
echo "PATH has just been set to:"
echo $PATHand at very end of .profile:
echo "PATH is:"
echo $PATH

In addition to my message above, the sqlplus command generally uses some shared objects. To get these .so (shared object) files at runtime, it serached them in the addresses mentione in the LD_LIBRARY_PATH environment variable. Can you please set it the same as in your user login and try again?
I hope it will work.
Jai Vrat Singh

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |