Oracle8i Client Administrator's Guide Release 2 (8.1.6) for Windows Part Number A73017-01 |
|
This chapter describes the concepts of multiple Oracle homes and Optimal Flexible Architecture (OFA) for Oracle8i Client.
Specific topics discussed are:
When you install an Oracle database, you are installing one of the largest applications that your computer can support. Using multiple Oracle homes and OFA provides many advantages when administering large databases. The following advantages are the most important:
This section provides an overview of multiple Oracle homes. It includes the following topics:
An Oracle home corresponds to the environment in which Oracle products run. This environment includes the following:
Oracle homes also have a name associated with them, which you specify along with their location during installation.
The main benefit of using multiple Oracle homes is that you can run multiple releases of the same products concurrently. For example, you can test a release 8.x.x database patch before you run your production database release 8.x.x against it.
Modifications to multiple Oracle home functionality have occurred since it was introduced in release 8.0.4. This table helps you determine the capabilities of your Oracle home depending on the release you are using.
You can use one listener for spawning connections to databases for multiple Oracle homes. You only need to add all the System Identifiers (SIDs) to the SID_LIST section in the ORACLE_BASE\ORACLE_HOME\NETWORK\ADMIN\LISTENER.ORA file.
Because the SID is unique to a system across different Oracle homes, the listener can spawn the database thread for a specific SID in the correct Oracle home, and the ORACLE_HOME parameter (used in UNIX environments only) is not needed in the LISTENER.ORA.
This section describes the differences among multiple Oracle home environments since multiple Oracle homes were first introduced in release 8.0.4.
If you have release 8.0.4 or later 8.0.x Oracle homes on your computer, note these differences between the first Oracle home you installed and more recent Oracle homes you may install:
Element | First Oracle Home | Each Additional Oracle Home |
---|---|---|
Service Names |
OracleTNSListener80 |
Includes the Oracle home name in service names. For example: OracleHOME_NAMETNSListener80 |
Program Groups |
Oracle home name is not appended to the group. |
Appends the Oracle home name to the program group. For example: Oracle for Windows NT - HOME_NAME |
Registry Entries |
Located in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE |
Subkeys for each Oracle home are added below the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE subkey (HOME0, HOME1, HOME2, and so on). For more information on the registry keys and subkeys, see Appendix B, "Oracle8i Configuration Parameters and the Registry". |
System Identifier (SID) name for starter database |
Automatically named ORCL |
Only the first starter database on your computer is called ORCL. Additional starter databases use the naming convention ORCx or ORxx where x is a number appended to ensure the SID is unique. |
Release 8.1 Oracle homes are slightly different from pre-8.1 Oracle homes.
Element | First Oracle Home | Each Additional Oracle Home |
---|---|---|
Service Names |
OracleHOME_NAMETNSListener |
OracleHOME_NAMETNSListener |
Program Groups |
Oracle - HOME_NAME |
Oracle - HOME_NAME |
Registry Entries |
Located in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME0 |
Subkeys for each Oracle home are added in the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE subkey. For example, the next subkeys after HOME0 are HOME1, HOME2, HOME3, and so on. For more information on the registry keys and subkeys, see Appendix B, "Oracle8i Configuration Parameters and the Registry". |
System Identifier (SID)1 name and DB_NAME |
Automatically named ORCL. |
For 8.1.3 and 8.1.4, the first starter database on your computer was automatically called ORCL. The second database you created on your computer had a SID of ORCL0. For 8.1.5 and 8.1.6, you must type in the global database name and SID name of your choice when prompted during installation. |
1
For releases 8.1.3 through 8.1.6, the SID can be a maximum of 64 alphanumeric characters in length. For all releases prior to 8.1.3, the SID was a maximum of 4 alphanumeric characters. |
You can install all products on the CD-ROM into your first Oracle home on a "clean" computer (that is, there is no other Oracle software on the computer) without any conflict.
If you create more Oracle homes, and install the same products that you installed into the first Oracle home, conflicts can arise that cause your original database to function incorrectly if the products are not multiple Oracle home-enabled (multiple Oracle home products.)
To avoid such problems, check the following product classifications before installing multiple versions of the same product on your computer. Oracle products are classified as follows:
You can install multiple Oracle home products multiple times in different Oracle homes. All products are multiple Oracle home products unless they are listed in:
You can install single Oracle home products into any Oracle home, but only once per computer. When installing groups of products, if any of the products in the following list are included in the group and already exist on the computer, do not install them a second time:
All Oracle7 products and all release 8.0.3 products are non multiple Oracle home products. You can only install these products into an old-style Oracle home (pre-8.0.4 Oracle home is an old-style Oracle home).
Products not associated with an Oracle home have no restrictions into how many Oracle homes you install them. They include the following:
When you install these products, Oracle Universal Installer requires that you install them into any Oracle home. However, these files are actually installed in the directory X:/PROGRAM FILES/ORACLE, where X: is the hard drive where Windows NT is installed.
Unless you specify otherwise at installation time, the Oracle home in which you installed products most recently is the first directory listed in your PATH (primary home). As such, it has priority over the other Oracle home entries in your PATH.
If you invoke a product from the MS-DOS command prompt, the release of the product invoked is the one in the Oracle home listed first in your path, unless you specifically invoke a different release of the product by one of the following methods:
You can change the value of PATH by using one of the following methods:
You can assign a new value at the system level. The new value exists until you change the value of PATH again.
You can assign a new value at the MS-DOS command prompt. The new value reverts to its previous value when you quit the session.
Oracle Home Selector is a graphical user interface (GUI) tool that enables you to edit your environment path to make an appropriate Oracle home directory your primary home. This tool can only be used when you have multiple, active Oracle home directories on a single computer.
To change the value of PATH using Oracle Home Selector:
The Oracle Home Selector window appears.
To change the value of PATH at the system level:
On Windows NT
The Control Panel window appears.
The System Properties window appears.
The system variables appear.
On Windows 95 and Windows 98
To change the value of PATH at the MS-DOS command prompt:
At the MS-DOS command prompt, enter:
C:\> SET PATH=PATHNAME;%PATH%
where PATHNAME is the full path to the binary files for the products you want to use. This change is valid for the current session only. If you want to change the value of your PATH more permanently, use Oracle Home Selector or change the value of PATH at the system level. Both methods are described above.
If you have to exit Oracle Universal Installer unexpectedly after you have entered the name and path for an Oracle home (for example, because there is no more disk space in the path you specified), you cannot specify a different path until you delete the HOMEID key and the IDx key corresponding to that Oracle home from the registry. To do this:
Appendix B, "Oracle8i Configuration Parameters and the Registry" for more information on the registry keys and subkeys.
See Also:
Variables set in the environment always override the value of equivalent variables set in the registry. The following section describes the consequences of setting two of the most commonly-used environment variables, ORACLE_HOME and TNS_ADMIN.
Oracle Corporation recommends that you never set the ORACLE_HOME environment variable because it is not required for Oracle products to function properly. If you set the ORACLE_HOME environment variable, Oracle Universal Installer will unset it for you. Oracle products find the value of ORACLE_HOME at the location specified by the ORACLE_BASE\ORACLE_HOME\BIN\ORACLE.KEY file. If there is a need to set ORACLE_HOME in the environment for another reason, care must be taken to only run software from that Oracle home when the variable is set.
When you run an Oracle program from the MS-DOS command prompt, the first executable by that name found in the directory path runs. For example, C:\> SQLPLUS. Alternately, if you specify a full directory path, the specified program runs. For example, C:\ORACLE\ORA81> SQLPLUS.
If you modify the value of PATH using any of the three methods described in the previous section, "Using Oracle Home Selector", "At the System Level", or "At the MS-DOS Command Prompt", you can change the choice of which version of a program is run from the MS-DOS command prompt. In sum, modifying the value of PATH indicates from which Oracle home to run executables, at the MS-DOS command prompt, when no full directory path is specified.
Once an Oracle program starts, it looks for all environment variables in the following order:
The program knows where it's running from by calling Window NT to obtain the executable's path name, and then parsing the path name to get the directory from which it's running. In the ORACLE_BASE\ORACLE_HOME\BIN directory where the executable resides, there is a file called ORACLE.KEY. This file specifies where in the registry to look for variables when programs from that particular Oracle home are run.
For example, if you run C:\ORACLE\ORA81\BIN\SQLPLUS.EXE, SQLPLUS.EXE looks in C:\ORACLE\ORA81\BIN\ORACLE.KEY to find out where to look for its registry variables. If the ORACLE.KEY file does not exist (for version 7.x and some version 8.0 Oracle homes), Oracle uses HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE to locate the registry variables.
In a typical case, there are no Oracle variables (that is, ORACLE_HOME) set in the environment. Any programs run from a release 8.0.5 Oracle home look in the ORACLE.KEY file in that Oracle home and find their variables (including ORACLE_HOME) in the correct registry key. Likewise for release 8.1.6, the Oracle home that gets priority depends on the PATH, but regardless of the PATH setting, all the software works correctly.
If you set ORACLE_HOME in the environment, then software run from another Oracle home will not work reliably. The conflict occurs when you set ORACLE_HOME to point to one Oracle home directory, then attempt to run programs from a second Oracle home. These programs first check for any environment variable settings (such as ORACLE_HOME), before checking the registry through the ORACLE.KEY file. Since ORACLE_HOME is set, the programs in the second Oracle home attempt to use files in the first Oracle home, causing a conflict.
For example, assume you have release 8.0.5 installed in C:\ORANT, and release 8.1.6 installed in C:\ORACLE\ORA81, and ORACLE_HOME is set to C:\ORANT in the environment. If you run a program from C:\ORACLE\ORA81\BIN, that program first looks in the environment for all variables before looking at its ORACLE.KEY file. So, a program run from your release 8.1.6 Oracle home runs with ORACLE_HOME=C:\ORANT. Therefore, anything that the program uses ORACLE_HOME for will be looked for in C:\ORANT, where it may not exist. Examples include message files (*.MSB), SQL scripts (.SQL), and any other files opened by the program and based off ORACLE_HOME.
Note that the same behavior occurs on UNIX. If you run a program from Oracle home number 1 with ORACLE_HOME=OracleHome number 2 in the environment, then the same behavior can be observed.
Oracle software looks for TNS_ADMIN in one location in the registry (depending upon the type of Oracle home installed). If you installed software into the default Oracle home, then any software running from that Oracle home will look in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE. If you installed a new-style (8.0.4 or later) multiple Oracle home, then the Oracle software looks in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID. The ALL_HOMES key is used by the installer and plays no role when translating variables.
The environment always overrides the registry, so if TNS_ADMIN is set in the environment, that takes precedence over the TNS_ADMIN setting in the registry. No variables should be set in the environment by the Oracle Home Selector except for the PATH.
The Oracle Optimal Flexible Architecture (OFA) is a set of file naming and placement guidelines for Oracle software and databases. It can also be thought of as a set of good habits to adopt when organizing Oracle directories and files on your computer. All Oracle products on the CD-ROM are OFA-compliant; that is, Oracle Universal Installer places Oracle products in directory locations that follow the OFA guidelines. Although using OFA is not a requirement, Oracle Corporation recommends that you use it if your database will grow in size, or if you plan to have multiple databases.
The aim of OFA is to prevent an entire class of problems that can occur when you have different versions of Oracle software and multiple, growing databases on your computer. OFA is designed to provide significant benefits in the following areas:
For example, one of the many benefits of OFA is that Oracle Universal Installer separates Oracle software executables from database files. Previously, database files were placed in ORACLE_HOME\DATABASE, a subdirectory of the Oracle home directory that also contained Oracle software. Using OFA, Oracle Universal Installer puts Oracle software in ORACLE_BASE\ORACLE_HOME and database files in ORACLE_BASE\ORADATA.
Putting database files in a subdirectory of the Oracle home directory that also contained Oracle software made upgrades unnecessarily difficult. Separating software from data is essential, because over time, when you upgrade a database to the latest release, the new Oracle software executables will be placed in a different Oracle home directory. After the upgrade is judged to have been successful, you can easily remove the old Oracle home directory and reclaim space because the database does not reside there.
An OFA-compliant database has the following benefits:
The file system is organized to simplify the following tasks:
Disk contention decreases, because Oracle administration files, binary files, and data files that used to be on one disk can now reside in separate directories or in separate directories on separate disks.
By spreading files across more than one disk, disk failures impact as little data as possible.
You can run multiple versions of application software simultaneously, enabling you to test and use a new release of an application before abandoning the previous version. Transferring to a new version after an upgrade is simple for the database administrator and transparent for the user.
An OFA-compliant database has the following characteristics:
Categories of files are separated into independent subdirectories so that files in one category are minimally affected by operations on files in other categories.
Database files are named to realize the following advantages:
You can add, move, or delete Oracle home directories without having to revise programs that refer to them.
The ability to separate administrative information about one database from that of another ensures a reasonable structure for the organization and storage of administrative data.
Tablespace contents are separated to realize the following advantages:
I/O loads are tuned across all disks, including disks storing Oracle data in raw devices, if needed.
OFA has necessitated changes to the Oracle database directory tree. This table lists the differences:
The following figure provides a top-level overview of the old and new database directory trees:
The following is the complete hierarchical directory tree of a sample OFA-compliant database:
Note: The directory tree for multiple instance databases (Oracle Parallel Server installations) has additional subdirectories and files. See Oracle Parallel Server Administrator's Guide for more information. |
OFA uses directory naming conventions that make it easy to identify the precise Oracle home and database name that is associated with a set of files. This section describes the naming conventions used for the top-level directories of an OFA-compliant database directory tree:
ORACLE_BASE is the root of the Oracle directory tree. If you install an OFA-compliant database using Oracle Universal Installer defaults, ORACLE_BASE is X:\ORACLE where X is any hard drive. For example, C:\ORACLE.
If you are installing Oracle8i Client on a clean computer, you may want to change ORACLE_BASE to an appropriate value before running Oracle Universal Installer. Most users will not need or want to do this.
Before you run Oracle Universal Installer for the first time, change the value of ORACLE_BASE at the system level. Only change the value of ORACLE_BASE before you run Oracle Universal Installer for the first time because if there is an existing ORACLE_BASE, and you change it, there will be a conflict of Oracle base directories. If you create another ORACLE_BASE when the original ORACLE_BASE already exists, certain tools and the database will not be able to find previously created files because they will look for them in the new ORACLE_BASE instead of the original ORACLE_BASE.
To change the value of ORACLE_BASE at the system level:
On Windows NT:
The Control Panel window appears.
The System Properties window appears.
The System Variables appear.
On Windows 95 and Windows 98:
\ORACLE_HOME is located beneath X:\ORACLE_BASE and contains subdirectories for Oracle software executables and network files.
If you install Oracle8i for Windows NT on a clean computer and use the default settings, the first Oracle home directory that you create is called \ORA81.
Database administration files are stored in subdirectories of ORACLE_BASE \ADMIN\DB_NAME.
The following table describes the subdirectories for database administration files:
Database files are stored in ORACLE_BASE\ORADATA\DB_NAME.
The following table describes the database files:
Note: This directory structure only allows for disk striping on UNIX platforms. See "Support for Symbolic Links on Windows NT". |
DB_NAME is the unique name for a particular database and has the same value as the DB_NAME parameter in the initialization parameter file. When you create a database, DB_NAME can be no more than eight characters long and can contain only the following characters:
The following sections describe various OFA and multiple Oracle home configurations.
To install an OFA-compliant database, you must specify an Oracle home directory in the Path: field of Oracle Universal Installer of the form:
X:\[PATHNAME]\ORACLE\HOME_NAME
where:
X:\ |
is any hard drive. For example, C:\. |
[PATHNAME] |
is an optional directory pathname. |
\ORACLE |
is a mandatory directory pathname unless you have changed the value of the ORACLE_BASE registry key before performing the installation. See "ORACLE_BASE Directory" for information on how to change the ORACLE_BASE from the default value ORACLE. |
HOME_NAME |
is the name of the Oracle home. |
The following are examples of OFA-compliant Oracle home directories:
To install a default OFA database:
The default OFA database settings are as follows:
Setting | Value |
---|---|
ORACLE_BASE |
is C:\ORACLE and is the same for all Oracle homes |
Oracle home 1 |
is C:\ORACLE\ORA81 |
Oracle home 2 |
is C:\ORACLE\ORA82 |
This figure below illustrates the directory tree:
To install a non-default OFA database, case 1:
For case 1, the non-default OFA database settings are as follows:
Setting | Value |
---|---|
ORACLE_BASE |
is X:\XYZ for the first Oracle home and is Y:\ABC for the second Oracle home |
Oracle home 1 |
is X:\XYZ |
Oracle home 2 |
is Y:\ABC |
This figure illustrates the resulting directory trees:
To install a non-default OFA database, case 2:
For case 2, the non-default OFA database settings are as follows:
Setting | Value |
---|---|
ORACLE_BASE |
is X:\XYZ\ORACLE and is the same for both Oracle homes |
Oracle home 1 |
is X:\XYZ\ORACLE\ABC |
Oracle home 2 |
is X:\PQR |
This figure illustrates the resulting directory tree:
One of the basic goals of OFA is to increase reliability and performance by distributing I/O load across different physical drives. If you are trying to maximize reliability and performance, Oracle Corporation recommends that you do the following:
Oracle log files and database files can be separated and treated with different levels of hardware reliability. Generally, Oracle log files are more highly reliable, because of redundancy. Creating reliability based on redundancy may require you to duplicate all of your data, using disk mirrors.
Disk mirroring can be done with the Windows NT Disk Administrator and commonly with hardware controllers. Two identical drives are usually required to construct a mirror, the concept being that if one disk fails, the other disk can be used to recover data that would otherwise be lost. Using one of the disks to recover lost data may involve "breaking" the mirror. If the mirror breaks, you need to build a new mirror.
You can achieve a lesser degree of redundancy by configuring the disks, using a Redundant Array of Inexpensive Disks (RAID) configuration provided by the disk controller. The RAID level determines the amount of redundancy. Some RAID levels may use the "hot swapping" feature. Hot swapping means that you can replace a bad disk with a good one without turning off the computer or losing functionality.
How you set up disks for use in a database depends on the number of disks and the type of hard disk controllers available. If the hard disk controllers support both striping and mirroring, Oracle Corporation recommends you configure the controllers to support striping.
Some controllers are configured at system startup time by issuing a keyboard sequence that brings up configuration programs written by the controller manufacturer. One goal is to stripe as many drives together as possible by configuring the controllers. Each stripe shows up as one logical device.
Striping provides significant performance advantages. All the space from the striped drives appears as a single logical drive. Furthermore, the space is used by interlacing "stripes" of space from all of the disks in the stripe. This means that a large file uses some space from the first disk, then some from the second disk and so on to the last disk and then starting back at the first disk again. Each file may be spread over all of the striped disks. The data in such a file may be accessed randomly by more than one CPU without contention.
The controllers that support striping usually provide caching as well. This means that data may be written to the controller and cached and saved for a time in storage not on the disk. Data that is read can be cached on the controller in a similar fashion. Read caching is not necessary for Oracle databases since all database reads are cached already in the System Global Area (SGA). The value of the DB_BLOCK_BUFFERS parameter in the initialization parameter file determines the number of buffers that can be used in the SGA. This value also configures the Oracle8i database on startup.
A raw partition is a portion of a physical disk that is accessed at the lowest possible level. The I/O of a raw partition improves performance by approximately 5% to 10% compared to the I/O of a partition containing a file system. Therefore, Oracle Corporation encourages you to use raw partitions for your tablespaces.
You implement OFA on Windows NT and UNIX in the same way. However, differences exist with regard to the following:
The top-level names of the OFA directory tree differ between Windows NT and UNIX. However, the main subdirectory and file names are the same on both operating systems.
On Windows NT, ORACLE_BASE is associated with an Oracle home directory. ORACLE_BASE is defined in the registry (for example, in HKEY_LOCAL_MACHINE \SOFTWARE\ORACLE\HOME0).
On UNIX, ORACLE_BASE is associated with a UNIX user's environment.
Windows NT currently does not support symbolic links like those in UNIX, although Microsoft has announced the intention to support them in a near-future release.
The goal of OFA is to place all Oracle software under one ORACLE_BASE directory and to spread the files across different physical drives as your databases increase in size.
On Windows NT 4.0, this implies that everything is on the same hard drive, which may be neither feasible nor desirable.
On UNIX, although everything seems to be in one directory on the same hard drive, files can be on different hard drives if they are symbolically linked or have that directory as a mount point.
Oracle Corporation recommends that you use one logical drive to store your database administration files and that you place other files, as needed, on other logical drives in an ORADATA\DB_NAME directory.
In the following example, there are four logical drives for a database named PROD:
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|