LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-17-2005, 09:47 AM   #1
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Rep: Reputation: 30
env problem on Linux Redhat 2.1


Hi all,

I have problem with switching env from one to another. Any way, I tried to have two Oracle version on the same server, part of it when I am trying to set it up is change env from 9i to 10G

Below is env I have:

AGENT_HOME=/home/oracle/product/10.1.0/agent
BASH=/bin/bash
BASH_VERSINFO=([0]="2" [1]="05" [2]="8" [3]="1" [4]="release" [5]="i386-redhat-linux-gnu")
BASH_VERSION=$'2.05.8(1)-release'
CLASSPATH=/home/oracle/product/9.2.0/JRE:/home/oracle/product/9.2.0/jlib:/home/oracle/product/9.2.0/rdbms/jlib:/home/oracle/product/9.2.0/network/jlib
COLORS=/etc/DIR_COLORS
COLUMNS=80
CRS_HOME=/home/oracle/product/10.1.0/crs
DB10G_HOME=/home/oracle/product/10.1.0
DB9I_HOME=/home/oracle/product/9.2.0

....................
................
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
OLDPWD=/home/oracle
OPTERR=1
OPTIND=1
ORACLE_BASE=/home/oracle
ORACLE_HOME=/home/oracle/product/9.2.0
ORA_NLS33=/home/oracle/product/9.2.0/ocommon/nls/admin/data
OSTYPE=linux-gnu
PATH=/opt/IBMJava2-131/bin:/opt/IBMJava2-131/jre/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/oracle/bin:/home/oracle/product/9.2.0/bin:/home/oracle/bin
............................
..................................
........................



so I wrote a small bash file as follow:


#!/bin/bash
export ORACLE_HOME=$DB10G_HOME
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib:$ORACLE_HOME/network/jlib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/usr/openwin/lib
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export TMP=/usr/temp
export TMPDIR=$TMP
~




so when I run the bash, the env still pointed to 9i instead of 10G


1. what did I do wrong???? but when I do: export ORACLE_HOME=$DB10G_HOME on the command line, it works fine.

2. what is the differences between !#bin/bash and !#bin/ksh???? b/c at fitrst when I have !#/bin/bash, it tells me that wrong version.

Please advise

Last edited by ashley75; 03-17-2005 at 09:49 AM.
 
Old 03-18-2005, 07:51 AM   #2
Gecko
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Gentoo
Posts: 47

Rep: Reputation: 16
Have you tried using oraenv for your settings?
 
Old 03-18-2005, 08:15 AM   #3
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
No, How do you do that??? Could you please give me some instructions???
 
Old 03-18-2005, 08:24 AM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
How are you running the script? Are you using:
./scriptname
or
. ./scriptname

If you are using the first method, then your environment goes back to the original settings when the script exits. If you want to make them permanent, then putting them in your login scripts is a good choice.
 
Old 03-18-2005, 08:39 AM   #5
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
I think I want to use
./script_name b/c I want to reset the env everytime I log out of the server. and every time I log in the database server I have to run ./script_name to set the env.

coudl you please give me instructions of how to do that???
 
Old 03-21-2005, 08:03 AM   #6
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
If you are simply doing ./scriptname, then your environment is gone when the script exits. Do the following:
. ./scriptname

Notice the space between the periods. This will "source" the script to your current shell. When you exit the shell or logout, then the environment is gone.

They will be permanent if you put them in your login scripts.
 
Old 03-21-2005, 09:39 AM   #7
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
thanks
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing java runtime env problem ur-unholyness Linux - Software 2 04-10-2005 01:32 AM
question about Linux env ashley75 Linux - General 1 10-21-2004 09:00 AM
Environment Variable: how to change env DISPLAY in Redhat 9 lucastic Linux - General 2 07-21-2004 04:15 PM
change env on Linux ashley75 Linux - General 10 02-11-2004 04:23 PM
RedHat 7.3 PATH env variable problem NewRedHatter Linux - Newbie 4 09-01-2002 05:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:14 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
Open Source Consulting | Domain Registration