HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong value in env PATH

 
SOLVED
Go to solution
Sam DeFilippis
Occasional Advisor

Wrong value in env PATH

Server = HPUX B.11.00 U 9000/800

I'm trying to install Oracle 8.1.7 in a new Oracle_home directory. I know it's obsolete but I have to follow an upgrade path to the newest Oracle version. I set my PATH variable in the oracle user .profile as :

PATH=.:$PATH:$ORACLE_HOME/bin:/usr/ccs/bin:/bin:/usr/bin:/etc/usr/ccs/bi
n:/usr/local/bin:/usr/scripts

($ORACLE_HOME=/u02/app/oracle/product/8.1.7)

It seems that the $PATH in the above .:$PATH setting is causing the problem.

My problem is that when I execute "env" when logged in as the oracle user, I get wrong directories, e.g. /main/app/oracle/product/8.1.6//bin. This is causing a problem in my Oracle installation.

Is there a way to change the $PATH in the .:$PATH string?

I have not found quite what I'm trying to do by searching this forum

$env gives me:

echo $PATH
.:.:.:.:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/etc:/jet/prod:/usr/local/bin:/usr/local/share/bin:/usr/local/lib:/opt/gcc/bin:/usr/bin/X11:/main/app/oracle/product/8.1.6//bin:/etc/usr/ccs/bin:/usr/scripts:/main/app/oracle/product/8.1.6//bin:/usr/ccs/bin:/bin:/usr/bin:/etc/usr/ccs/bin:/usr/local/bin:/usr/scripts:/main/app/oracle/product/8.1.6//bin:/usr/ccs/bin:/bin:/usr/bin:/etc/usr/ccs/bin:/usr/local/bin:/usr/scripts:/u02/app/oracle/product/8.1.7/bin:/usr/ccs/bin:/bin:/usr/bin:/etc/usr/ccs/bin:/usr/local/bin:/usr/scripts
OLDPATH=/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/contrib/bin:/usr/local/bin:/usr/local/share/bin:/usr/local/lib:/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/resmon/bin:/usr/sbin/stm/uut/bin/progs:/opt/pred/bin:/opt/hparray/bin:/opt/hpnpl//bin:/opt/ignite/bin

7 REPLIES
Emil Velez
Honored Contributor

Re: Wrong value in env PATH

set the PATH variable in the .profile in user oracle's directory.
Michael Steele_2
Honored Contributor

Re: Wrong value in env PATH

export PATH=$PATH:/usr/bin/sh

And as mentioned above, done in either /etc/profile or /home/user/.profile.
Support Fatherhood - Stop Family Law
Sam DeFilippis
Occasional Advisor

Re: Wrong value in env PATH

Thanks for the replies.

Not sure what you mean but from original post:

" I set my PATH variable in the oracle user .profile as :

PATH=.:$PATH:$ORACLE_HOME/bin:/usr/ccs/bin:/bin:/usr/bin:/etc/usr/ccs/bi
n:/usr/local/bin:/usr/scripts "

But I'm thinking that you are saying that I should not use the ".:$PATH" and just set the PATH variable in the oracle user's .profile to all of the required directories for the installation.

Is my understanding correct?

I'm not sure why the env command is giving me /main/app/oracle/product/8.1.6//bin , etc. , which is incorrect.
Patrick Wallek
Honored Contributor

Re: Wrong value in env PATH

>>I'm not sure why the env command is giving me /main/app/oracle/product/8.1.6//bin , etc. , which is incorrect.

Is your PATH getting set prior to ORACLE_HOME being set correctly?

If you 'echo $ORACLE_HOME', what is returned?

If the correct value is returned, then you may need to move your PATH statement farther down in your .profile so it gets set AFTER ORACLE_HOME gets set.
Matti_Kurkela
Honored Contributor
Solution

Re: Wrong value in env PATH

The $PATH refers to the current PATH setting as it exists before the statement in your .profile.

The system-wide default PATH setting for all sessions is defined in /etc/PATH file. Editing that file is allowed for the system administrator, as part of standard system customizations. If /etc/PATH includes the path to your old Oracle 8.1.6 binaries, that might be the root cause for your troubles.

Alternatively, your oracle user's .profile might have some other commands that set the old Oracle environment. For example, is "oraenv" mentioned at any point in your .profile?

Instead of adding to the existing PATH setting, you might explicitly revert to the system's default PATH and add to it. /usr/bin and /bin should definitely already be covered by the default PATH, so there is no need to re-add them. If your ANSI C compiler is installed using the standard installation procedure, /usr/ccs/bin and /etc/usr/ccs/bin should be included in the system's default PATH too. That leaves only /usr/local/bin and /usr/scripts.

PATH=.:$(cat /etc/PATH):$ORACLE_HOME/bin:/usr/local/bin:/usr/scripts

Mandatory Security Lecture:
Adding the current directory "." in the beginning of PATH is bad security and leaves you wide open for all kinds of between-users shenanigans. If your system is ever subject to a security audit, this will be one of the standard checks auditors will do, and you will probably be required to write a justification for it.

Using "." in PATH is bad enough as a regular user, but for root and the oracle user (which is effectively "root for the Oracle database world") it is almost inexcusable, especially if it's at the front end of PATH.
(End Lecture)

If you need to run multiple Oracle versions in parallel, it might be more convenient to set up a different user for each Oracle version. Leave the current "oracle" account for Oracle 8.1.6, and create a new user "ora817" for Oracle 8.1.7. Make it a member of the "dba" group, just like the "oracle" account is. This allows you to set up the environment from scratch, without destroying the old Oracle 8.1.6 settings until you're satisfied the new version works.

Note that the Oracle installer will offer to create new "oraenv" and "coraenv" scripts for you, typically in /usr/local/bin: if the Oracle 8.1.6 versions are in use, don't let the installer overwrite them.

MK
MK
Sam DeFilippis
Occasional Advisor

Re: Wrong value in env PATH

Again, thanks for the replies.

I do have the PATH variable getting set after ORACLE_HOME in the oracle .profile and the echo $ORACLE_HOME is correct.

Here is what the /etc/PATH looks like:
# more /etc/PATH
/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/contrib/bin:/usr/local/bin:/usr/local/share/bin:/usr/local/lib:
/opt/nettladm/bin:/opt/fc/bin:/opt/fcms/bin:/opt/upgrade/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/b
in/X11:/opt/resmon/bin:/usr/sbin/stm/uut/bin/progs:/opt/pred/bin:/opt/hparray/bin:/opt/hpnpl//bin:/o
pt/ignite/bin

I don't see the 8.1.6 directory specified in it so I am now even more puzzled.

I will take the advice of creating a completely new oracle user for the 8.1.7 install since that seems to be the cleanest solution.
Michael Steele_2
Honored Contributor

Re: Wrong value in env PATH

8.1.6 will be specified in the oracle adm's home dir. I.E, owner of the oracle file system? oradm, oraprd, oradev, etc.
Support Fatherhood - Stop Family Law