LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to set env variables for oracle 10g xe ?? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-set-env-variables-for-oracle-10g-xe-619485/)

y2raza 02-07-2008 09:08 PM

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 !!

gilead 02-07-2008 09:36 PM

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


y2raza 02-08-2008 06:07 PM

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

gilead 02-08-2008 08:42 PM

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

y2raza 02-08-2008 09:43 PM

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!!!

y2raza 02-08-2008 09:44 PM

i meant this path
 
source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.csh

y2raza 02-08-2008 09:49 PM

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???

gilead 02-09-2008 01:21 PM

Quote:

Originally Posted by y2raza (Post 3051026)
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.

y2raza 02-11-2008 05:21 PM

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

vish_panjabi 03-04-2008 12:12 AM

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

vish_panjabi 03-04-2008 12:27 AM

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

Robert0380 03-05-2008 10:13 AM

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)


All times are GMT -5. The time now is 06:26 PM.