Error Message When Calling Oraenv Script From User Not In Dba/Oinstall Group

Normally when we run oraenv script from different user than oracle we usually get the below error:

[oratest@GI01 ~]$ . oraenv
ORACLE_SID = [oratest] ? testdb
ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID oratest.
You can set ORACLE_BASE manually if it is required.
[oratest@GI01 ~]$

Reason is quite simple, oracle does not allow accessing the files by other users. So we have to tweak few files and directories to make it work.

I checked the /usr/local/bin/oraenv file, which file need tweaking. and yeah i found something: Image

So the culprit is: $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml

When i saw the permission i came to know that this file does not have permission for other users. So finally i changed the permission for this file and all directories that contains it:

[oracle@GI01 ~]$ chmod 666 $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml

[oracle@GI01 ~]$ chmod 771 /u01/app/oracle/product/

[oracle@GI01 ~]$ chmod 771 /u01/app/oracle/product/

Thats it.

Now when i tried using oraenv file from other user than oracle. It worked like charm:

[oracle@GI01 ~]$ su – oratest
[oratest@GI01 ~]$ .
[oratest@GI01 ~]$ . oraenv
ORACLE_SID = [oratest] ? testdb
The Oracle base has been set to /u01/app/oracle
[oratest@GI01 ~]$

[oratest@GI01 ~]$ sqlplus / as sysdba

SQL*Plus: Release Production on Fri Apr 25 03:59:59 2014

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options


Thats it..

Hope it helps..

2 thoughts on “Error Message When Calling Oraenv Script From User Not In Dba/Oinstall Group

  1. It’s actually not the DBA group, it’s the oinstall group. So even if you are in the DBA group, you’ll still get the same errors. If you add the oratest user to the oinstall group then oraenv will work.

    1. Hi Richard,

      Thanks for your comment, however when i was checking it was not going through – putting oratest in oinstall group. But after your comment, i will check it again and get it verified.
      I appreciate it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: