Home » Infrastructure » Unix » Unable to use ORAENV_ASK in shell script (Oracle 9.2.0.6.0 on HP-UX B.11.23)
Unable to use ORAENV_ASK in shell script [message #433130] Mon, 30 November 2009 05:23 Go to next message
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 #433131 is a reply to message #433130] Mon, 30 November 2009 05:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Does dbhome exist in /usr/local/bin?
Have you /usr/local/bin in your default path?

Regards
Michel

[Updated on: Mon, 30 November 2009 05:33]

Report message to a moderator

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 messageGo to next message
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 #433139 is a reply to message #433135] Mon, 30 November 2009 05:55 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Is /usr/local/bin in your PATH variable?

Regards
Michel
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
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
Previous Topic: Shell script issue while finding files
Next Topic: Shell script
Goto Forum:
  


Current Time: Thu Mar 28 17:54:13 CDT 2024