LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2008, 10:08 PM   #1
y2raza
LQ Newbie
 
Registered: Feb 2008
Posts: 25

Rep: Reputation: 15
how to set env variables for oracle 10g xe ??


iam new to both linux & oracle, when i try to run sqlplus from the shell it gives me this error

bash: sqlplus: command not found

i have figured that i have to set the envoirnment variables but how????

i will be very thankfull !!
 
Old 02-07-2008, 10:36 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
In ~/.bash_profile I have the following variables set up for a test instance of Oracle 10g:
Code:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
export ORACLE_HOME="$ORACLE_BASE/product/10.2.0/db_1"
export ORACLE_TERM="xterm"
export PATH="$PATH:$ORACLE_HOME/bin"
export LD_LIBRARY_PATH="$ORACLE_HOME/lib:$ORACLE_HOME/network/lib:/lib:/usr/lib"
export CLASSPATH="$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib"
These settings can be changed with a text editor, but you need to "source" the file for the settings to take effect (or log out and log in again).
Code:
$ vim ~/.bash_profile
$ source ~/.bash_profile
 
Old 02-08-2008, 07:07 PM   #3
y2raza
LQ Newbie
 
Registered: Feb 2008
Posts: 25

Original Poster
Rep: Reputation: 15
thanx

i really appreciate your help but i cannot seem to find the file you posted to edit that is bash_profile

so if any further info plz help
 
Old 02-08-2008, 09:42 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
From a terminal window, what do you get when you type this?
Code:
ls -l ~/.bash_profile
You can also do it this way (change username to your user name):
Code:
ls -l /home/username/.bash_profile
If the response is that the file doesn't exist, you can create/edit it with this (if you don't use vim, change that to whatever text editor you prefer):
Code:
touch ~/.bash_profile && vim ~/.bash_profile
 
Old 02-08-2008, 10:43 PM   #5
y2raza
LQ Newbie
 
Registered: Feb 2008
Posts: 25

Original Poster
Rep: Reputation: 15
did it

i did create a bash_profile & entered the path as follows

./usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

as told by the oracle website.

now the problem is that how should i make it avaiable for all users not just root and how should i have it so that it runs automatically bcz even now i have to type source ~/.bash_profile to be able to run sqlplus.

on top of it the sysdba i have to connect as follows

connect sys/passwd as sysdba;

if i do

connect / as sysdba

it gives me the error ORA-01031

so these are the problems i am facing so if u can further elaborate, u r my lifesaver!!!
 
Old 02-08-2008, 10:44 PM   #6
y2raza
LQ Newbie
 
Registered: Feb 2008
Posts: 25

Original Poster
Rep: Reputation: 15
i meant this path

source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.csh
 
Old 02-08-2008, 10:49 PM   #7
y2raza
LQ Newbie
 
Registered: Feb 2008
Posts: 25

Original Poster
Rep: Reputation: 15
after running source command

source ~/.bash_profile
bash: setenv: command not found
bash: setenv: command not found
bash: /bin/nls_lang.sh: No such file or directory
bash: setenv: command not found
bash: setenv: command not found
bash: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.csh: line 10: syntax error: unexpected end of file
root@ali-laptop:/home/ali# sqlplus
bash: sqlplus: command not found

this is what happened after i entered the path???
 
Old 02-09-2008, 02:21 PM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by y2raza View Post
i did create a bash_profile & entered the path as follows

./usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

as told by the oracle website.

now the problem is that how should i make it avaiable for all users not just root and how should i have it so that it runs automatically bcz even now i have to type source ~/.bash_profile to be able to run sqlplus.

on top of it the sysdba i have to connect as follows

connect sys/passwd as sysdba;

if i do

connect / as sysdba

it gives me the error ORA-01031

so these are the problems i am facing so if u can further elaborate, u r my lifesaver!!!
The '.' in the path does not look right. I think it should be /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin not ./usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

To make the change available for everyone, it should be in /etc/profile. If you're having to source ~/.bash_profile each time, it could mean that your shell is not /bin/bash. You can check this by searching for your username in /etc/passwd and looking at the value for the shell. The problems in the shell script should go away once you have the path set up correctly.

Also, I don't recommend running any oracle stuff as root - you really don't need to do that.
 
Old 02-11-2008, 06:21 PM   #9
y2raza
LQ Newbie
 
Registered: Feb 2008
Posts: 25

Original Poster
Rep: Reputation: 15
thanks for help

iam really thankfull for ur kind help, my friend told me about bashrc to which i was able to add the PATH which eventually enabled me to use sqlplus from the shell..

thanks again
 
Old 03-04-2008, 01:12 AM   #10
vish_panjabi
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
sqlplus error

iam new to both linux & oracle, when i try to run sqlplus from the shell it gives me this error

bash: sqlplus: command not found

i have figured that i have to set the envoirnment variables but how????

i will be very thankfull !!

Can anyone help me

Last edited by vish_panjabi; 03-04-2008 at 01:17 AM.
 
Old 03-04-2008, 01:27 AM   #11
vish_panjabi
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
This is my .bashrc file

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export PATH=$ORACLE_HOME/bin:$PATH
export TNS_ADMIN=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin
export ORACLE_SID=XE
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
 
Old 03-05-2008, 11:13 AM   #12
Robert0380
LQ Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 47
Any edits to your profile should really go in .bash_profile and not .bashrc

After making the changes in .bash_profile: source ~/.bash_profile or . .bash_profile (from your home directory)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot set LD_LIBRARY_PATH in .cshrc (able to set other env variables) senthilpr_in Linux - Newbie 4 02-26-2007 01:46 PM
RHAS 3.0 i64, Oracle 10g, Oracle RAC, and ASM xmdms Linux - Enterprise 10 01-06-2007 12:07 AM
env variables AbrahamJose Solaris / OpenSolaris 4 04-18-2006 01:31 PM
env variables ekdya Debian 3 03-14-2006 02:33 PM
where are the env variables set on boot? Pete Dogg Linux - Software 1 09-10-2003 03:37 AM


All times are GMT -5. The time now is 09:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration