Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sqlplus not working

Status
Not open for further replies.
Mar 31, 2004
151
US
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
 
What errors are you getting when trying to run it?
 
Does your PATH env variable include the oracle bin directory?

I love deadlines. I like the whooshing sound they make as they fly by - Douglas Adams
 
Thanks for the responses. I found a solution: su - oracle.

At the root prompt, if I enter su - oracle and later sqlplus, it works.

Could anybody suggest how I could do this from a script? How to circumvent or include password? The script runs as a cron under root. Thanks.
 
if you're running as root you don't, I think, need to supply a password to su

there's also an option to su to specify a command to execute, write a shell script to do the job you want done and call that

Mike

"Deliver me from the bane of civilised life; teddy bear envy."

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
The reason for it not working under root is due to the owner and group of the file. If you do an ls -la on /$ORACLE_HOME/bin I would bet you it is owned by user oracle and group dba.
 
Hi,

The problem is the environment file. try doing that:

1> login as oracle
2> su root

at that stage, the root user inheriage the oracle user settings.

Regards,

Paul
 
If running as root You could use this in your script :

su - oracle << EOSQL

<sqlplus commands>

EOSQL
 
As for the original question...
You must also include the following PATH within the users (root) enviroment. (For Oracle 7 and 8 - not sure about 9)

LD_LIBRARY_PATH=/oracle/product/XXXX/lib
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top