Oracle® Database Platform Guide 10g Release 1 (10.1) for Windows Part Number B10113-01 |
|
|
View PDF |
This chapter describes multiple Oracle homes and Optimal Flexible Architecture (OFA) for Oracle Database for Windows.
This chapter contains these topics:
When you install 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 most important:
Structured organization of directories and files and consistent naming used for database files simplify database administration.
Distribution of I/O across multiple disks prevents performance bottlenecks caused by multiple read or write commands issued simultaneously to a single drive.
Distribution of applications across multiple disks safeguards against database failures.
Login home directories are not at risk when database administrators add, move, or delete Oracle home directories.
Multiple versions of application software can execute concurrently.
Software upgrades can be tested in an Oracle home in a separate directory from the Oracle home where your production database is located.
Note: Oracle recommends that you test software upgrades on a separate server from your production database server |
This section includes the following topics:
An Oracle home corresponds to the environment in which Oracle products run. This environment includes the following:
Location of installed product files
PATH
variable pointing to binary files of installed products
Registry entries
Service names
Program groups
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 an Oracle Database patch before you run your production Oracle Database against it.
You can use one listener for spawning connections to databases for multiple Oracle homes. Simply add each system identifier 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 file.
Note: There may be multiplelistener.ora files on your computer, one for each Oracle home. To ensure that you use the correct listener.ora file, check the Oracle home name in the listener service. See "Managing Oracle Database Services" for information on verifying service names. |
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 start a product from the command prompt, then the release of the product started is the one in the Oracle home listed first in your PATH
, unless you specifically start a different release of the product by one of the following methods:
Specifying the full directory path name to the release of the product you want to use at the command prompt
Changing to the directory that contains the executable you want to use
Changing your PATH
so that the first entry points to binary files for the product release you want to use
You have three options for changing the value of PATH
:
Changing the Value of PATH at the System Level
The new value exists until you change the value of PATH
again.
Changing the Value of PATH at the Command Prompt
The new value reverts to its previous value when you quit the session.
Note: The first two methods of changing the value ofPATH are only valid if you are a member of the Administrators group. After you have changed the value of PATH , you must open a new command prompt window to make it active. The change is not reflected in already-opened windows. |
Oracle Universal Installer enables you to edit your environment PATH to make a specific Oracle home directory your primary home when you have multiple active Oracle home directories on a single computer.
Choose Start >
Programs >
Oracle >
HOME_NAME >
Oracle Installation Products >
Universal Installer.
The Oracle Universal Installer: Welcome window appears.
Click Installed Products.
Select the Environment tab.
Select a primary Oracle home and use the up arrow to move it to the top of the list.
Click Apply.
Click Close.
Note: This procedure requires Oracle Universal Installer release 2.3.0.5.0a or newer. |
PATH is an environment variable, and the procedure for changing its value depends on your operating system.
See Also: Your Windows documentation for information on environment variables |
At the command prompt, enter:
C:\> set PATH=PATHNAME;%PATH%
where PATHNAME
is the full path to 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
permanently, then use Oracle Universal Installer or change the value of PATH
at the system level. Both methods are described earlier in this section.
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), then you cannot specify a different path until you delete the KEY_
HOME_NAME
key corresponding to that Oracle home from the registry. To do this:
Read the value of parameter ORACLE_HOME_NAME
for each KEY_
HOME_NAME
subkey in key HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
until you find the value that matches the name of the Oracle home you must delete.
Delete subkey KEY_
HOME_NAME
you just located.
See Also: Chapter 14, " Configuration Parameters and the Registry" for more information on registry keys and subkeys |
Variables set in the environment always override the value of equivalent variables set in the registry. The following section describes consequences of setting two of the most commonly-used environment variables, ORACLE_HOME
and TNS_ADMIN
.
Oracle 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, then 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 you must set ORACLE_HOME
in the environment for another reason, then you must take care to run software only from that Oracle home when the variable is set.
When you run an Oracle application from the 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, then the specified application runs. For example, C:\oracle\ora82> sqlplus
.
If you modify the value of PATH
using any of the three methods described in the previous section, then you can choose which release of an application is run from the command prompt. In sum, modifying the value of PATH
indicates from which Oracle home to run executables at the command prompt, when no full directory path is specified.
Once an Oracle application starts, it looks for all environment variables first in the current environment and second in the registry key for the Oracle home from which the application is running.
The application knows where it is running from by calling Windows to obtain the executable's path name and then parsing the path name to get the directory from which it is 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 applications from that particular Oracle home are run.
For example, if you run C:\oracle\ora82\bin\sqlplus.exe
, then sqlplus.exe
looks in C:\oracle\ora82\bin\oracle.key
to find out where to look for its registry variables. If the oracle.key
file does not exist (for version 7 and some version 8 Oracle homes), then 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 applications run from an Oracle8 release 8.0.5 or later 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 Oracle Database 10g, the Oracle home that gets priority depends on the PATH
, but regardless of the PATH
setting, all software works correctly.
If you set ORACLE_HOME
in the environment, then software run from another Oracle home will not work reliably. Conflict occurs when you set ORACLE_HOME
to point to one Oracle home directory, then attempt to run applications from a second Oracle home. These applications first check for any environment variable settings (such as ORACLE_HOME
), before checking the registry through the oracle.key
file. Because ORACLE_HOME
is set, the applications in the second Oracle home attempt to use files in the first Oracle home, causing a conflict.
For example, suppose you have Oracle8 release 8.0.5 installed in C:\orant
and Oracle Database 10g installed in C:\oracle\ora10
. Suppose further that ORACLE_HOME
is set to C:\orant
in the environment. If you run an application from C:\oracle\ora10\bin
, then that application first looks in the environment for all variables before looking at its oracle.key
file. So an application run from your Oracle Database 10g Oracle home runs with ORACLE_HOME=C:\orant
. Therefore, anything that the application 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 application and based off ORACLE_HOME
.
Note that the same behavior occurs on UNIX. If you run an application 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\HOME
ID
.
The environment always overrides the registry, so if TNS_ADMIN
is set in the environment, then that takes precedence over the TNS_ADMIN
setting in the registry.
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 CD-ROM are OFA-compliant; that is, Oracle Universal Installer places Oracle products in directory locations that follow OFA guidelines. Although using OFA is not a requirement, Oracle 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 releases of Oracle software and multiple, growing databases on your computer. OFA is designed to provide significant benefits:
Easier maintenance of Oracle software and databases through standard file organization
Greater reliability through data spanning multiple physical drives
Higher performance through decreased I/O contention for disks
For example, Oracle Universal Installer now 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
. Now when you upgrade a database to the latest release, the new Oracle software executables will be placed in a different Oracle home directory. After you judge the upgrade 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:
Easier database administration and management of database growth
File system organization simplifies locating specific database files and adding database files as the database grows.
Fewer performance bottlenecks
Disk contention decreases, because Oracle administration files, binary files, and datafiles that used to be on one disk can now reside in separate directories on separate disks.
Safeguards against disk failures
By spreading files across more than one disk, disk failures impact as little data as possible.
Support for concurrent execution of application software
Multiple releases of application software can run simultaneously, enabling testing and use of a new release of an application before abandoning the previous release. Transferring to a new release after an upgrade is simple for the database administrator and transparent for the user.
An OFA-compliant database has the following characteristics:
Independent subdirectories
Categories of files are separated into independent subdirectories so that files in one category are minimally affected by operations on files in other categories.
Consistent naming conventions for database files
Database files are easily distinguishable from all other files. Files of one database are easily distinguishable from files of another database. Datafiles, redo log files, and control files are easily identifiable. Datafiles are clearly associated with a particular tablespace.
Integrity of Oracle home directories
You can add, move, or delete Oracle home directories without having to revise applications that refer to them.
Separation of administrative information for each database
The ability to distinguish administrative information about one database from that of another ensures a reasonable structure for the organization and storage of administrative data.
Separation of tablespace contents
Tablespace free space fragmentation and I/O request contention are minimized, while administrative flexibility is maximized.
Tuning I/O loads across all disks
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 section lists the differences.
When you install an Oracle8i release 8.1.3 or earlier release, all subdirectories are located under a top-level ORACLE_HOME
directory that by default is C:\orant
.
When you install an Oracle8i release 8.1.4 or later OFA-compliant database, all subdirectories are no longer under a top-level ORACLE_HOME
directory. There is now a new top-level directory called ORACLE_BASE of form X:\oracle
, where X
is any hard drive. If you install an OFA-compliant database using Oracle Universal Installer defaults, then ORACLE_BASE
is C:\oracle
.
ORACLE_BASE
contains \
ORACLE_HOME
directories, \oradata
directories (for database files), and \admin
directories (for database administration files).
In Oracle8i release 8.1.3 and earlier releases, database files have the SID in the database filename. For example, the first control file is named ctl1
SID
.ora
.
Beginning with Oracle8i release 8.1.4, database files no longer have the SID in the database filename. For example, the first control file is named control01.ctl.
There is no need for the presence of the SID in the filename, because all the database files for a particular database are placed in \oradata
under a directory called DB_NAME
that is named for that database.
In Oracle8i release 8.1.3 and earlier releases, all database files have the same ".ORA"
extension.
In an OFA-compliant release, the convention of having ".ora"
as the filename extension for database files is no longer used. Database filenames now have more meaningful extensions. These are:
.ctl
for control files,
.log
for log files
.dbf
for datafiles.
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 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, then ORACLE_BASE
is X:\oracle
where X
is any hard drive. For example, C:\oracle
.
If you are installing Oracle Database for Windows on a computer with no other Oracle software installed, then you can change ORACLE_BASE
before running Oracle Universal Installer. Most users will not need or want to do this.
Do not change the value of ORACLE_BASE
after you run Oracle Universal Installer for the first time. If there is an existing ORACLE_BASE
and you change it, then there will be a conflict of Oracle base directories. If you create another ORACLE_BASE
when the original ORACLE_BASE
already exists, then certain tools and the database will not be able to find previously created files. They will look for them in the new ORACLE_BASE
instead of the original ORACLE_BASE
.
See Also: Your Windows documentation for instructions on editing environment variables |
The \ORACLE_HOME
directory is located beneath X:\ORACLE_BASE
and contains subdirectories for Oracle software executables and network files.
If you install Oracle Database for Windows on a computer with no other Oracle software installed and you use default settings, then the first Oracle home directory that you create is called \ora10
.
Database administration files are stored in subdirectories of ORACLE_BASE
\admin\DB_NAME
. Names and brief descriptions of some of these subdirectories are:
\bdump --background process trace files \cdump --core dump files \create --database creation files \exp --database export files \pfile --initialization parameter files \udump --user SQL trace files
Database files are stored in ORACLE_BASE\ORADATA\DB_NAME
. Names and brief descriptions of these files are:
control01.ctl --control file 1 control02.ctl --control file 2 control02.ctl --control file 3 system01.dbf --SYSTEM tablespace datafile temp01.dbf --TEMP tablespace datafile users01.dbf --USERS tablespace datafile *.dbf --datafiles corresponding to each tablespace in your database redo01.log --redo log file group one, member one redo02.log --redo log file group two, member one redo03.log --redo log file group three, member one
Note: This directory structure allows for disk striping only on UNIX platforms. See "Support for Symbolic Links on Windows". |
DB_NAME
is the unique name for a particular database and has the same value as parameter DB_NAME
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:
Alphabetic characters
Numbers
Underscores (_)
Pound sign (#)
Dollar sign ($)
The following sections describe various OFA and multiple Oracle homes configurations.
To install an OFA-compliant database, you must specify an Oracle home directory in the Path field of Oracle Universal Installer. It is of the form:
X:\[PATHNAME]\oracle\HOME_NAME
where:
X:\
is any hard drive. For example, C:\
[
PATHNAME
]
is an optional directory path name
\oracle
is a mandatory directory path name, unless you changed the value of registry key ORACLE_BASE
before performing the installation
HOME_NAME
is the name of the Oracle home
The following are examples of OFA-compliant Oracle home directories:
C:\test\oracle\ora10
D:\oracle\ora10
Install any Oracle Database that supports OFA (Oracle Database 8.1.6 or later) on a computer with no other Oracle software installed and make sure that you accept default settings for the Oracle home (for example, c:\oracle\ora81
).
Install any Oracle Database (for example, Oracle Database 10g) in a second Oracle home accepting the default settings.
Table 2-1 shows the default OFA database settings.
Install any Oracle Database that supports OFA (Oracle Database 8.1.6 or later) on a computer with no other Oracle software installed and change default Oracle Universal Installer settings for the first Oracle home (for example, from C:\oracle\ora81
to X:\xyz
).
Install any Oracle Database (for example, Oracle Database 10g) in a second Oracle home and change default Oracle Universal Installer settings for the second Oracle home (for example, from C:\oracle\ora10
to Y:\abc
).
Table 2-2 shows the nondefault OFA database settings for example 1.
Table 2-2 Nondefault OFA Database Settings: Example 1
Setting | Value |
---|---|
ORACLE_BASE |
X:\xyz for first Oracle home; Y:\abc for second Oracle home |
Oracle home 1 | X:\xyz |
Oracle home 2 | Y:\abc |
The resulting directory tree would look similar to this:
X:\xyz \admin \DB_NAME1 \DB_NAME2 \bin \network \oradata \DB_NAME1 control01.ctl control02.ctl control03.ctl indx01.dbf rbs01.dbf system01.dbf temp01.dbf users01.dbf redo01.log redo02.log redo03.log \DB_NAME2 Y:\abc \admin \DB_NAME1 \DB_NAME2 \bin \network \oradata \DB_NAME1 control01.ctl control02.ctl control03.ctl indx01.dbf rbs01.dbf system01.dbf temp01.dbf users01.dbf redo01.log redo02.log redo03.log \DB_NAME2
Install any Oracle Database that supports OFA (Oracle Database 8.1.6 or later) on a computer with no other Oracle software installed and change default Oracle Universal Installer settings for the first Oracle home (for example, from C:\oracle\ora81
to X:\xyz\oracle\abc
).
Install any Oracle Database and change default Oracle Universal Installer settings for the second Oracle home (for example, from C:\oracle\ora10
to X:\pqr
).
Table 2-3 shows the nondefault OFA database settings for example 2.
Table 2-3 Nondefault OFA Database Settings: Example 2
Setting | Value |
---|---|
ORACLE_BASE |
X:\xyz\oracle
(same for both Oracle homes) |
Oracle home 1 | X:\xyz\oracle\abc |
Oracle home 2 | X:\pqr |
The resulting directory tree would look similar to this:
X:\pqr --Oracle home 2 \bin \network X:\xyz \oracle --ORACLE_BASE for both Oracle homes \abc --Oracle home 1 \bin \network \admin \DB_NAME1 \adhoc \bdump \cdump \create \exp \pfile \udump \DB_NAME2 \... \oradata \DB_NAME1 control01.ctl control02.ctl control03.ctl indx01.dbf rbs01.dbf system01.dbf temp01.dbf users01.dbf redo01.log redo02.log redo03.log \DB_NAME2
One of the basic goals of OFA is to increase reliability and performance by distributing I/O loads across different physical drives. Two ways to do that are:
Oracle Database log files and database files can be separated and treated with different levels of hardware reliability. Oracle Database log files are highly reliable to start with, because they are stored redundantly. Creating similar reliability for database files may require you to duplicate all of your data, using disk mirrors.
Disk mirroring usually involves two or more identical drives and either a hardware controller or Windows Disk Administrator. If one disk fails, then the other disk(s) 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, then you must build a new mirror.
Disk mirroring is part of some levels of Redundant Array of Independent Disks (RAID) configurations, provided by the disk controller. The RAID level determines the amount of redundancy. Some RAID levels can use the "hot swapping" feature, which 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, then Oracle 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 can be spread over all of the striped disks. Data in such a file may be accessed randomly by more than one CPU without contention.
Controllers that support striping usually provide caching as well. This means that data can 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 Database, because all database reads are cached already in the System Global Area (SGA). The value of parameter DB_CACHE_SIZE
in the initialization parameter file (init.ora
) determines the buffer size that can be used in the SGA. This value also configures Oracle Database on startup.
A raw partition is a portion of a physical disk that is accessed at the lowest possible level. I/O of a raw partition improves performance by approximately 5% to 10% compared to I/O of a partition containing a file system. Therefore, Oracle encourages you to use raw partitions for your tablespace files.
You implement OFA on Windows and UNIX in the same way. However, differences exist with regard to the following:
Support for Symbolic Links on Windows
See Also: Your UNIX operating system-specific administrator's reference for information about OFA on UNIX |
Top-level names of the OFA directory tree differ between Windows and UNIX. However, main subdirectory and filenames are the same on both operating systems.
On Windows, ORACLE_BASE
is associated with an Oracle home directory. ORACLE_BASE
is defined in the registry (for example, in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_
HOME_NAME
).
On UNIX, ORACLE_BASE
is associated with a UNIX user's environment.
The goal of OFA is to place all Oracle software under one ORACLE_BASE
directory and to spread files across different physical drives as your databases increase in size.
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.
Windows currently does not support symbolic links, so datafiles will not all show up under a single directory like on UNIX. Instead, you may have oradata
directories on multiple drives, with datafiles in each one. In this way, you still get OFA benefits, even though datafiles are not all visible in a single directory.
Oracle 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
:
C:\
contains an Oracle home and database administration files.
F:\
contains redo log files. (F:\
drive could also represent two physical drives that have been striped to increase performance.)
G:\
contains one of the control files and all tablespace files. (G:\
drive could also use a RAID Level-5 configuration to increase reliability.)
H:\
contains the second control file.
The directory structure would look similar to this:
C:\oracle --First logical drive \ora10 --Oracle home \bin --Subtree for Oracle binaries \network --Subtree for Oracle Net \... \admin --Subtree for database administration files \prod --Subtree for prod database administration files \adhoc --Ad hoc SQL scripts \adump --Audit files \bdump --Background process trace files \cdump --Core dump files \create --Database creation files \exp --Database export files \pfile --Initialization parameter file \udump --User SQL trace files F:\oracle --Second logical drive (two physical drives, striped) \oradata --Subtree for Oracle Database files \prod --Subtree for prod database files redo01.log --Redo log file group one, member one redo02.log --Redo log file group two, member one redo03.log --Redo log file group three, member one G:\oracle --Third logical drive (RAID level 5 configuration) \oradata --Subtree for Oracle Database files \prod --Subtree for prod database files control01.ctl --Control file 1 indx01.dbf --Index tablespace datafile rbs01.dbf --Rollback tablespace datafile system01.dbf --System tablespace datafile temp01.dbf --Temporary tablespace datafile users01.dbf --Users tablespace datafile H:\oracle --Fourth logical drive \oradata --Subtree for Oracle Database files \prod --Subtree for prod database files control02.ctl --Control file 2