Previous | Table of Contents | Next

Page 102

NOTE
On UNIX machines, do not mix different versions of the Oracle software in the same Oracle directories. On Windows machines, do not mix 16- and 32-bit versions of the Oracle software in the same Oracle directories.

Oracle software is usually installed on the server using an operating system account created specifically for the task. This userid, by default named oracle, must have complete rights to all of the Oracle directories (including those used for software installation and Oracle datafile storage) and files. In an OFA-compliant server configuration, this users home directory will be the /mount/app/oracle directory. It is important that the oracle account is secured from unauthorized access. In most environments, access to this account compromises the security of the entire database environment.

In the following sections, we explain the components of the Oracle directory structure. In particular, we look at what the Oracle home is, how server structures differ between UNIX and Windows NT platforms, and how different versions of Oracle software can coexist on UNIX and Windows NT platforms.

ORACLE_HOME Sweet Home

The top of the Oracle directory tree is referred to as the Oracle home. It is defined on the server as an environment variable or Registry setting named ORACLE_HOME and is a mandatory configuration parameter. Many Oracle executables use the ORACLE_HOME variable to locate shared code, configuration files, and so forth. For example, on a UNIX server, an Oracle program may look for a configuration file in $ORACLE_HOME/network/admin, rather than in
/u01/app/oracle/network/admin.

NOTE
Some Oracle environment variables, such as TNS_ADMIN, override the default $ORACLE_HOME directories used to locate files.

The ORACLE_HOME directory should be set upon database login by either the user login script, Registry values, or ini file values, depending on your architecture. Other environment values, such as LD_LIBRARY_PATH (on UNIX systems) and PATH, should refer to the $ORACLE_HOME variable previously set. This enforces one of our OFA rules where hard- coded directory values are set only in one administrative location.

Running Multiple Versions of Oracle on UNIXWhen a database is started, the value of the ORACLE_HOME variable determines what version of the Oracle server executable and libraries is used to open the database. By manipulating and controlling the value of ORACLE_HOME, you can define what version of the Oracle software is used. This is how multiple versions of Oracle databases can be run simultaneously on the same server. The following shows a sample Oracle directory structure (on a UNIX server):


/u01/app/oracle/product
                 7.1.6
                      bin
                     rdbms
                       [...]

Page 103

                7.3.3
                   bin
    	          rdbms
                    [...]
               8.0.3
                    bin
                   rdbms
                     [...]

In this example, three versions of the Oracle database are installed in an OFA-compliant directory structure. At any one time, multiple databases running multiple versions of the server executables can be operating. If a DBA logs in and sets his or her ORACLE_HOME to /u01/app/oracle/product/7.1.6, the database he or she starts will be running the version 7.1.6 server executables. If the DBA logs in and sets his or her ORACLE_HOME to /u01/app/oracle/product/8.0.3, he or she will use the 8.0.3 server executables.

There are two versions to keep in mind when working with the Oracle environment:

These versions are separate and distinct from each other. Oracle does not perform version checking between the server executables and the database. For example, you will not receive errors from starting a database at version 7.1.6 with the version 7.3.3 software. When multiple versions of Oracle are installed on the same server, care must be taken to not mix the software and Oracle versions.

NOTE
In a UNIX environment, by default the ORACLE_HOME and related environment variables are set upon database login by prompting the user for the preferred SID, looking up that SID in the oratab file, and setting the ORACLE_HOME to the value found for that SID in oratab. In a Windows environment, ORACLE_HOME is read from the Registry or ini file.

Running Multiple Versions of Oracle on Windows NTBecause of the architectural differences between UNIX and Windows NT servers, running multiple versions of Oracle Server software on a Windows NT server is handled differently than on its UNIX counterpart. An instance on a Windows NT server is implemented as a service, with the background processes created as multiple threads spawned by the service process. The service gets all of its configuration information from the server Registry. Because there is only one Registry with one set of values on a Windows NT server, there can be only one ORACLE_HOME defined on the server at any one time. This means running multiple versions of Oracle software on a Windows NT server cannot be handled by manipulating the ORACLE_HOME environment variable.

To circumvent this design and allow multiple Oracle versions to exist on a single Windows NT server, all of the version-specific directories, executables, and files have the major version number appended to them. For example, the Oracle server executable of a version 7.2.3 database on a Windows NT server is named oracle72.exe, while the 7.3.3 version is named oracle73.exe. Likewise, the rdbms directory is named rdbms72 or rdbms73, and Oracle utilities such as tkprof or Export are named tkprof72 on a 7.2 database or exp73 for database version 7.3.

Page 104

NOTE
Because of this naming convention, having multiple minor versions of the Oracle software installed at the same time is unsupported. For example, Oracle version 7.3.2 and version 7.3.3 software both have the same suffix of _73 on their directories and files and would therefore be unable to coexist on the same Windows NT server. Because of the confusion and therefore possible accidents this causes, avoid running multiple versions of Windows NT on the same server when possible.

Oracle supplies a utility to switch Oracle homes on 16-bit Windows clients and versions of Windows 95 and Windows NT machines. This is not the same as operating with multiple ORACLE_HOME directories. All this program does is change all directory references in the init.ora or Registry from one location or another. This does allow you to install and test software in multiple ORACLE_HOME directories, but it does not allow programs to run from separate ORACLE_HOME directories simultaneously.

16-bit Windows software uses the oracle.ini file to set the Oracle software configuration variables. 32-bit Windows software uses the HKEY/LOCAL_MACHINE/SOFTWARE/ORACLE registry key to set Oracle environment variables. Because of this, both 16- and 32-bit versions of Oracle software can coexist on a 32-bit Windows operating system. It is recommended that you use different ORACLE_HOMES (orawin and orawin95 or orant, by default), managed separately by their respective ini file and Registry settings, to avoid problems with shared code discrepancies between the versions.

Programs and drivers written for 16-bit Oracle software are unable to operate with 32-bit versions, and vice versa. You'll often see this in relation to programs that use SQL*Net, such as ODBC drivers, as well as third-party programming tools that rely on Oracle-supplied libraries and DLLs. In these situations, simultaneously running the 16- and 32-bit versions of the Oracle software is the only way to keep everything working smoothly.

The ORACLE_HOME Directories

As stated before, the ORACLE_HOME variable points to the top level of the Oracle software directory tree. ORACLE_HOME contains other directories, each of which contains Oracle files or more directories. The directories located within ORACLE_HOME are fairly standard in all Oracle installations, and each directory contains files for specific programs or functionality. Table 7.3 lists some of the important directories found in an Oracle installation, as well as
their purpose.

Table 7.3 Important ORACLE_HOME Directories and Usage


Directory Name Usage
BIN Oracle executables and shared DLLs
DBS Oracle server files and default directory for init.ora files
DATABASE Starter database and default Oracle database files (Windows NT)
RDBMS Database files

Previous | Table of Contents | Next