Oracle® Database Administrator's Reference 11g Release 2 (11.2) for Linux and UNIX-Based Operating Systems Part Number E10839-16 |
|
|
PDF · Mobi · ePub |
This chapter provides information about administering Oracle Database on UNIX-based operating systems. It contains the following sections:
See Also:
The appropriate appendix in this guide for platform-specific information about administering Oracle DatabaseYou must set Oracle Database environment variables, parameters, and user settings for Oracle Database to work. This chapter describes the various settings for Oracle Database.
In Oracle Database files and programs, a question mark (?) represents the value of the ORACLE_HOME
environment variable. For example, Oracle Database expands the question mark in the following SQL statement to the full path of the Oracle home directory:
SQL> ALTER TABLESPACE TEMP ADD DATAFILE '?/dbs/temp02.dbf' SIZE 200M
Similarly, the at sign (@) represents the ORACLE_SID
environment variable. For example, to indicate a file that belongs to the current instance, run the following command:
SQL> ALTER TABLESPACE tablespace_name ADD DATAFILE tempfile@.dbf
You can create a syslog audit trail to track administrative activities.
See Also:
"Using the Syslog Audit Trail to Audit System Administrators on UNIX Systems" in Oracle Database Security Guide for more information on audit trails.This section describes the most commonly used Oracle Database and operating system environment variables. You must define some environment variables before installing Oracle Database. This section covers the following topics:
To display the current value of an environment variable, use the env
command. For example, to display the value of the ORACLE_SID
environment variable, run the following command:
$ env | grep ORACLE_SID
To display the current value of all environment variables, run the env
command as follows:
$ env | more
Table 1-1 describes some environment variables used with Oracle Database.
Table 1-1 Oracle Database Environment Variables
Variable | Detail | Definition |
---|---|---|
|
Function |
Specifies the language, territory, and character set of the client environment. The client character set specified by Refer to Oracle Database Globalization Support Guide for a list of values for this variable. |
Syntax |
|
|
Example |
|
|
|
Function |
Specifies the directory where the language, territory, character set, and linguistic definition files are stored. |
Syntax |
|
|
Example |
|
|
Function |
Specifies the full path and file name of the time zone file. The Oracle Database Server always uses the large time zone file ( |
|
Syntax |
|
|
Example |
|
|
Function |
Specifies the base of the Oracle directory structure for Optimal Flexible Architecture compliant installations. |
|
Syntax |
|
|
Example |
|
|
Function |
Specifies the directory containing the Oracle software. |
|
Syntax |
|
|
Example |
|
|
Function |
Specifies the search path for files used by Oracle applications such as SQL*Plus. If the full path to the file is not specified, or if the file is not in the current directory, then the Oracle application uses |
|
Syntax |
Colon-separated list of directories: directory1:directory2:directory3 |
|
Example |
Note: The period adds the current working directory to the search path. |
|
Function |
Specifies the Oracle system identifier. |
|
Syntax |
A string of numbers and letters that must begin with a letter. Oracle recommends a maximum of 8 characters for system identifiers. For more information about this environment variable, refer to Oracle Database Installation Guide. |
|
Example |
SAL1 |
|
Function |
Enables the tracing of shell scripts during an installation. If it is set to |
|
Syntax |
|
|
Example |
|
|
Function |
Controls whether the |
|
Syntax |
|
|
Example |
|
|
Function |
Specifies the directory or list of directories that SQL*Plus searches for a |
|
Syntax |
Colon-separated list of directories: |
|
Example |
|
|
|
Function |
Specifies the directory containing the Oracle Net Services configuration files. |
Syntax |
|
|
Example |
|
|
Function |
Specifies the default connect identifier to use in the connect string. If this environment variable is set, then do not specify the connect identifier in the connect string. For example, if the SQL> CONNECT USERNAME
Enter password: password
|
|
Syntax |
Any connect identifier. |
|
Range of Values |
Any valid connect identifier that can be resolved by using a naming method, such as a |
|
Example |
|
|
|
Function |
Specifies the Oracle character set name corresponding to the UNIX locale character set in which the file names and user names are encoded by the operating system. You must set the environment variable |
Syntax |
|
|
Example |
|
Note:
To prevent conflicts, do not define environment variables with names that are identical to the names of Oracle Database server processes, for exampleARCH
, PMON
, and DBWR
.Table 1-2 describes UNIX environment variables used with Oracle Database.
Table 1-2 Environment Variables Used with Oracle Database
Variable | Detail | Definition |
---|---|---|
|
Function |
|
Syntax |
|
|
Example |
|
|
|
Function |
For all precompiled applications where calculations are done using the extended precision of the x86 Floating Point Unit, this variable must be set to Note: Setting this variable results in non-IEEE compliant floating point results. Hence, |
Function |
Used with Java applications. The required setting for this variable depends on the Java application. Refer to the product documentation for Java application for more information. |
|
Syntax |
Colon-separated list of directories or files: |
|
Example |
There is no default setting.
|
|
Function |
Used by X-based tools. Specifies the display device used for input and output. Refer to the X Window System documentation for information. |
|
Syntax |
hostname:server[.screen] where Note: If you use a single monitor, then |
|
Example |
135.287.222.12:0.0 bambi:0 |
|
Syntax |
Colon-separated list of directories: |
|
Example |
|
|
Function |
The home directory of the user. |
|
Syntax |
|
|
Example |
|
|
Function |
Specifies the language and character set used by the operating system for messages and other output. Oracle tools that are programmed in Java, such as Oracle Universal Installer and Oracle Database Configuration Assistant, may also use this variable to determine the language of their user interface. Refer to the operating system documentation for more information. |
|
Function |
Specifies the default linker options. Refer to the |
|
Function |
Specifies the name of the default printer. |
|
Syntax |
|
|
Example |
|
|
Function |
Environment variable to specify the path used to search for libraries on UNIX and Linux. The environment variable may have a different name on some operating systems, such as |
|
Syntax |
Colon-separated list of directories: |
|
Example |
|
|
Function |
Used by the shell to locate executable programs; must include the |
|
Syntax |
Colon-separated list of directories: |
|
Example |
Note: The period adds the current working directory to the search path. |
|
Function |
Specifies the name of the default printer. |
|
Syntax |
|
|
Example |
|
|
Function |
Specifies the default directories for temporary files; if set, tools that create temporary files create them in one of these directories. |
|
Syntax |
|
|
Example |
|
This section describes how to set a common operating system environment by using the oraenv
or coraenv
scripts, depending on the default shell:
For the Bourne, Bash, or Korn shell, use the oraenv
command.
For the C shell, use the coraenv
command.
oraenv and coraenv Script Files
The oraenv
and coraenv
scripts are created during installation. These scripts set environment variables based on the contents of the oratab
file and provide:
A central means of updating all user accounts with database changes
A mechanism for switching between databases specified in the oratab
file
You may find yourself frequently adding and removing databases from the development system or your users may be switching between several different Oracle Databases installed on the same system. You can use the oraenv
or coraenv
script to ensure that user accounts are updated and to switch between databases.
Note:
Do not call theoraenv
or coraenv
script from the Oracle software owner (typically, oracle
) user's shell startup script. Because these scripts prompt for values, they can prevent the dbstart
script from starting a database automatically when the system starts.The oraenv
or coraenv
script is usually called from the user's shell startup file (for example, .profile
or.login
). It sets the ORACLE_SID
and ORACLE_HOME
environment variables and includes the $ORACLE_HOME/bin
directory in the PATH
environment variable setting. When switching between databases, users can run the oraenv
or coraenv
script to set these environment variables.
Note:
To run one of these scripts, use the appropriate command:coraenv
script:
% source /usr/local/bin/coraenv
oraenv
script:
$ . /usr/local/bin/oraenv
The directory that contains the oraenv
, coraenv
, and dbhome
scripts is called the local bin
directory. All database users must have read access to this directory. Include the path of the local bin directory PATH
environment variable setting for the users. When you run the root.sh
script after installation, the script prompts you for the path of the local bin
directory and automatically copies the oraenv
, coraenv
, and dbhome
scripts to the directory that you specify. The default local bin
directory is /usr/local/bin
. If you do not run the root.sh
script, then you can manually copy the oraenv
or coraenv
and dbhome
scripts from the $ORACLE_HOME/bin
directory to the local bin
directory.
The TZ
environment variable sets the time zone. It enables you to adjust the clock for daylight saving time changes or different time zones.
See Also:
Oracle Database Globalization Support Guide and Oracle Database Administrator's Guide for more information about setting the database time zoneThe following sections provide information about Oracle Database initialization parameters:
The DB_BLOCK_SIZE
initialization parameter specifies the standard block size for the database. This block size is used for the SYSTEM
tablespace and by default in other tablespaces.
The maximum value to which you can set the DB_BLOCK_SIZE
is 16 KB on Linux x86. It is 32 KB on other platforms.
Note:
You cannot change the value of theDB_BLOCK_SIZE
initialization parameter after you create a database.Note:
Only Automatic Storage Management instances support theASM_DISKSTRING
initialization parameter.The syntax for assigning a value to the ASM_DISKSTRING
initialization parameter is as follows:
ASM_DISKSTRING = 'path1'[,'path2', . . .]
In this syntax, pathn
is the path to a raw device. You can use wildcard characters when specifying the path.
Table 1-3 lists the platform-specific default values for the ASM_DISKSTRING
initialization parameter.
The maximum value that you can set for ASYNC
in the LOG_ARCHIVE_DEST_
n initialization parameter differs on UNIX platforms as listed in the following table:
Platform | Maximum Value |
---|---|
HP-UX | 51200 |
Other operating systems | 102400 |
The DISK_ASYNCH_IO
initialization parameter determines whether the database files reside on raw disks or file systems. Asynchronous I/O is available only with Automatic Storage Management disk group which uses raw partitions as the storage option for database files. The DISK_ASYNCH_IO
parameter can be set to TRUE
or FALSE
depending on where the files reside. By default, the value is set to TRUE
.
Note:
TheDISK_ASYNCH_IO
parameter must be set to FALSE
when the database files reside on file system. This parameter must be set to TRUE
only when the database files reside on raw partitions.This section describes the following special operating system accounts and groups that are required by Oracle Database:
If required, create additional operating system accounts. Users must be members of the OSDBA or OSOPER groups to connect to the database with administrator privileges.
Update the startup files of the oracle
user and the operating system accounts of Oracle users, specifying the appropriate environment variables in the environment file.
For the Bourne, Bash, or Korn shell, add the environment variables to the .profile
file, or the .bash_profile
file for the Bash shell on Red Hat Enterprise Linux.
For the C shell, add the environment variables to the .login
file.
Note:
You can use theoraenv
or coraenv
script to ensure that Oracle user accounts are updated.This section describes the trace (or dump) that Oracle Database creates to help you diagnose and resolve operating problems.
Each server and background process writes to a trace file. When a process detects an internal error, it writes information about the error to its trace file. The file name format of a trace file is sid_processname_unixpid
.trc
, where:
sid
is the instance system identifier
processname
is a three or four-character abbreviated process name identifying the Oracle Database process that generated the file (for example, pmon
, dbwr
, ora
, or reco
)
unixpid
is the operating system process ID number
The following is a sample trace file name:
$ORACLE_BASE/diag/rdbms/mydb/mydb/trace/test_lgwr_1237.trc
Set the MAX_DUMP_FILE
initialization parameter to at least 5000, to ensure that the trace file is large enough to store error information.