Oracle8i Administrator's Reference
Release 3 (8.1.7) for Sun SPARC Solaris

Part Number A85349-01

Library

Product

Contents

Index

Go to previous page Go to next page

1
Administering Oracle8i

This chapter provides information about Oracle8i administration for Sun SPARC Solaris. It contains the following sections:

Overview

Oracle8i needs environment variables, parameters, memory and user settings established in order to work. This chapter describes the various settings for Sun SPARC Solaris.

In Oracle8i files and programs, a question mark (?) represents the value of ORACLE_HOME. For example, Oracle8i expands the question mark in the following SQL statement to the full pathname of ORACLE_HOME:

alter tablespace TEMP add datafile '?/dbs/dbs2.dbf' size 2M

The @ sign represents $ORACLE_SID. For example, to indicate a file belonging to the current instance, enter:

alter tablespace tablespace_name add datafile 'dbsfile@.dbf'

Environment Variables

This section describes the most commonly-used Oracle8i and UNIX environment variables.

To display the current value of an environment variable, use the env command. For example, to display the value of ORACLE_SID, enter:

$ env | grep ORACLE_SID


Note:

The command env should be used to show what has been exported to the environment. Bourne shell and Korn shell can set values without exporting. 


Some of these variables must be defined before installing Oracle8i. They are listed in your Oracle8i Installation Guide for Sun SPARC Solaris Release 3 (8.1.7).

Oracle8i Environment Variables

Table 1-1 provides the syntax and examples for Oracle8i variables.

Table 1-1 Oracle8i Environment Variables on UNIX
Variable  Detail  Definition 

EPC_DISABLED 

Function 

Disables Oracle Trace 

 

Syntax 

true or false 

NLS_LANG 

Function 

Specifies the language, territory and character set of the client environment. The character set specified in NLS_LANG must match the character set of the terminal or terminal emulator. The character set specified in NLS_LANG can be different from the database character set, in which case Oracle automatically converts the character set.

See the Oracle8i National Language Support Guide for a list of values.  

Syntax 

language_territory.characterset 

Example 

french_france.we8dec 

ORA_NLS33 

Function 

Points to the directory where language, territory, character set, and linguistic definition files are stored.  

Example 

$ORACLE_HOME/ocommon/nls/admin/data 

ORACLE_BASE 

Function 

Specifies the base of the Oracle directory structure for Optimal Flexible Architecture (OFA) compliant databases.  

Syntax 

directory_path 

Example 

/u01/app/oracle 

ORACLE_HOME 

Function 

Specifies the directory containing the Oracle software. 

Syntax 

directory_path 

Example 

$ORACLE_BASE/product/8.1.7 

ORACLE_PATH 

Function 

Specifies the search path for files used by Oracle applications, such as *.sql, *.frm, and *.rpt. If the full path to the file is not specified, or is not in the current directory, the Oracle application will use ORACLE_PATH to locate the file. 

Syntax 

colon-separated list of directories:
directory1:directory2:directory3 

Example 

/u01/oracle/adhoc/8.1.7/bin:.


Note: The period adds the current working directory to the search path. 

ORACLE_SID 

Function 

Specifies the Oracle system identifier. 

Syntax 

A string of numbers and characters that begins with a letter. Oracle Corporation recommends a maximum of eight characters. For more information, see the Oracle8i Installation Guide for Sun SPARC Solaris Release 3 (8.1.7).  

Example 

SAL1 

ORACLE_TRACE 

Function 

Turns on tracing of Bourne shell scripts during an installation. If set to T, many Oracle shell scripts run with the set -x flag on.  

Range of Values 

T or not T

ORAENV_ASK 

Function 

Controls whether coraenv or oraenv prompt for ORACLE_SID or ORACLE_HOME. If set to NO, they do not prompt; otherwise they do. 

Syntax 

string 

Range of Values 

NO or not NO

SQLPATH 

Function 

Sets the directory or list of directories that SQL*Plus will search for a login.sql file. 

 

Syntax 

colon-separated list of directories:
directory1:directory2:directory3 

 

Example 

/home:/home/oracle:/u01/oracle 

TNS_ADMIN 

Function 

Sets the directory containing the Net8 configuration files.  

Syntax 

directory_path 

Range of Values 

Any directory; for more information, see the Oracle8i Installation Guide Sun SPARC Solaris. 

Example 

$ORACLE_HOME/network/admin 

TWO_TASK 

Function 

Sets the default Net8 connect string descriptor alias defined in the tnsnames.ora file.  

Syntax 

Available network alias. 

Range of Values 

Any valid Net8 alias defined in the tnsnames.ora file. 

Example 

PRODDB_TCP 


Note:

Do not define environment variables with values that are identical to names of Oracle Server processes, for example: arch, pmon, and dbwr


UNIX Environment Variables

Table 1-2 provides the syntax and examples for UNIX environment variables used with Oracle8i.

Table 1-2 UNIX Environment Variables Used with Oracle8i
Variable  Detail  Definition 

ADA_PATH 

Function 

Specifies the directory containing the Ada compiler.  

CLASSPATH 

Function 

Used for Java Functionality. This variable differs with the Java application. See the product documentation for your Java application for more information. 

 

Syntax 

directory_path 

 

Example 

There is no default setting. CLASSPATH must include the following:
JRE_Location, $ORACLE_HOME/product/jlib

where JRE_Location is defined as $ORACLE_HOME/JRE

DISPLAY 

Function 

Used by X-based tools. Specifies the display device used for input and output. See the X Windows documentation of the vendor for details.  

Syntax 

hostname:display
where the hostname is your machine name (either IP address or alias); display is the monitor number. If you have a single monitor, the number is 0. 

Example 

135.287.222.12:0
bambi:0
 

HOME 

Function 

The user's home directory.  

LANG or LANGUAGE 

Function 

Specifies the language and character set used by the operating system for messages and other output. See the operating system documentation and your Oracle8i Installation Guide for Sun SPARC Solaris Release 3 (8.1.7).  

LD_OPTIONS 

Function 

Specifies the default linker options. See the ld man pages for details. 

LPDEST 

Function 

Specifies the user's default printer.  

Syntax 

printer_name 

Example 

docqms 

LDPATH 

Function 

Default directories used by the linker to find shared object libraries. See the ld man pages for details.  

LD_LIBRARY_PATH 

Function 

Used by the shared library loader (ld.so.1) at runtime to find shared object libraries. See theld.so.1 man pages for details.  

Syntax 

Colon-separated list of directories:
directory1:directory2:directory3 

Example 

/usr/dt/lib:$ORACLE_HOME/lib 

PATH 

Function 

Used by the shell to locate executable programs; must include $ORACLE_HOME/bin.  

 

Syntax 

Colon-separated list of directories:
directory1:directory2:directory3 

 

Example 

/bin:/usr/bin:/usr/local/bin:
/usr/bin/X11:$ORACLE_HOME/bin:$HOME/bin:.
Note: The period adds the current working directory to the search path. 

PRINTER 

Function 

Selects the default printer. 

 

Syntax 

printer_name 

 

Example 

docqms 

SHELL  

Function 

Specifies the command interpreter used during a host command. 

 

Syntax 

shell_path 

 

Range of Values 

/bin/sh or /bin/csh or /bin/ksh or any other command interpreter supplied with Sun SPARC Solaris. 

 

Example 

/bin/sh 

TERM 

Function 

Used by Oracle Toolkit II character mode tools and other UNIX tools to determine terminal types.  

 

Example 

vt100 

TMPDIR 

Function 

Specifies the default directory for temporary disk files; if set, tools that create a temporary files do so in this directory. 

 

Syntax 

directory_path 

 

Example 

/u02/oracle/tmp 

XENVIRONMENT 

Function 

Specifies a file containing X-Windows system resource definitions. See your X-Windows documentation for more information.  

Setting a Common Environment

Oracle8i allows a DBA to set a common environment for all users. A common environment makes it easier for system administrators and database administrators to make changes to the physical Oracle8i system.

The oraenv Command File

The oraenv command file is created during installation. It contains values for Oracle environment variables and provides:

For example, you may find yourself frequently adding and removing databases from your development system or your users may be switching between several different Oracle databases installed on the same system. With oraenv, each user profile calls the oraenv command file.


Note:

The C shell uses the coraenv command instead of the oraenv command.  


Local bin Directory

Placing oraenv and dbhome in a local bin directory, separate from the Oracle software home directory, ensures that these files are accessible to all users. It also ensures that oraenv continues to work even if you change the path to point to a different ORACLE_HOME. The local bin directory is specified by the root.sh script, which is run following installation. The default location for the local bin directory on Solaris is /usr/local/bin.

Moving Between Databases

To switch from one database or instance to another, call the oraenv routine, and reply to the prompt with the sid of the desired database. Always provide the full path of the oraenv command file. For example:

For example:

$ . /usr/local/bin/oraenv
ORACLE_SID= [default]? sid

Setting and Exporting the Value of a Variable in a Current Session

The env command should be used to show what has been exported to the environment. Bourne shell and Korn shell can set values without exporting.

For the Bourne or Korn shell, enter:

$ ORACLE_SID=test
$ export ORACLE_SID

For the C shell, enter:

% setenv ORACLE_SID test

where test is the value of the variable ORACLE_SID.

Setting the System Time

The TZ variable sets the time zone. It allows you to adjust the clock for daylight saving time changes or different time zones. The adjusted time is used to time-stamp files, produce the output of the date command, and obtain the current SYSDATE.

Oracle Corporation recommends that the TZ value not be changed. Using different values of TZ such as GMT+24 may change the day a transaction is recorded. This affects Oracle applications that use SYSDATE, such as Oracle Financials. To avoid this problem, use sequence numbers to order a table instead of date columns.

Network Executables

You can manually relink your product executables with a relink shell script located in the $ORACLE_HOME/bin directory. Relinking is necessary after applying any operating system patches or an operating system upgrade.

The relink script performs manual relinking of Oracle product executables based on what has been installed in the ORACLE_HOME.

To relink, enter the following:

$ relink parameter

Table 1-3 Relink Script Parameters
Parameter  Value 

all 

everything installed 

oracle 

Oracle database executable only 

network 

net_client, net_server, nau, cman, cnames 

client 

net_client, otrace, plsql, client_sharedlib 

interMedia 

ctx, ordimg, ordaud, ordvir, md 

precomp 

all precompilers which have been installed 

utilities 

utilities 

oemagent 

oemagent, odg 


Note:

Shut down Oracle Intelligent Agent, and other Oracle programs under this ORACLE_HOME when relinking databases. 


System Global Area

The System Global Area (SGA) is the Oracle structure that resides in shared memory. It contains static data structures, locks, and data buffers. Sufficient shared memory must be available to each oracle process to address the entire SGA.

The maximum size of a single shared memory segment is specified by the Solaris SHMMAX.parameter. The recommended value for SHMMAX is 4,294,967,296 regardless of the actual memory installed on the system.

If the size of the SGA exceeds the maximum size of a shared memory segment (SHMMAX), Oracle8i attempts to attach more contiguous segments to fulfill the requested SGA size. SHMSEG is the maximum number of segments that can be attached by a process.


Note:

Intimate Shared Memory (ISM) may cause problems when SHMMAX is smaller than the database SGA size. 


The following initsid.ora parameters control the size of the SGA:

Use caution when setting values for these parameters. When values are set too high, too much of the machine's physical memory is devoted to shared memory, resulting in poor performance.

Calculating the Size of the SGA

You can determine the SGA size in one of these ways:

The address at which the SGA is attached affects the amount of virtual address space available for database buffers in the SGA, and cursors in the user's application data area To relocate the SGA:.

  1. Determine the valid virtual address range for attaching shared memory segments. Use the tstshm executable included in this release of Oracle8i by entering:

    $ tstshm
    

    In the output from tstshm, the lines "Lowest shared memory address" and "Highest shared memory address" indicate the valid address range.

  2. Check the "segment boundaries" output of tstshm to determine the valid virtual address boundaries at which a shared memory segment can attach.

  3. Move to the $ORACLE_HOME/rdbms/lib directory, and run genksms to generate the ksms.s file by entering:

    $ cd $ORACLE_HOME/rdbms/lib
    $ $ORACLE_HOME/bin/genksms -b sgabeg > ksms.s

    where sgabeg is the starting address of the SGA (which defaults to 0x80000000) and should fall within the range determined in step 2.

    Never set sgabeg below 0x01000000. On most systems, this leaves about 7 MB for data segments. This amount must allow enough memory for SORT_AREA_SIZE and similar items.

    With a start address of 0x1000000 you can achieve an overall SGA size of about 3.5GB.

    You can receive the following error messages if you reduced the value of sgabeg:

    ORA-4030: out of process memory when trying to allocate %s bytes (%s,%s)
    
    

    or

    ORA-7324: smpall: malloc error while allocating pga. 
    
    

    If you receive one of these messages, you probably lowered the start address into an area which the PGA needs. Raise sgabeg, and try again.

  4. Shut down the existing Oracle database.

  5. Rebuild the oracle executable in the $ORACLE_HOME/rdbms/lib directory by entering:

    $ make -f ins_rdbms.mk ksms.o
    $ make -f ins_rdbms.mk ioracle

    Using ioracle:

    • Backs up the old executable (oracle0).

    • Assigns the correct privileges to the new oracle executable.

    • Moves the new executable into the $ORACLE_HOME/bin directory.

    The result is a new Oracle kernel that loads the SGA at the address specified by sgabeg.

    See Also:

    For more information about how the use of Java in the database affects SGA calculations, see the README file in
    $ORACLE_HOME/javavm/doc

Oracle8i Memory Requirements and Usage

Calculate memory usage requirements to determine the number of users that can be on the system. This will also help in determining the physical memory and swap space requirements. To calculate the memory requirements, use the following formula:

<size of the oracle executable text>
+ <size of the SGA>
+ n * ( <size of tool executables private data section>
+ <size of oracle executables uninitialized data section>
+ <8192 bytes for the stack>
+ <2048 bytes for the processes user area>)

For each client-server connection, use the following formula to estimate virtual memory requirements:

<size of oracle executable data section>
+ <size of oracle executables uninitialized data section>
+ <8192 bytes for the stack>
+ <2048 bytes for processes user area>
+ <cursor area needed for the application>

Use the size command to estimate an executable's text size, private data section size, and uninitialized data section size (or DSS). Program text is only counted once, no matter how many times the program is invoked, because Oracle executable text is shared.

To calculate the Oracle physical memory (background and shadow processes) usage while the database is up and users are connected to it, use the pmap command. Sum the shared sections (indicated by read/write/exec/shared and read/exec) for the pmon process. Sum the private section (indicated by read/write/exec) for each shadow and background process, including pmon. Background process names begin with ora_, and end with the SID. Shadow process names begin with oracleSID.

Calculating acutal memory usage

  1. Use the following script to show the actual memory usage.

    
    #!/usr/bin/sh
    
    # Copyright 2000 Oracle Corporation
    #
    # modification history:
    # date        by        comments
    # ----------  --------  ----------------
    # 07/15/2000 rgulledg  original program
    #
    
    usage()
    {
    echo "Usage: $0 [ SB ]"
    echo "Usage: $0 [ P <pid> ]"
    echo "Usage: $0 [ h ]"
    echo " "
    echo "specify 'S' for Oracle shadow processes"
    echo "specify 'B' for Oracle background processes (includes shared
    memory SGA)"
    echo "specify 'h' for help"
    echo " "
    }
    
    echo " "
    
    #
    # check usage
    #
    if [ $# = "0" ];then
      usage;exit 1
    fi
    if [ $1 = "h" ];then
      echo "This script uses the Sun Solaris pmap command to determine
    memory usage"
      echo "for Oracle server [B]ackground processes and/or [S]hadow
    processes."
      echo "An individual [P]rocess can also be specified."
      echo " "
      echo "Although the Oracle server background processes memory usage
    should"
      echo "remain fairly constant, the memory used by any given shadow
    process"
      echo "can vary greatly.  This script shows only a snapshot of the
    current"
      echo "memory usage for the processes specified."
      echo " "
      echo "The 'B' option shows the sum of memory usage for all Oracle server"
      echo "background processes, including shared memory like the SGA."
      echo " "
      echo "The 'S' option shows the sum of private memory usage by all"
      echo "shadow processes.  It does not include any shared memory like the"
      echo "SGA since these are part of the Oracle server background processes."
      echo " "
      echo "The 'P' option shows memory usage for a specified process, broken"
      echo "into two categories, private and shared.  If the same executable"
      echo "for this process was invoked again, only the private memory"
      echo "would be allocated, the rest is shared with the currently running"
      echo "process."
      echo " "
      usage;exit 1
    fi
    echo $1|grep [SBP] > /dev/null
    ParmFound=$?
    if [ $ParmFound != "0" ];then
      usage;exit 1
    fi
    echo $1|grep P > /dev/null
    ParmFound=$?
    if [ $ParmFound = "0" ];then
      if [ $1 != "P" ];then
        usage;exit 1
      fi
      if [ "X$2" = "X" ];then
        usage;exit 1
      fi
      echo $2|grep [0-9] > /dev/null
      ParmFound=$?
      if [ $ParmFound != "0" ];then
        usage;exit 1
      fi
      PidOwner=`ps -ef | grep -v grep | grep $2 | grep -v $0 | awk '{print \
    $1}'`
      CurOwner=`/usr/xpg4/bin/id -un`
      if [ "X$PidOwner" != "X$CurOwner" ];then
        echo "Not owner of pid $2, or pid $2 does not exist"
        echo " "
        usage;exit 1
      fi
    else
      if [ "X${ORACLE_SID}" = "X" ];then
        echo "You must set ORACLE_SID first"
        usage;exit1
      fi
    fi
    
    #
    # initialize variables
    #
    Pmap="/usr/proc/bin/pmap"
    SharUse="/tmp/omemuseS$$"
    PrivUse="/tmp/omemuseP$$"
    ShadUse="/tmp/omemuseD$$"
    PidPUse="/tmp/omemusePP$$"
    PidSUse="/tmp/omemusePS$$"
    TotalShad=0
    TotalShar=0
    TotalPriv=0
    PidPriv=0
    PidShar=0
    
    #
    # shadow processes
    #
    echo $1|grep S > /dev/null
    ParmFound=$?
    if [ $ParmFound = "0" ];then
      ShadPrc="`ps -ef|grep -v grep|grep oracle$ORACLE_SID|awk '{print $2}'`"
      echo "" > $ShadUse
      for i in $ShadPrc;do
        $Pmap $i | grep "read/write" | grep -v shared | \
          awk '{print $2}' | awk -FK '{print $1}' >> $ShadUse
      done
      for i in `cat $ShadUse`;do
        TotalShad=`expr $TotalShad + $i`
      done
      TotalShad=`expr $TotalShad "*" 1024`
      echo "Total Shadow  (bytes) : $TotalShad"
      /bin/rm $ShadUse
    fi
    
    #
    # non-shared portion of background processes
    #
    echo $1|grep B > /dev/null
    ParmFound=$?
    if [ $ParmFound = "0" ];then
      OrclPrc="`ps -ef|grep -v grep|grep ora_|grep $ORACLE_SID|awk '{print $2}'`"
      BkgdPrc="`echo $OrclPrc|awk '{print $1}'`"
      echo "" > $PrivUse
      for i in $OrclPrc;do
        $Pmap $i | grep "read/write" | grep -v shared | \
          awk '{print $2}' | awk -FK '{print $1}' >> $PrivUse
      done
      for i in `cat $PrivUse`;do
        TotalPriv=`expr $TotalPriv + $i`
      done
      TotalPriv=`expr $TotalPriv "*" 1024`
      echo "Total Private (bytes) : $TotalPriv"
    
    #
    # shared portion of background processes
    #
      echo "" > $SharUse
      $Pmap $BkgdPrc | grep "read/exec" | \
        awk '{print $2}' | awk -FK '{print $1}' >> $SharUse
      $Pmap $BkgdPrc | grep "shared" | \
        awk '{print $2}' | awk -FK '{print $1}' >> $SharUse
      for i in `cat $SharUse`;do
        TotalShar=`expr $TotalShar + $i`
      done
      TotalShar=`expr $TotalShar "*" 1024`
      echo "Total Shared  (bytes) : $TotalShar"
      /bin/rm $SharUse $PrivUse
    fi
    
    #
    # non-shared portion of pid
    #
    echo $1|grep P > /dev/null
    ParmFound=$?
    if [ $ParmFound = "0" ];then
      echo "" > $PidPUse
      $Pmap $2 | grep "read/write" | grep -v shared | \
        awk '{print $2}' | awk -FK '{print $1}' >> $PidPUse
      for i in `cat $PidPUse`;do
        PidPriv=`expr $PidPriv + $i`
      done
      PidPriv=`expr $PidPriv "*" 1024`
      echo "Total Private (bytes) : $PidPriv"
    
    #
    # shared portion of pid
    #
      echo "" > $PidSUse
      $Pmap $2 | grep "read/exec" | awk '{print $2}' | \
        awk -FK '{print $1}' >> $PidSUse
      $Pmap $2 | grep "shared" | awk '{print $2}' | \
        awk -FK '{print $1}' >> $PidSUse
      for i in `cat $PidSUse`;do
        PidShar=`expr $PidShar + $i`
      done
      PidShar=`expr $PidShar "*" 1024`
      echo "Total Shared  (bytes) : $PidShar"
      /bin/rm $PidPUse $PidSUse
    fi
    
    #
    # Display grand total
    #
    Gtotal="`expr $TotalShad + $TotalPriv + $TotalShar + $PidPriv + \
    $PidShar`"
    echo "                  -----"
    echo "Grand Total   (bytes) :   $Gtotal"
    echo " "
    
    
  2. Use the ps command to determine process size in pages.

    System page size is architecture-dependent. Use the pagesize command to determine whether the size is 4096 or 8192 bytes.

    Do not use the ps -elf command as the SZ column repeats the shared portion of memory for each process shown, and makes it appear that Oracle is using much more memory than it actually is.

    See Also:

    Refer to your Sun SPARC Solaris documentation for a list of available switches for the ps command. 

  3. For each process, multiply the SZ value by the page size.

  4. Add the text size for the Oracle executable and every other Oracle tool executable running on the system to that subtotal. Remember to count executable sizes only once, regardless of how many times the executable is invoked.

Server Resource Limits

Solaris inherits resource limits from the parent process (see getrlimit(2) in your operating system documentation). These limits apply to the Oracle8i shadow process that executes for user processes. The Solaris default resource limits are high enough for any Oracle8i shadow or background process. However, if these limits are lowered, the Oracle8i system could be affected. Discuss this with your Solaris system manager.

Disk quotas established for the oracle user can hinder the operation of the Oracle8i system. Confer with your Oracle8i DBA and the Solaris system manager before establishing disk quotas.

Database Limits

Table 1-4 lists the maximum and default values for parameters in a CREATE DATABASE or CREATE CONTROL FILE statement.


Note:

Interdependencies among these parameters may affect allowable values. 


Table 1-4 Create Control File Parameters
Parameter  Default Value  Maximum Value 

MAXDATAFILES 

30 

65534 

MAXINSTANCES 

63 

MAXLOGFILES 

16 

255 

MAXLOGHISTORY 

100 

65534 

MAXLOGMEMBERS 

Table 1-5 Oracle-Specific File Size Limits
File Type  Maximum Size 

datafiles db_block_size = 2048 

8,589,932,544 

datafiles db_block_size = 4096 

17,179,865,088 

datafiles db_block_size = 8192 

34,359,730,176 

datafiles db_block_size = 16384 

68,719,460,352 

Import/Export file 

2,147,483,647 

SQL*Loader 

2,147,483,647 

Special Accounts and Groups

Special accounts are required by the Oracle server. The special UNIX accounts are described in Table 1-6. The special Oracle server accounts are described in Table 1-7. Special group accounts are described in Table 1-8.

Table 1-6 UNIX Accounts

oracle 

The oracle software owner represents the account that owns the Oracle8i software. This maintenance account requires DBA privileges in order to CREATE, STARTUP, SHUTDOWN, and CONNECT as INTERNAL to the database. The oracle software owner must never be the superuser. 

root 

The root user is a special UNIX account with maximum privileges (superuser). This account is used to configure the UNIX kernel, configure and install networking software, and create user accounts and groups. 

Table 1-7 Oracle Server Accounts

SYS 

This is a standard Oracle8i account with DBA privileges automatically created during installation. The SYS account owns all the base tables for the data dictionary. This account is used by the DBA. 

SYSTEM 

This is a standard Oracle8i account with DBA privileges automatically created during installation. Additional tables or views can be created by the SYSTEM user. DBAs may log in as SYSTEM to monitor or maintain databases. 

Table 1-8 Special Group Accounts

dba group 

The oracle software owner is the only required member of the dba group. You can add any other UNIX user to the dba group. Members of this group have access to SQL*Plus specially privileged functions. If your account is not a member of the dba group, you must enter a password in order to connect as INTERNAL or gain access to the other administrative functions of SQL*Plus. The default OSDBA group is dba

oinstall group 

All users installing Oracle8i in any ORACLE_HOME must belong to the same UNIX group. The OUI inventory is shared by all ORACLE_HOMEs on a machine and is group writable. Oracle recommends installing with oinstall as the primary group. 

oper group 

This is an optional UNIX group. Members have database OPERATOR privileges. OPERATOR privileges are a restricted set of dba privileges.  

root group 

Only the root user should be a member of the root group. 

Security

Oracle8i uses several features of the UNIX operating system to provide a secure environment for users. These features include file ownership, group accounts, and the ability of a program to change its user ID upon execution.

The two-task architecture of Oracle8i improves security by dividing work (and address space) between the user program and the oracle program. All database access is achieved through the shadow process and special authorizations in the oracle program.

See Also:

For more information on security issues, see the Oracle8i Administrator's Guide

Groups and Security

Oracle programs are divided into two sets for security purposes: those executable by all (other, in UNIX terms), and those executable by DBAs only. A recommended approach to security is:

Security for Server Manager Commands

Oracle Corporation recommends that you restrict access to Server Manager. Only the oracle software owner and dba group members should have access to the system privileges for STARTUP, SHUTDOWN, and CONNECT INTERNAL.


WARNING:

System-privileged statements can damage your database if used incorrectly. Note that non-dba group users can connect as INTERNAL if they have the password. 


Security for Database Files

The user ID used to install Oracle8i should own the database files. The default user ID is the oracle software owner. Set the authorizations on these files to read/write by owner, and read-only for group or other users.

The oracle software owner should own the directories containing the database files. For added security, revoke read permission from group and other users.

To access the protected database files, the oracle program must have its set user ID, setuid, bit on.

The Oracle Universal Installer automatically sets the permissions of the oracle executable to:

-rwsr-s--x 1 oracle dba  443578 Mar 10 23:03 oracle

The s in the user execute field means that when you execute the oracle program, it has an effective user ID of oracle, regardless of the actual user ID of the person invoking it.

If you need to set this manually, enter:

$ chmod 6751 $ORACLE_HOME/bin/oracle

Remote Passwords

You can administer a database from a remote machine, such as a PC without having an operating system account. In this case, users are validated by using an Oracle8i password file, created and managed by the orapwd utility. You can also use password file validation on systems that support operating system accounts.

Local password files are in the $ORACLE_HOME/dbs directory and contain the username and password information for a single database. If there are multiple $ORACLE_HOME directories on a machine, each has a separate password file. To allow the database to use the password file, set the initsid.ora parameter remote_login_passwordfile to exclusive.

Access to a Database from a Remote PC

When there is an Oracle8i password file, networked PC users with DBA privileges can access the database as INTERNAL. Privileged users, who want to perform DBA functions on the database, can enter the appropriate SQL*Plus command from their computer, appending the dba user password to the command. For example:

SQL> connect internal/dba_password@alias as {sysdba|sysoper}

Remote Authentication

The initsid.ora parameters shown in Table 1-9 control the behavior of remote connections through non-secure protocols:

Table 1-9 Parameters for Controlling Remote Connections

REMOTE_OS_AUTHENT 

enables or disables ops$ connection 

OS_AUTHENT_PREFIX 

used by ops$ accounts 

REMOTE_OS_ROLES 

enables or disables roles through remote connections 

See Also:

For information on resource limits, see getrlimit(2) in your operating system documentation. 

Running orapwd

The orapwd utility exists in $ORACLE_HOME/bin and is run by the oracle software owner. The command syntax for orapwd is

$ orapwd file=filename password=password entries=max_users

This syntax is described in Table 1-10:

Table 1-10 Syntax for Executing orapwd

filename 

Name of the file where password information is written. The name of the file must be orapwsid, and you must supply the full pathname. Its contents are encrypted and not user-readable. This parameter is mandatory. 

password 

Initial password you selected for INTERNAL and SYS. Change this password after you create the database using an ALTER USER statement. This parameter is mandatory. 

max_users 

Maximum number of users allowed to connect to the database as SYSDBA or SYSOPER. This parameter is mandatory only if you want this password file to be EXCLUSIVE. Set max_users to a higher number than you expect to require because if you need to exceed this value, you must create a new password file. 

Example of orapwd

$ orapwd file=/u01/app/oracle/product/8.1.7/dbs/orapwV817
password=V817pw entries=30

See Also:

Oracle8i Administrator's Guide for information about security and passwords. 

Customizing the initsid.ora File

The default initsid.ora file is provided with the Oracle8i software. The Oracle Universal Installer (OUI) creates it in the $ORACLE_BASE/admin/sid/pfile directory. It can be modified to customize the Oracle8i installation. A sample of the initsid.ora file is located in the $ORACLE_HOME/dbs directory.

Table 1-11 lists default initialization parameter values on Solaris. All Oracle8i instances assume these values if you do not specify different values for them in the initsid.ora file. Oracle Corporation recommends that you include in the initsid.ora file only those parameters that differ from the default initialization parameter values.

Use the SQL*Plus command SHOW PARAMETERS to display the current values of these parameters on the system.

Table 1-11 Initialization Parameters
Parameter  Default Value  Range of Values 

BACKGROUND_DUMP_DEST 

?/rdbms/log 

Valid directory names 

BITMAP_MERGE_AREA_SIZE 

1048576 

65536 - unlimited 

COMMIT_POINT_STRENGTH 

0-255 

CONTROL_FILES 

?/dbs/cntrloracle_sid.dbf 

Valid file names 

CREATE_BITMAP_AREA_SIZE 

8388608 

65536 - unlimited 

DB_BLOCK_BUFFERS 

48MB of buffers 

50MB - unlimited 

DB_BLOCK_SIZE 

2048 

2KB - 16KB 

DB_FILES 

200 

1 - 2000000 

DB_FILE_DIRECT_IO_COUNT 

64 (maximum of 1048576) 

0 - 1048576/block size 

DB_FILE_MULTIBLOCK_READ_COUNT 

1 - min(DB_BLOCK_BUFFERS/4, 1048576/DB_BLOCK_SIZE) 

DISTRIBUTED_TRANSACTIONS 

1/4 TRANSACTIONS 

0 - unlimited 

HASH_AREA_SIZE 

2*SORT_AREA_SIZE 

0 - unlimited 

HASH_MULTIBLOCK_IO_COUNT 

0 (self-tuned) 

0 - min(127, DB_BLOCK_BUFFERS/4, 1048576/DB_BLOCK_SIZE) 

JAVA_POOL_SIZE 

20000000 

between 1000000 and 1000000000 

LOCK_SGA 

FALSE 

TRUE, FALSE 

LOG_ARCHIVE_DEST 

null 

Valid directory names 

LOG_ARCHIVE_FORMAT 

"%t_%s.dbf" 

Valid file names 

LOG_BUFFER 

max (512KB, 128KB*CPU_COUNT) 

66560 - unlimited 

LOG_CHECKPOINT_INTERVAL 

0 - unlimited 

MTS_MAX_DISPATCHERS 

between MTS_DISPATCHERS and PROCESSES 

MTS_MAX_SERVERS 

2*MTS_SERVERS, if MTS_SERVERS > 20, else 20 

between MTS_SERVERS and PROCESSES 

MTS_SERVERS 

1, if MTS_DISPATCHERS is specified, else 0 

between 1 and PROCESSES 

MTS_LISTENER_ADDRESS 

ADDRESS=address  

 

NLS_LANGUAGE 

AMERICAN 

Valid language names 

NLS_TERRITORY 

AMERICA 

Valid territory names 

OBJECT_CACHE_MAX_SIZE_PERCENT 

10 

0 - unlimited 

OBJECT_CACHE_OPTIMAL_SIZE 

100KB 

10KB - unlimited 

OPEN_CURSORS 

50 

1 - unlimited 

OS_AUTHENT_PREFIX 

ops$ 

Arbitrary string 

PROCESSES 

30, if not PARALLEL_AUTOMATIC_TUNING 

6 - unlimited 

SHARED_POOL_SIZE 

64MB on 64-bit, 8MB on 32-bit  

300000 - unlimited 

SORT_AREA_SIZE 

65536 

0 - unlimited 

See Also:

For information on initialization parameters see Oracle8i Server Reference, Oracle8i Administrator's Guide and Oracle8i Tuning

The Embedded PL/SQL Gateway

The embedded PL/SQL gateway is a gateway embedded in the Oracle8i server to provide native support for deploying PL/SQL-based database applications on the web. The embedded PL/SQL gateway is implemented as an Oracle Servlet Engine (OSE) servlet, and relies upon the existence and configuration of both the OSE and mod_ose, the Apache module which supports the OSE. The following instructions provide information on how to install and configure the gateway.

Overview

Two Apache modules, mod_ose and mod_plsql, support PL/SQL-based web applications.

The mod_ose module acts as a request router for an OSE running within an Oracle8i instance. Due to its routing abilities, mod_ose enables stateful OSE applications by routing stateful requests through the middle tier and back to a specified OSE/Oracle8i instance. Because the embedded PL/SQL gateway is implemented as an OSE servlet running in the Oracle8i server, it is able to host stateful, as well as stateless, PL/SQL web applications. A stateful PL/SQL web application is one in which all database session state (for example, package and transaction) is preserved between requests.

The mod_plsql module is the name given to the PL/SQL gateway running within an Apache module in the middle tier server and executing PL/SQL procedures in a backend Oracle server using OCI. mod_plsql currently only supports stateless PL/SQL web applications.

See Also:

For details on developing PL/SQL-based web applications, please refer to Using mod_plsql which is generic PL/SQL gateway documentation 

Installing the Embedded PL/SQL Gateway

As with all OSE servlets, the embedded PL/SQL gateway must be loaded and published.The following are instructions for loading and publishing the embedded PL/SQL gateway servlet.

  1. To load the servlet, connect to SQL*Plus as sys, and run the initplgs SQL script:

    
    $ SQL>@rdbms/admin/initplgs.sql 
    
    
  2. The name of the embedded PL/SQL gateway servlet is oracle.plsql.web.PLSQLGatewayServlet. To publish the servlet, run the following command:

    % $ORACLE_HOME/jis/bin/unix/sess_sh -s http://<OSE machine name>:<OSE port \ 
    number> -u sys/change_on_install -c "publishservlet -virtualpath \ 
    pls/*/webdomains/contexts/default plsGatewway \ 
    SYS:oracle.plsql.web.PLSQLGatewayServlet" 
    

This publishes the gateway servlet as plsGateway with a default context. The servlet can be accessed using the virtual path /pls. An example of a URL that might access the gateway servlet would look as follows:

http://dlsun240/pls/dadname/hello_world 

See Also:

For detailed information about using and publishing servlets, see the Oracle Servlet Engine User's Guide

Configuring Oracle PL/SQL Embedded Gateways

Configuration procedures for configuring the Apache server/mod_ose and the embedded PL/SQL gateway are beyond the scope of this reference.

See Also:

For information on configuring the Apache server/mod_ose, see Oracle Servlet Engine User's Guide

Oracle HTTP Server

The Oracle HTTP Server is Apache based. Administration tasks for the server require access to the local machine on which the server is running, and in some cases, requires root access.

The Oracle HTTP Server is started automatically upon installation on port 7777. The name of the server binary is httpd. Verify that the server is running using the following command:


ps -edaf | grep httpd 

Starting/Stopping the Oracle HTTP Server

Any modifications to the configuration will necessitate a restart of the server. Starting the server with SSL enabled requires that you be root. To restart the server:

cd $ORACLE_HOME/Apache/Apache/bin 
su root 
./apachectl {start|startssl|graceful|stop} 

Note:

Once the server is restarted with SSL enabled, the default ports will be 80 and 443. 

Accessing the Default Initial Static Page

The default initial static page contains links to online documentation for Apache as well as demos for each of the components. To access the initial static page, load one of the following URLs in your internet browser:

where ServerName is configured in the Apache server configuration file httpd.conf. To located the configuration file, use

grep ServerName $ORACLE_HOME/Apache/Apache/conf/httpd.conf 

Oracle HTTP Server status

Several status pages are available. For security reasons, server status is disabled in the default server configuration files. To enable them, edit the appropriate configuration file and restart the server.

For the configuration file $ORACLE_HOME/Apache/Apache/conf/httpd.conf, use

http://<ServerName>/server-status 
http://<ServerName>/server-info 
http://<ServerName>/perl-status 

For the configuration file $ORACLE_HOME/Apache/Jserv/etc/conf/jserv.conf, use

http://<ServerName>/jserv 

Oracle HTTP Server log files

A number of log files are generated by the server. It is important to check them periodically to make sure that the server is working correctly. By default, the error log level is set to warn in the configuration files. The default error level can be changed by editing the appropriate configuration file and restarting the server.

$ORACLE_HOME/Apache/Apache/logs/error_log 
$ORACLE_HOME/Apache/Apache/logs/ssl_engine_log 
$ORACLE_HOME/Apache/Jserv/logs/jserv.log 
$ORACLE_HOME/Apache/Jserv/logs/mod_jserv.log 

Demonstrations Files

SQL*Loader Demonstrations

Demonstration files are included with Oracle8i. The SQL*Loader demonstrations should be run in numerical order:

Table 1-12 SQL*Loader Demonstration Files
ulcase1  ulcase3  ulcase5  ulcase7 

ulcase2 

ulcase4 

ulcase6 

 

To create and run a demonstration

Demonstrations should be run as user scott/tiger. Ensure that:

  1. Run the ulcasen.sql script corresponding to the demonstration you want to run.

    $ sqlplus scott/tiger @ulcasen.sql
    
    
  2. Load the demonstration data into the objects:

    $ sqlldr scott/tiger ulcasen.ctl  
    
    

Administering SQL*Loader

Oracle8i incorporates SQL*Loader functionality. Demonstration and message files are in the rdbms directory.

The SQL*Loader control file includes the following additional file processing option strings, the default being str, which takes no argument:

[ "str" | "fix n" | "var n" ]
Table 1-13 File Processing Option

str 

Specifies a stream of records, each terminated by a newline character, which are read in one record at a time. This is the default. 

fix 

Indicates that the file consists of fixed-length records, each of which is n bytes long, where n is an integer value. 

var 

Indicates that the file consists of variable-length records, each of which is n bytes long, where n is an integer value specified in the first five characters of the record. 

If the file processing options are not selected, the information is processed by default as a stream of records (str). You might find that fix mode yields faster performance than the default str mode because it does not need to scan for record terminators.

Newlines in Fixed Length Records

When using the fix option to read a file containing fixed-length records, where each record is terminated by a newline, include the length of the newline (one character) when specifying the record length to SQL *Loader.

For example, to read the following file:

AAA newline
BBB newline
CCC newline

specify fix 4 instead of fix 3 to account for the additional newline character.

If you do not terminate the last record in a file of fixed records with a newline character, do not terminate the other records with a newline character either. Similarly, if you terminate the last record with a newline, terminate all records with a newline.


Caution:

Certain text editors, such as vi, automatically terminate the last record of a file with a newline character. This leads to inconsistencies if the other records in the file are not terminated with newline characters.  


Removing Newline Characters

Use the position(x:y) function in the control file to discard the newline characters from fixed length records rather than loading them. For example, enter the following to discard newline characters from the fourth position:

load data
infile xyz.dat "fix 4"
into table abc
( dept position(01:03) char )

When this is done, newline characters are discarded because they are in the fourth position in each fixed-length record.

PL/SQL Demonstrations

PL/SQL includes a number of sample programs you can load. Demonstration and message files are in the rdbms directory. The Oracle8i database must be open and mounted to work with the sample programs:

  1. Invoke SQL*Plus and connect with the user/password scott/tiger:

    $ cd $ORACLE_HOME/plsql/demo
    $ sqlplus scott/tiger
    
    
  2. To load the demonstrations, invoke exampbld.sql from SQL*Plus:

    SQL> @exampbld
    


    Note:

    Build the demonstrations under any Oracle account with sufficient permissions. Run the demonstrations under the same account as they were built. 


Table 1-14 lists the kernel demonstrations.

Table 1-14 Kernel Demonstrations

examp1.sql 

examp5.sql 

examp11.sql 

sample1.sql 

examp2.sql 

examp6.sql 

examp12.sql 

sample2.sql 

examp3.sql 

examp7.sql 

examp13.sql 

sample3.sql 

examp4.sql 

examp8.sql 

examp14.sql 

sample4.sql 

extproc.sql 

 

 

 

To run the PL/SQL demonstrations, invoke SQL*Plus to connect to the database, using the same user/password used to create the demonstrations. Start the demonstration by typing an @ sign or the word start before the demonstration name. For example, to start the examp1 demonstration, enter:

$ sqlplus scott/tiger
SQL> @examp1

To build the precompiler PL/SQL demonstrations, enter:

$ cd $ORACLE_HOME/plsql/demo
$ make  -f demo_plsql.mk demos

Table 1-15 lists the precompiler demonstrations.

Table 1-15 Precompiler Demonstrations

examp9.pc 

examp10.pc 

sample5.pc 

sample6.pc 

If you want to build a single demonstration, enter its name as the argument in the make command. For example, to build the examp9.pc executable, enter:

$ make  -f demo_plsql.mk examp9

To start the examp9 demonstration from your current shell, enter:

$ ./examp9

To run the extproc demo, first add the following line to the file, tnsnames.ora:

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=plsff))(CONNECT_DATA=(SID=extproc)))

and the following line to the file, listener.ora:

SC=(SID_NAME=extproc)(ORACLE_HOME=/u01/app/oracle/product/8.1.7) 
(PROGRAM=extproc))

then from your SQL*Plus session, enter:

SQL> connect system/manager
Connected.
SQL> grant create library to scott;
Grant succeeded.
SQL> connect scott/tiger
Connected.
SQL> create library demolib as
'$ORACLE_HOME/plsql/demo/extproc.so';
Library created.

Finally, to run the tests:

SQL> connect scott/tiger
Connected.
SQL> @extproc

Database Examples

In the following examples, it is assumed that the local bin directory is /usr/local/bin and the production database is called PROD. In addition, ORAENV_ASK is reset to the default, Yes, after oraenv is executed. This ensures that the system prompts for a different ORACLE_SID the next time oraenv is executed.


Note:

Set the ORAENV_ASK environment variable to no to not prompted for the ORACLE_SID at startup.  


If a database has been created manually instead of using Oracle Database Configuration Assistant, ensure the system configuration is reflected in the /var/opt/oracle/oratab file.

For each server instance, add an entry in the following format:

ORACLE_SID:ORACLE_HOME:{Y|N}

where Y or N indicates whether you want to activate the dbstart and dbshut scripts. The Oracle Database Configuration Assistant automatically adds an entry for each database it creates.

Example of Single Instance

For the Bourne or Korn shell, add or replace the following line in the.profile file:

. local_bin_directory/oraenv

with the lines:

PATH=${PATH}:/usr/local/bin
ORACLE_SID=PROD
export PATH ORACLE_SID
ORAENV_ASK=NO
. oraenv
ORAENV_ASK=

For the C shell, add or replace the following line in the.cshrc file:

source local_bin_directory/coraenv

with the lines:

setenv PATH ${PATH}:/usr/local/bin
setenv ORACLE_SID PROD
setenv ORAENV_ASK NO
source /usr/local/bin/coraenv
unset ORAENV_ASK

Example of Multiple Instances

For multiple instances, define the sid at startup.

For the Bourne or Korn shell:

#!/usr/bin/sh 
echo "The SIDs on this machine are:" 
cat /var/opt/oracle/oratab | awk -F: '{print $1}' | grep -v "#" 
ORAENV_ASK="YES" 
.  /usr/local/bin/oraenv 

For the C shell:

#!/usr/bin/csh 
echo "The SIDs on this machine are:" 
cat /var/opt/oracle/oratab | awk -F: '{print $1}' | grep -v "#" 
set ORAENV_ASK="YES" 
source /usr/local/bin/coraenv


Go to previous page Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index