top of page
Writer's pictureShashi Kallae

Oracle Environment Variables (oraenv)


ORAENV Variables. Illustration by Shashi Kallae
ORAENV Variables. Illustration by Shashi Kallae

Oracle parameters such as ORACLE_HOME, ORACLE_SID, NLS_LANG are specified in the Oraenv file. If you plan to use Oraenv file, you must follow certain Oraenv rules. Oracle environment Variables contain a list of Oracle Database environment variables useful to the Database Administrators. Still, the non-DBA users must set some variables per their application requirements. If the DBAspecic variables are placed in the non-DBA user's env profile, they will be ignored.


The file is divided into two parts: an executable part to set the required file links and a static part to define the environment variables. During program initialization, the env variables are read from the Oraenv file.


$ORACINST.INSTALL.P.DBA creates a template for the Oraenv file with the name sid.p.oraenv, where sid is the instance identifier. The generated file contains the default configuration of the Oracle Database, and you can edit this file according to your database needs. Non-DBA users can also generate and edit the Oraenv file as per their application requirements.

If you want the environment variables accessible, execute a call procedure command on the Oraenv file for the database you are using. Call the ORAENV file supplied (sid.P.ORAENV) by entering the CALL-PROCEDURE command on the ORAENV file. For example, to call the example ORAENV file for the database EXAMPLEDATA, enter the following command.

 /CALL-PROCEDURE EXAMPLEDATA.P.ORAENV

A word of caution: The DBAs must not modify or make any changes or updates to the Oraenv file while the database is running.

Non-DBA users can modify their custom Oraenv file anytime without any restrictions.

The executables of Oracle Database 19c are stored in a library called ORALOAD.LIB. Before running an Oracle program, you must assign this library to the link name ORALOAD. This link is created when the ORAENV procedure is called. An error message is displayed if the link ORALOAD is not defined properly.

The ORAMESG library, $ORACINST.ORAMESG.LIB is required for Oracle messages. This library is assigned the link name ORAMESG in the ORAENV procedure.


What happens if you do not generate an Oraenv file?

If you do not generate the ORAENV file, then the default values are used for all environment variables. Sometimes, environment variables have no default values, such as ORASID. If you start an Oracle Database program or utility without generating the ORAENV file, you cannot connect to the Oracle Database.


How do you generate the Oraenv file?

The ORAENV file is a text file with a BS2000 command procedure format. The command procedure calls itself using the /SET-FILE-LINK ORAENV filename command. Each line contains an Oracle Database environment variable and its assigned value. When reading this file, the Oracle Database ignores all lines with a slash symbol (/) or asterisk symbol (*) in column one.


You must generate an ORAENV file before using Oracle Database for the first time. Perform the following steps to generate an ORAENV file:


Call the INSTALL.P.USER procedure by entering the following command:

/CALL-PROCEDURE $ORACLEDATABASEUSER.INSTALL.P.USER

where $ORACLEDATABASEUSER is the name of Oracle Database 18X/19X/23X installation user ID.


You are prompted for the database system identifier, known as the sid.


Enter the value of sid. If you do not know the sid, consult your organization's database administrator.

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page