2021-09-03 1554661
1554661 - Configuration of environment for 'oracle' user
Version 10 Type SAP Note
Language English Master Language German
Priority Recommendations / Additional Info Category Installation information
Release Status Released for Customer Released On 16.03.2020
Component BC-DB-ORA ( Oracle )
Please find the original document at https://launchpad.support.sap.com/#/notes/ 1554661
Symptom
Oracle software owner 'oracle'
For SAP installations on UNIX, the Oracle database (DB) software and the Oracle
grid infrastructure software are installed with the 'oracle' operating system
user as of Release 11.2. This occurs as soon as Oracle Automatic Storage
Management (ASM) or Oracle Real Application Clusters (RAC) is used.
As of Release 12c, Oracle software can generally be installed under the 'oracle'
user on Unix platforms. This user concept is called 'Oracle Standard'. For more
information about the topic of the user concept, see SAP Note 1915323.
Software management vs. database administration
Normally, the 'oracle' user should be used only for the installation of Oracle
software (basis release, patch sets, patches, and Oracle Home Gold Images), not
for the administration of databases (DBs) and DB instances or ASM instances.
Therefore, 'oracle' has no environment variable configured by default for a
certain DB instance or ASM instance because dedicated administration users
should be set up for routine administration of SAP NetWeaver Oracle databases.
To use the 'oracle' user to administer an ASM instance or a DB instance, you
must first set its environment properly.
This SAP Note describes how you can use the Oracle scripts 'oraenv' or 'coraenv'
to configure the proper environment for access to a certain Oracle DB instance
or Oracle ASM instance.
Other Terms
RUNINSTALLER
oraenv, coraenv, dbhome, orabase
.dbenv.sh, .dbenv.csh
Reason and Prerequisites
This SAP Note is valid for the Oracle database Versions or Releases 11.2.0.1,
11.2.0.2, 11.2.0.3, 11.2.0.4, 12.1.0.2, 12.2.0.1, 18c, and 19c.
This SAP Note applies only to Unix/Linux platforms.
This SAP Note can be used for SAP installations for which the Oracles database
software is installed with the user 'oracle'.
Solution
The following text describes how you can use the scripts oraenv and coraenv to
configure the environment (PATH, ORACLE_SID, ORACLE_HOME, ORACLE_BASE) for a
certain instance (DB or ASM).
© 2021 SAP SE or an SAP affiliate company. All rights reserved 1 of 4
2021-09-03 1554661
Setting of the Oracle environment with the scripts 'oraenv' and 'coraenv'
When you install the Oracle software, the scripts oraenv (for Bourne Shell and
Bash) and coraenv (C Shell) are installed in <ORACLE_HOME>/bin. In addition, they
are also copied to the local bin directory /usr/local/bin by the script root.sh by
default.
Using the name of the <ORACLE_SID> instance, oraenv determines the relevant
<ORACLE_HOME> Oracle home using the oratab entry, and it sets the environment
variables ORACLE_SID, ORACLE_BASE, ORACLE_BASE, ORACLE_HOME, and PATH
accordingly, as well as the relevant variable for the library search path
(LD_LIBRARY_PATH, LIBPATH, SHLIB_PATH). oraenv uses <ORACLE_HOME>/bin/orabase
from <ORACLE_HOME>/inventory/ContentsXML/oraclehomeproperties.xml to determine the
relevant value for a particular <ORACLE_HOME> for ORACLE_BASE.
oratab
The scripts oraenv/coraenv function only if the entries in oratab are also
correct. If you used DBCA or Database Ugrade Assistant (DBUA), you should check
oratab at the end and adjust it if necessary, depending on whether <IHRDBMS> or
<OHRDBMS> should be set.
Depending on the used shell, use the script 'oraenv' (Bourne shell) or 'coraenv'
(C shell) to set the Oracle environment for a specific Oracle instance.
Shell Command Example:
Bourne Shell
OS> . oraenv ORACLE_SID = [<current
(sh) Bash
% . oraenv value>] ? +ASM The Oracle base remains
(bash) Korn
unchanged with value /oracle OS>
Shell (ksh)
OS> source /usr/local/bin/coraenv
% source ORACLE_SID = [<current value>] ?
C shell (csh)
/usr/local/bin/coraenv <ORACLE_SID> The Oracle base has been
set to /oracle OS>
Table: Use of 'oraenv' or 'coraenv'
You can suppress the interactive query of ORACLE_SID by setting the environment
variable 'ORAENV_ASK=NO'.
Setting the Oracle environment with your own scripts
Instead of oraenv and coraenv, you can also use dedicated, user-specific scripts
that are not based on the entries in the oratab file to set the environment.
They must be adjusted accordingly, depending on changes made to the environment,
such as the installation of a new Oracle home or after a DB upgrade.
Examples
'.dbenv_<DBSID>' for DB instances
'.dbenv_ASM' for the ASM instance
Attachment
Configuration file oratab
The general format of an oratab entry looks as follows:
<ORACLE_SID>:<ORACLE_HOME>:N
© 2021 SAP SE or an SAP affiliate company. All rights reserved 2 of 4
2021-09-03 1554661
Only one entry may exist for an <ORACLE_SID> Oracle instance. For RAC databases,
not the name of the Oracle database instance <ORACLE_SID> but the name of the
Oracle database <DBNAME> is entered. To enable logging on to an RAC instance
<ORACLE_SID>, the correct <ORACLE_SID> must first be set in the environment.
Entries in oratab with <IHRDBMS> or <OHRDBMS>
When a DB is created using the Database Configuration Assistant (DBCA) and when
a DB is upgraded using the Database Upgrade Assistant (DBUA), a corresponding
entry with the respective <ORACLE_HOME> or <ORACLE_SID> is made in oratab. The
installation path <IHRDBMS> of the Oracle database software is always entered as
<ORACLE_HOME>.
If you want oraenv or corenv to set the runtime environment <OHRDBMS>
(recommended), you must enter the SAP-specific runtime path instead <OHRDBMS> of
the installation path <IHRDBMS>. For explanations about <IHRDBMS> and <OHRDBMS>,
see SAP Note 1524205.
Examples
Release 11.2.0.4 12.1.0.2 12.2.0.1
ASM
+ASM:/oracle/GRID/11204:N +ASM:/oracle/GRID/12102:N +ASM:/oracle/GRID/12201:N
instance
DB
instance
C11:/oracle/C11/11204:N C11:/oracle/C11/12102:N C11:/oracle/C11/12201:N
with
<IHRDBMS>
DB
instance
C11:/oracle/C11/112:N C11:/oracle/C11/121:N C11:/oracle/C11/122:N
with
<OHRDBMS>
Table: oratab entry for Oracle Releases 11.2.0.4, 12.1.0.2, 12.2.0.1
Release 18c 19c
DB instance with <IHRDBMS> C11:/oracle/C11/18.0.0:N C11:/oracle/C11/19.0.0:N
DB instance with <OHRDBMS> C11:/oracle/C11/18:N C11:/oracle/C11/19:N
Table: oratab entry for Oracle Releases 18c, 19c
This document refers to
SAP Note/KBA Title
527843 Oracle RAC support in the SAP environment
1693680 Running SAP Software on Oracle SuperCluster
1627541 BR*Tools support for Oracle ASM and Exadata/ODA
1598594 BR*Tools configuration for Oracle installation using user "oracle"
1590515 SAP Software and Oracle Exadata
© 2021 SAP SE or an SAP affiliate company. All rights reserved 3 of 4
2021-09-03 1554661
1550133 Using Oracle Automatic Storage Management (ASM) with SAP NetWeaver based Products
1524205 Oracle 11.2.0: Database Software Installation
This document is referenced by
SAP Note/KBA Title
2588918 SWPM fails with ORA-12537: TNS:connection closed
2449323 SWPM requests Oracle RAC parameters for non-RAC installations
2847437 Older Versions: SAP Software and Oracle Exadata
2132322 Troubleshooting oraenv / coraenv / dbhome
1598594 BR*Tools configuration for Oracle installation using user "oracle"
527843 Oracle RAC support in the SAP environment
1524205 Oracle 11.2.0: Database Software Installation
1627541 BR*Tools support for Oracle ASM and Exadata/ODA
1550133 Using Oracle Automatic Storage Management (ASM) with SAP NetWeaver based Products
1590515 SAP Software and Oracle Exadata
1760737 SAP Software and Oracle Database Appliance 2.x
1693680 Running SAP Software on Oracle SuperCluster
Terms of use | Copyright | Trademark | Legal Disclosure | Privacy
© 2021 SAP SE or an SAP affiliate company. All rights reserved 4 of 4