Home » Infrastructure » Unix » oraenv script prompts for values when ORAENV_ASK set to no
oraenv script prompts for values when ORAENV_ASK set to no [message #629126] Wed, 03 December 2014 10:56 Go to next message
11gOP
Messages: 18
Registered: November 2014
Junior Member
When I put a reference to the oraenv script in a user's profile script the user gets prompted for a SID and ORACLE_HOME every time even when I set these before calling the script and set ORAENV_ASK=NO.

Here are the lines I've added:

export ORACLE_HOME=/opt/oracle/app/oracle/product/11.2.0/dbhome_1/
export PATH=$PATH:$ORACLE_HOME/bin
export ORAENV_ASK=NO
export ORACLE_SID=DB1
. /usr/local/bin/oraenv


What am I missing here?

[Updated on: Wed, 03 December 2014 10:57]

Report message to a moderator

Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629128 is a reply to message #629126] Wed, 03 December 2014 11:00 Go to previous messageGo to next message
gazzag
Messages: 1119
Registered: November 2010
Location: Bedwas, UK
Senior Member
What are the contents of /usr/local/bin/oraenv?
Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629129 is a reply to message #629126] Wed, 03 December 2014 11:03 Go to previous messageGo to next message
11gOP
Messages: 18
Registered: November 2014
Junior Member
I've not modified the contents, I've attached the file here for reference.
  • Attachment: oraenv.txt
    (Size: 4.92KB, Downloaded 3861 times)
Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629130 is a reply to message #629129] Wed, 03 December 2014 11:10 Go to previous messageGo to next message
gazzag
Messages: 1119
Registered: November 2010
Location: Bedwas, UK
Senior Member
What do the following commands return?

$ echo $SHELL
$ ps
$ whoami
Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629134 is a reply to message #629126] Wed, 03 December 2014 11:43 Go to previous messageGo to next message
11gOP
Messages: 18
Registered: November 2014
Junior Member
-bash-4.2$ echo $SHELL
/usr/bin/bash
-bash-4.2$
-bash-4.2$ ps
     PID    TTY  TIME CMD
 6684872  pts/1  0:00 ps
 7667962  pts/1  0:00 -bash
-bash-4.2$
-bash-4.2$ whoami
<username here>
-bash-4.2$

I'm not running this as the oracle user and the user isn't an administrative user.
Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629180 is a reply to message #629134] Thu, 04 December 2014 03:20 Go to previous messageGo to next message
gazzag
Messages: 1119
Registered: November 2010
Location: Bedwas, UK
Senior Member
Is DB1 running on the same server? What does this show you?

$ cat /etc/oratab
$ ps -eaf | grep pmon

Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629208 is a reply to message #629126] Thu, 04 December 2014 07:48 Go to previous messageGo to next message
11gOP
Messages: 18
Registered: November 2014
Junior Member
oratab is empty as I've not got around to creating any databases yet.
pmon returned this before I started the listener:

# ps -eaf | grep pmon
    root 8716496 8650802   0 13:41:10  pts/1  0:00 grep pmon
# 

but nothing after.

What exactly does the oraenv script do that I can't do with less hassle with some export statements? Is it necessary to have it in the login scripts for all the users?
Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629210 is a reply to message #629208] Thu, 04 December 2014 07:56 Go to previous messageGo to next message
gazzag
Messages: 1119
Registered: November 2010
Location: Bedwas, UK
Senior Member
Quote:

oratab is empty as I've not got around to creating any databases yet.

That's why it is prompting you for info. oraenv reads /etc/oratab for details of the database specified as ORACLE_SID.
oraenv

It is not necessary to have it in user profiles and, you're right, the same could be achieved manually. But then, so could most things scripts do Wink
Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629212 is a reply to message #629210] Thu, 04 December 2014 08:11 Go to previous messageGo to next message
gazzag
Messages: 1119
Registered: November 2010
Location: Bedwas, UK
Senior Member
More about oraenv from Oracle.
Re: oraenv script prompts for values when ORAENV_ASK set to no [message #629213 is a reply to message #629212] Thu, 04 December 2014 08:13 Go to previous message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator

... and do not use "root" for your test and to use Oracle. Use a normal account.

Previous Topic: setting passwords for configuration assistant accounts
Next Topic: Send file in the email attachment using shell script
Goto Forum:
  


Current Time: Fri Nov 22 16:16:09 CST 2024