Oracle environmental variables in shells script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Oracle environmental variables in shells script
# 1  
Old 10-15-2010
Oracle environmental variables in shells script

Hi,

Getting below error on executing the shell script which initiates sqlplus

Quote:
./test_oracle_conn_solaris.sh: line 43: sqlplus: command not
found
How to set oracle enviornment variables in the shell script ?

With Regards
# 2  
Old 10-15-2010
Simple:
Code:
var=value

It seems sqlplus is not in your PATH environment variable.

Try:
Code:
export PATH=${PATH}:${ORACLE_HOME}/bin

Or check where in your environment Oracle home is.

If ORACLE_HOME is not set, you can set it in your ${HOME}/.profile or ${HOME}/.bash_profile, you can set any variable in those files and they will be available in your environment.

Just don't forget, after adding the variables to reload your profile, with logout/login or ". ${HOME}/.profile" or ". ${HOME}/.bash_profile"

Regards.
This User Gave Thanks to felipe.vinturin For This Post:
# 3  
Old 10-15-2010
The best way (IMHO) to set the Oracle environment is to use the Oracle-provided oraenv script.

It saves you doing it manually, and ensures that the Oracle software and database versions match, in the event that you might have multiple Oracle versions installed.

Setting the ORACLE_HOME on its own will accomplish nothing without an ORACLE_SID. oraenv will set both.
This User Gave Thanks to Scott For This Post:
# 4  
Old 10-16-2010
Hi,

Your help is highly appreciated.

With Regards
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

<< Environmental Variables are not set when script completes >>

Hi Team, I have a wrapper script which i have pasted below, it internally calls one python script to generate Environmental in a file called /home/oracle/myenv.sh, when i execute this script via wrapper script, its not reflecting in my current session, still showing old env variables. any... (2 Replies)
Discussion started by: kamauv234
2 Replies

2. OS X (Apple)

Don't understand the practical difference between command aliases and environmental variables

Hey, I'm recently learning Unix from the video course by Kevin Scoglund. I'm stuck at the moment where he goes into Environmenat variables. I have some issues with understanding what's the essential difference between EV and command aliases: for instance, by writing the command alias ll='ls... (3 Replies)
Discussion started by: scrutinizerix
3 Replies

3. Shell Programming and Scripting

Help with manipulating environmental variables in UNIX

I am wondering if there is away to increment a date in c shell. What I need to do is basic, but I lack the knowledge. I have they following environmental variable in my job scripts setenv YYYY `date '+%Y'` I then set YYYY to be part of my output dataset name: setenv dd_OUTPUTP... (1 Reply)
Discussion started by: jclanc8
1 Replies

4. UNIX for Dummies Questions & Answers

SQL loader script - ORACLE environmental variable

I am new in unix.. I am running a sql loader script where I have to specify the data file path but the file name contains spaces in it so giving error multiple arguments I have tried it with "" and '' but does n't work the command is : $ORACLE_HOME/bin/sqlldr... (1 Reply)
Discussion started by: Sandip Dey
1 Replies

5. AIX

Best way to setup my own environmental variables ?

I am writing a few korn scripts to be used by all our operators on several 4.1/4.2 AIX servers. I want to create environmental variables that once set, can be read/modified by my scripts (ex: specific folders, file names, conventions, general values, ...). I thought this would be better then... (4 Replies)
Discussion started by: Browser_ice
4 Replies

6. Shell Programming and Scripting

[bash] command line substitution with environmental variables

Hi, I'm using an array that contains compiler FLAGS that need to be executed either before ./configure or after the main 'make' command. example of array containing compiler flags. ------------------------------------------------- FLAGS="CFLAGS=\"-arch x86_64 -g -Os -pipe... (7 Replies)
Discussion started by: ASGR
7 Replies

7. UNIX for Dummies Questions & Answers

Unix passing environmental Variables

In my script when I change an env variable in the parent shell it is only changed for that session - it there away to change it permanently using a script so that when I use rlogin (create a child session) that the env variable is set correctly? Basically what I am trying to do is to pass a... (7 Replies)
Discussion started by: belfastbelle
7 Replies

8. Shell Programming and Scripting

Set Oracle Environmental Variable !!

Can someone send me a shell script to set all Oracle environment variable which is working. I have the following script which works but not 100%. Please advice what you think is wrong. if # Command executed from a terminal then ORACLE_SID="" ... (4 Replies)
Discussion started by: uuser
4 Replies

9. Shell Programming and Scripting

Validating variables in shells script

All Can you help me to validate a variable only for string and digit. That is variable should either fully alphabets or digits. Please send me result to my mail id also: REMOVED Thanx in advance Regards Deepak Xavier (1 Reply)
Discussion started by: DeepakXavier
1 Replies

10. UNIX for Advanced & Expert Users

Environmental Variables - where stored ?

Hi all ! Yesterday I defined an environmental variable PATH, but today when I restarted machine, I could not see that it was stored any place. Is there any file where I could save the settings ? I have quite a few env.variables defined, so I need a smarter way to define. regards D (5 Replies)
Discussion started by: DGoubine
5 Replies
Login or Register to Ask a Question