Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Setting Oracle Environmental Variables

Oracle Database Tips by Donald Burleson

In order to accomplish an Oracle install successfully, certain environmental variables are required. The following table lists the variables that are frequently set when using and installing Oracle Software.

ENVIRONMENTAL VARIABLE

DESCRIPTION

$LD_ASSUME_KERNEL 

This variable must be set in order to run many of the Oracle tools on Linux such as Universal Installer, dbca or netmgr.

$LD_LIBRARY_PATH

This variable allows many Oracle programs to find shared object library files.

$ORACLE_BASE

This variable is required to perform an install of Oracle software. It is used to indicate the base directory for all versions of Oracle software. Unless the administrator indicates otherwise, the oraInventory directory is located at $ORACLE_BASE/../oraInventory, and is the location in which Oracle catalogs its many installed components.

$ORACLE_HOME

Setting the $ORACLE_HOME is not necessary for a successful install. However, setting it will pre-determine the value displayed for a home directory which can then be edited. After Oracle software is installed, this variable helps Oracle find files. For example, to make a database connection, Oracle will look for the tnsnames.ora file in $ORACLE_HOME/network/admin, and $ORACLE_HOME is required to run many programs such as SQLPLUS and RMAN.

$ORACLE_SID

When this variable is set, the user does not need to type in a SID name in the connect string. For example,

sqlplus system/password@my_db

can be shortened to

sqlplus system/password.

Although it is possible to set $ORACLE_SID in the .bash_profile as a default, it is not necessary. It can be set on the fly with the racenv script.

$PATH

This variable is used by Linux to find executables. For example, in order to run sqlplus from a command prompt without typing in the entire path, you must include its directory path in this variable.

Table 4.4: Variables frequently set when using/installing Oracle

Setting Default Environmental Variables for the Oracle User

When a user logs into Linux, a few scripts are run to set things up. One such script is the .bash_profile script. Use the gedit ~oracle/.bash_profile command to open Oracle's login script.  Edit it so that the lines shown in Figure 4.13 are appended to the text.  

The export command is used to set an environmental variable. To refer to a variable that has been set in a script or a command, the variable must be preceded with a dollar sign. It is a common practice in BASHscripting to type variables in upper case letters. Remember, Linux is case sensitive, so $oracle_home is not the same variable as $ORACLE_HOME.

Using the suCommand from Oracle's Login

With the ~oracle/.bash_profile file in place, the environmental variables used by Oracle software will be in place. On occasion, the sucommand will be used to switch to the root user. Doing so will make the root login a child process of the Oracle login, and thus, the environmental variables will be inherited.

However, root's standard $PATH variable, the one root gets when root logs in directly, will not be there. Instead, root will get the Oracle user's $PATH variable, which is different. Thus, after using the sucommand to switch to root, commands such as chkconfig will need to include the full path: /sbin/chkconfig.

Oracle's Optimal Flexible Architecture

Optimal Flexible Architecture(OFA) is a directory structure created to assist the database administrator by keeping the many different files required to run Oracle software in predictable locations on disks.

Oracle touts many advantages to using OFA, but there are two advantages that are particularly important. First, implementing the OFA standard ensures that future administrators of the database will understand the file structure in place. This is a good reason to implement OFA using the exact directory names suggested by Oracle. Second, OFA makes adding new versions of Oracle software and switching between databases that use different versions of Oracle is possible and easy.

Figure 4.14 displays the OFAstructure for an installation with two versions of Oracle software installed and two working databases. The databases are named db9i and db10g, suggesting that each database is running on a different software version.

On a typical production database server, there would be many mount-points. The disk mounted at /u01 is used to store the software versions. The database data-files of the various databases would be stored on disks mounted at /u02, /u03 and higher.

Oracle made a change to OFAwith the release of Oracle 10g. Now, the $ORACLE_HOME for a 10g installation is kept in a sub-directory of 10.1.0. The sub-directory is called db_1. The reason for this change is that it allows for the install of the same product more than one time, such as creating a new 10g software install in the subdirectory db_2. It also allows for the install of a different Oracle product in a different sub-directory. For example, Oracle Client software could be installed in client_1.

To create the necessary directories for an Oracle 9i install, run the commands shown in Figure 4.15 on each node.

Important Oracle Files outside of the OFADirectory Structure

There is small number of files that Oracle places in locations outside of the OFA directory structure. After an install, the files listed in the following table will be shown. 

PATH AND FILE

DESCRIPTION

/etc/oratab  (9i)

/var/opt/oracle/oratab

     (user created link only - 10g)

The oratab file is used to identify each SID with its associated ORACLE_HOME.

/var/opt/oracle/srvConfig.loc (9i)

/etc/oracle/ocr.loc (10g)

This is a text file that identifies the location of the file used for cluster configuration and srvctl repository.

/etc/oraInst.loc (9i & 10g)

 

Identifies the location on disk of the Oracle inventory files and identifies the OS user group that owns the Oracle install. For a 10g install, this file is located in the $ORACLE_HOME directory.

/usr/local/bin/oraenv

/usr/local/bin/racenv

/usr/local/bin/coraenv

/usr/local/bin/dbhome

These scripts are used to set environmental variables. The oraenv and racenv scripts are Bash shell scripts used extensively in this book. The coraenv script is used in the C shell. The dbhome script is used by the other three scripts to identify the home directory associated with given database.

Table 4.5: Files shown, after an install.

Installing the Oracle Patch 3006854

The code depot of this book includes the Oracle Patch 3006854. Refer to Appendix B for download instructions. The Oracle 9i software install will fail if this patch has not been installed on each node. To install the patch, follow the example in Figure 4.16. Ensure that the gcc program is available.

If the patch failed, most system commands such as ls will now return an error, a major problem! Figure 4.17 demonstrates the error and what can be done to fix this error. The patch must still be successfully run so that the /etc/libcwait.so and /etc/ld.so.preload files exist on the file system.

Learn More about PC RAC:
 

If you want to learn RAC at home, get the bestselling book "Personal Oracle Real Application Clusters" by Edward Stoever.

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.