Unable to use ORAENV_ASK in shell script [message #433130] |
Mon, 30 November 2009 05:23 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Hi,
I am trying to set ORACLE environement (SID, HOME) in a shell script but I am getting an error
I am trying to set it it shell as following (example script)
#!/usr/bin/ksh
export $ORACLE_SID=DB01
ORAENV_ASK=NO
. /usr/local/bin/oraenv
ORAENV_ASK=YES
sqlplus -s system/<pwd> << eof >/u04/scripts/logs/arch_curr.log
alter system archivelog current;
eof
exit
I am getting following error
/u04/scripts/arch_curr.sh[4]: dbhome: not found
ORACLE_HOME = [] ? /u04/scripts/arch_curr.sh[7]: sqlplus: not found
I have checked the /etc/oratab as well and DB01 has proper entry init alongwith ORACLE_HOME
what could be the issue?
Thanks and Regards,
Chetana
|
|
|
|
Re: Unable to use ORAENV_ASK in shell script [message #433135 is a reply to message #433130] |
Mon, 30 November 2009 05:39 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Thanks Michel
Yes, dbhome exists as following
oracle@dev2:/home/oracle $ls -ltr /usr/local/bin
total 48
-rwxr-xr-x 1 oracle sys 2417 Jun 8 2007 dbhome
-rwxr-xr-x 1 oracle sys 2316 Jun 8 2007 coraenv
-rwxr-xr-x 1 oracle sys 2559 Jun 13 2007 oraenv
oracle@dev2:/home/oracle $ls -ltr /usr/local/bin/dbhome
-rwxr-xr-x 1 oracle sys 2417 Jun 8 2007 /usr/local/bin/dbhome
oracle@dev2:/home/oracle $
Regards,
Chetana
P.S. sorry I wasn't sure about which (section of ) forum I will raise this quetsion to and thanks for moving it to appropriate one
|
|
|
|
Re: Unable to use ORAENV_ASK in shell script [message #433153 is a reply to message #433130] |
Mon, 30 November 2009 06:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
chetanaZ
Messages: 132 Registered: October 2009 Location: UK
|
Senior Member |
|
|
Superb!!
The /usr/local/bin wasn't in the PATH variable
After adding it in shell script as following it is working fine now
export ORACLE_SID=SY2KU2
export PATH=$PATH:/usr/local/bin
ORAENV_ASK=NO
. /usr/local/bin/oraenv
ORAENV_ASK=YES
Many Thanks Michel... It was a great help!!
Regards,
Chetana
|
|
|