+ All Categories
Home > Documents > Oracle8i...Oracle8i Administrator’s Reference Release 2 (8.1.6) for IBM DYNIX/ptx June 2000 Part...

Oracle8i...Oracle8i Administrator’s Reference Release 2 (8.1.6) for IBM DYNIX/ptx June 2000 Part...

Date post: 04-Feb-2021
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
158
Oracle8i Administrator’s Reference Release 2 (8.1.6) for IBM DYNIX/ptx June 2000 Part No. A85265-01 Includes topics on: Administering Oracle8i Tuning Oracle8i Administering SQL*Plus Using Oracle Precompilers and the Oracle Call Interface Configuring Net8 Running Oracle Data Option Demos Optimal Flexible Architecture
Transcript
  • Oracle8i

    Administrator’s Reference

    Release 2 (8.1.6) for IBM DYNIX/ptx

    June 2000

    Part No. A85265-01

    Includes topics on:Administering Oracle8iTuning Oracle8iAdministering SQL*PlusUsing Oracle Precompilers and the Oracle Call InterfaceConfiguring Net8Running Oracle Data Option DemosOptimal Flexible Architecture

  • Oracle8i Administrator’s Reference Release 2 (8.1.6) for IBM DYNIX/ptx

    Part No. A85265-01

    Copyright © 1996, 2000, Oracle Corporation. All rights reserved.

    The programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It shall be the licensee’s responsibility to take all appropriate fail-safe, backup, redundancy, and other measures to ensure the safe use of such applications if the programs are used for such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the programs.

    The programs (which include both the software and documentation) contain proprietary information of Oracle Corporation; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the programs is prohibited.

    The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this document is error free. Except as may be expressly permitted in your license agreement for these programs, no part of these programs may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation.

    If the programs are delivered to the U.S. Government or anyone licensing or using the programs on behalf of the U.S. Government, the following notice is applicable:

    Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial computer software" and use, duplication, and disclosure of the programs, including documentation, shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement. Otherwise, programs delivered subject to the Federal Acquisition Regulations are "restricted computer software" and use, duplication, and disclosure of the programs shall be subject to the restrictions in FAR 52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065.

    Oracle is a registered trademark, and JDeveloper, Net8, Network Computing Architecture, Oracle Call Interface, Oracle Enterprise Manager, Oracle interMedia, Oracle Names, Oracle Parallel Server, Oracle Server Manager, Oracle8i, Pro*COBOL, Pro*FORTRAN, and SQL*Plus are trademarks or registered trademarks of Oracle Corporation. All other company or product names mentioned are used for identification purposes only and may be trademarks of their respective owners.

  • Contents

    Send Us Your Comments ................................................................................................................... ix

    Preface............................................................................................................................................................ xi

    Purpose................................................................................................................................................... xiiAudience ................................................................................................................................................ xiiTypographic Conventions ................................................................................................................... xiiCommand Syntax ................................................................................................................................. xiiiAccessing Online Documentation ...................................................................................................... xiiiRelated Documentation ...................................................................................................................... xivOracle Services and Support .............................................................................................................. xiv

    1 Administering Oracle8i

    Setting the Environment ................................................................................................................... 1-2Displaying Environment Variables............................................................................................ 1-2Setting and Exporting the Value of a Variable in a Current Session .................................... 1-2Setting a Common Environment................................................................................................ 1-3Database Examples....................................................................................................................... 1-4

    Environment Variables for Oracle8i................................................................................................ 1-6Oracle Environment Variables on UNIX................................................................................... 1-6UNIX Environment Variables Used with Oracle8i.................................................................. 1-8Setting the System Time ............................................................................................................ 1-10

    Initialization Parameters ................................................................................................................. 1-11Customizing the initsid.ora File................................................................................................ 1-11Default Initialization Parameter Values.................................................................................. 1-12

    iii

  • Database Limits ................................................................................................................................. 1-14Managing Special Accounts and Groups ..................................................................................... 1-14Managing Security............................................................................................................................ 1-16

    Groups and Security................................................................................................................... 1-16Security for Server Manager Commands ................................................................................ 1-17Security for Database Files ........................................................................................................ 1-17Security and Remote Passwords .............................................................................................. 1-18

    Estimating Oracle8i Memory Usage.............................................................................................. 1-20Server Resource Limits .................................................................................................................... 1-21Controlling the System Global Area............................................................................................. 1-21

    Size Limits of the SGA ............................................................................................................... 1-21Calculating the Size of the SGA................................................................................................ 1-22Relocating the SGA..................................................................................................................... 1-22

    Building and Running Demonstrations ....................................................................................... 1-24SQL*Loader Demonstrations .................................................................................................... 1-24Administering SQL*Loader....................................................................................................... 1-26Loading PL/SQL Demonstrations ........................................................................................... 1-27Running PL/SQL Demonstrations........................................................................................... 1-28

    Relinking Executables ..................................................................................................................... 1-29

    2 Tuning Oracle8i

    Importance of Tuning ......................................................................................................................... 2-2DYNIX/ptx Tools ................................................................................................................................ 2-2

    sar .................................................................................................................................................... 2-2swap................................................................................................................................................ 2-3

    SQL Scripts ............................................................................................................................... ........... 2-4Tuning Memory Management ......................................................................................................... 2-4

    Allocate Sufficient Swap Space .................................................................................................. 2-4Control Paging ............................................................................................................................. 2-5Hold the SGA in a Single Shared Memory Segment .............................................................. 2-5Lock the SGA in Physical Memory ............................................................................................ 2-5Optimize Number of Database Buffers ..................................................................................... 2-6Use Indirect Database Buffers..................................................................................................... 2-7Optimize Number of Redo Buffers ............................................................................................ 2-7Optimize the Shared Pool Size.................................................................................................... 2-7

    iv

  • Verify Data Dictionary Cache Effectiveness............................................................................. 2-8Allocate Adequate Library Cache Space................................................................................... 2-8Lock Large PL/SQL Blocks into the Shared Pool .................................................................... 2-9

    Tuning Disk I/O ............................................................................................................................... 2-10Tune the Database Writer to Increase Write Bandwidth ..................................................... 2-10Use Logical Volumes.................................................................................................................. 2-12Choose the Appropriate File System Type ............................................................................ 2-12

    Monitoring Disk Performance ...................................................................................................... 2-13Disk Performance Issues ........................................................................................................... 2-14

    Tuning CPU Usage ........................................................................................................................... 2-14Keep All Oracle Users and Processes at the Same Priority .................................................. 2-14Use Processor Affinity and Binding on Multi-Processor Systems ...................................... 2-14

    Tuning Oracle Resource Contention ............................................................................................. 2-15Tuning UNIX Kernel Parameters ............................................................................................. 2-15Using V$ Tables to Isolate Contention .................................................................................... 2-15Isolating the Segment Causing Contention ............................................................................ 2-16Reducing Latch Free Contention.............................................................................................. 2-17Reducing Rollback Segment Contention................................................................................. 2-18Reducing Redo Log Buffer Latch Contention ........................................................................ 2-18Reducing Parallel Query/Parallel DML Contention ............................................................ 2-19Tuning Spin Count ..................................................................................................................... 2-20

    Tuning Block Size and File Size .................................................................................................... 2-21Specifying Oracle Block Size..................................................................................................... 2-21

    Tuning the Buffer Cache Size ........................................................................................................ 2-21Tuning Resource Contention for Oracle Parallel Server ........................................................... 2-22

    Avoid Index Contention............................................................................................................ 2-22Avoid Free List Contention....................................................................................................... 2-23Avoid Lock Contention ............................................................................................................. 2-23Localize Disk I/O ....................................................................................................................... 2-23Monitor Contention.................................................................................................................... 2-24

    Using Trace and Alert Files ............................................................................................................ 2-24Trace File Names ....................................................................................................................... 2-24Alert Files .................................................................................................................................... 2-24

    v

  • Raw Devices and Volumes .............................................................................................................. 2-25Disadvantages of Raw Devices and Volumes ....................................................................... 2-25Guidelines for Using Raw Devices and Volumes ................................................................. 2-26Raw Device Setup ....................................................................................................................... 2-27

    3 Administering SQL*Plus

    Administering SQL*Plus................................................................................................................... 3-2Setup Files ..................................................................................................................................... 3-2The Site Profile .............................................................................................................................. 3-2The User Profile............................................................................................................................. 3-2The PRODUCT_USER_PROFILE Table ................................................................................... 3-3Demonstration Tables ................................................................................................................. 3-3Help Facility ................................................................................................................................. 3-4

    Using SQL*Plus ............................................................................................................................... ... 3-5Using a System Editor from SQL*Plus ..................................................................................... 3-5Running Operating System Commands from SQL*Plus........................................................ 3-6Interrupting SQL*Plus ................................................................................................................ 3-6Using the SPOOL Command ..................................................................................................... 3-6

    Restrictions ............................................................................................................................... ........... 3-7Resizing Windows ....................................................................................................................... 3-7Return Codes ................................................................................................................................ 3-7

    4 Using Oracle Precompilers and the Oracle Call Interface

    Overview of Oracle Precompilers.................................................................................................... 4-2Relinking Precompiler Executables ........................................................................................... 4-2Precompiler Configuration Files ............................................................................................... 4-3Issues Common to All Precompilers.......................................................................................... 4-3Additional Documentation ......................................................................................................... 4-4

    Pro*C/C++ ............................................................................................................................................ 4-4Administering Pro*C/C++ ......................................................................................................... 4-4Using Pro*C/C++ ......................................................................................................................... 4-5

    Pro*COBOL .......................................................................................................................................... 4-7Administering Pro*COBOL ........................................................................................................ 4-8Environment Variables ............................................................................................................... 4-8Using Pro*COBOL........................................................................................................................ 4-9

    vi

  • Oracle Call Interface ........................................................................................................................ 4-12Demonstration Programs ......................................................................................................... 4-12User Programs ............................................................................................................................ 4-13

    Oracle Precompiler and Oracle Call Interface Linking and Makefiles ................................ 4-14Custom Makefiles ...................................................................................................................... 4-14Undefined Symbols ................................................................................................................... 4-15

    Thread Support ................................................................................................................................ 4-15Static and Dynamic Linking with Oracle Libraries .................................................................. 4-16

    Oracle Shared Library ............................................................................................................... 4-16Using Signal Handlers .................................................................................................................... 4-17

    Signals .......................................................................................................................................... 4-17XA Functionality .............................................................................................................................. 4-20

    5 Configuring Net8

    Supplementary Documentation....................................................................................................... 5-2Supplementary Information in README Files ...................................................................... 5-2

    Core Net8 Products and Features..................................................................................................... 5-2Net8 Files and Utilities................................................................................................................. 5-2Net8 Configuration Assistant ..................................................................................................... 5-4

    Net8 Protocol Support ....................................................................................................................... 5-4ADDRESS Specification............................................................................................................... 5-5

    BEQ Protocol ....................................................................................................................................... 5-6Specifying a BEQ ADDRESS ...................................................................................................... 5-6

    IPC Protocol ........................................................................................................................................ 5-7Specifying an IPC ADDRESS ..................................................................................................... 5-8

    RAW Protocol....................................................................................................................................... 5-9TCP/IP Protocol Adapter ................................................................................................................... 5-9

    Specifying a TCP/IP ADDRESS .............................................................................................. 5-10SPX/IPX Protocol .............................................................................................................................. 5-10

    The ntisbsdm Broadcast Daemon ............................................................................................ 5-11The ntspxctl Utility .................................................................................................................... 5-11SPX/IPX Protocol Command Summary ................................................................................ 5-12The getname Command ........................................................................................................... 5-13Specifying the SPX/IPX ADDRESS ........................................................................................ 5-15

    Net8 Naming Support ..................................................................................................................... 5-15

    vii

  • Configuring Oracle Intelligent Agent for Oracle SNMP .......................................................... 5-16Configure Master Agent ........................................................................................................... 5-16Configure the Encapsulator ...................................................................................................... 5-16Verify start_peer Script ............................................................................................................. 5-17Start the SNMP Components .................................................................................................... 5-17

    Oracle Advanced Security ............................................................................................................... 5-18.bak Files ...................................................................................................................................... 5-18Security and Single Sign-On ..................................................................................................... 5-18

    6 Running Oracle Data Option Demos

    Additional Documentation ............................................................................................................... 6-2Oracle8i interMedia............................................................................................................................ 6-2

    Text.................................................................................................................................................. 6-2Audio, Video, and Image............................................................................................................. 6-3Locator............................................................................................................................................ 6-7Web Agent and Clipboard........................................................................................................... 6-9

    Oracle8i Time Series Demos ............................................................................................................. 6-9Oracle8i Visual Information Retrieval ......................................................................................... 6-10Oracle8i Spatial ................................................................................................................................. 6-12

    A Optimal Flexible Architecture

    Optimal Flexible Architecture (OFA).............................................................................................. A-2Characteristics of OFA-Compliant Database............................................................................ A-2

    OFA Implemented on UNIX ............................................................................................................. A-4Mount Points ................................................................................................................................. A-5Naming Directories ...................................................................................................................... A-6Naming Files.................................................................................................................................. A-7Naming Tablespaces .................................................................................................................... A-9Exploiting OFA Structure for Oracle Files .............................................................................. A-10OFA File Mapping ...................................................................................................................... A-11Raw Device Sizes ........................................................................................................................ A-12Directory Structure ..................................................................................................................... A-14

    Index

    viii

  • Send Us Your Comments

    Oracle8i Administrator’s Reference Release 2 (8.1.6) for IBM DYNIX/ptx

    Part No. A85265-01

    Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this publication. Your input is an important part of the information used for revision.

    ■ Did you find any errors?■ Is the information clearly presented?■ Do you need more information? If so, where?■ Are the examples correct? Do you need more examples?■ What features did you like most about this manual?

    If you find any errors or have any other suggestions for improvement, please indicate the chapter, section, and page number (if available). You can send comments to us in the following ways:

    ■ Email - [email protected]■ FAX - 650-506-7304 Attn: Thomas Leah-Martin■ Postal service:

    Thomas Leah-MartinOracle Corporation 500 Oracle Parkway, Mailstop 1op5Redwood Shores, CA 94065USA

    If you would like a reply, please provide your name, address, and telephone number.

    If you have problems with the software, please contact your local Oracle Support Services Center.

    ix

  • x

  • Preface

    This reference supplements the generic server administration information found in the Oracle8i Tuning Guide. This preface contains the following sections:

    ■ Purpose

    ■ Audience

    ■ Typographic Conventions

    ■ Command Syntax

    ■ Accessing Online Documentation

    ■ Related Documentation

    ■ Oracle Services and Support

    xi

  • PurposeThis guide, with the Oracle8i Release Notes for DYNIX/ptx and the Oracle8i Installation Guide for DYNIX/ptx, describes how to install, configure, and administer Oracle8i Release 2 (8.1.6) on DYNIX/ptx. For additional product information, see the Oracle8i Generic Documentation Set.

    AudienceThis guide is intended for anyone administering and tuning Oracle8i Release 2 (8.1.6) on a DYNIX/ptx system.

    Typographic ConventionsThe following typographic conventions are used in this guide:

    Because UNIX is case-sensitive, conventions in this guide may differ from those used in other Oracle product documentation.

    monospace Monospace type indicates UNIX commands, directory names, user names, path names, file names, and text quoted from screen output.

    brackets [ ] Words enclosed in brackets indicate key names (for example, Press [Return]). Note that brackets have a different meaning when used in command syntax.

    italics Italic type indicates variables, including variable portions of file names. It is also used for emphasis.

    UPPERCASE Uppercase letters indicate Structured Query Language (SQL) reserved words, initialization parameters, and environment variables.

    xii

  • Command SyntaxAll examples that show commands or file contents appear in monospace font and assume the use of the Bourne shell. The dollar prompt ($) at the beginning of the UNIX command examples is the default UNIX command prompt. Do not enter it in the examples.

    Accessing Online DocumentationOnline documentation is stored on both the Oracle8i for IBM DYNIX/ptx CD-ROM and the Oracle8i Generic Documentation CD-ROM.

    Oracle8i for IBM DYNIX/ptx DocumentationOracle8i for IBM DYNIX/ptx documentation includes this guide, the Oracle8i Installation Guide for IBM DYNIX/ptx, and the Oracle8i Release Notes for IBM DYNIX/ptx.

    To access the documentation in HTML and PDF formats, use a UNIX browser to open the index.htm file at the top level of the Oracle8i CD-ROM. This file contains links to product and DYNIX/ptx specific documentation.

    backslash \ A backslash indicates a command that is too long to fit on a single line. Enter the line as printed (with a backslash) or enter it as a single line without a backslash:dd if=/dev/rdsk/c0t1d0s6 of=/dev/rst0 bs=10b \

    count=10000

    braces { } Braces indicate required items: .DEFINE {macro1}

    brackets [ ] Brackets indicate optional items: cvtcrt termname [outfile]

    Note that brackets have a different meaning when used in regular text.

    ellipses ... Ellipses indicate an arbitrary number of similar items:CHKVAL fieldname value1 value2 ... valueN

    italics Italic type indicates variables. Substitute a value for the variable: library_name

    vertical line | A vertical line indicates a choice within braces or brackets:SIZE filesize [K|M]

    xiii

  • Oracle Product DocumentationOracle8i product documentation is on the Oracle8i Generic Documentation CD-ROM. Instructions for accessing and installing the documents on the CD-ROM are found in the README file on the top level directory of the CD-ROM.

    Related DocumentationIf you are unfamiliar with the concepts or terminology associated with relational database management systems, read Chapter 1 in Oracle8i Concepts before beginning your installation.

    For information about administering and tuning a production database system, see the following documents:

    ■ Oracle8i Release Notes for IBM DYNIX/ptx part no. A85267-01

    ■ Oracle8i Installation Guide for IBM DYNIX/ptx part no. A85266-01

    ■ Net8 Administrator’s Guide

    ■ Oracle8i Designing and Tuning for Performance

    ■ Information about migrating or upgrading from a previous release of the Oracle Server is provided in Oracle8i Migration.

    Oracle Services and SupportA wide range of information about Oracle products and global services is available on the Internet, from:

    http://www.oracle.com

    The following sections provide URLs for selected Oracle services.

    Oracle Support ServicesContact information for Technical Support in all countries is listed at:

    http://www.oracle.com/support

    This site provides templates to help you prepare information about your problem before you call. You also need your CSI number (if applicable) or complete contact details, including any special project information relating to the problem.

    xiv

    http://www.oracle.comhttp://www.oracle.com/support

  • Products and DocumentationCustomers in the U.S. can contact the Oracle Store at:

    http://oraclestore.oracle.com

    Links to stores in other countries are provided from this site.

    You can find product documentation at:

    http://technet.oracle.com

    Customer ServiceGlobal Customer Service contacts are listed at:

    http://www.oracle.com/support/

    Education and TrainingTraining information and worldwide schedules are available at:

    http://education.oracle.com

    Oracle Technology NetworkRegister with the Oracle Technology Network (OTN) at:

    http://technet.oracle.com

    OTN delivers technical papers, code samples, product documentation, self-service developer support, and Oracle key developer products to enable rapid development and deployment of applications built on Oracle technology.

    xv

    http://oraclestore.oracle.comhttp://www.oracle.com/support/http://education.oracle.comhttp://technet.oracle.comhttp://technet.oracle.com

  • xvi

  • Administering Or

    1

    Administering Oracle8i

    The information in this chapter describes tasks specific to administering Oracle8i on DYNIX/ptx. It contains the following sections:

    ■ Setting the Environment

    ■ Environment Variables for Oracle8i

    ■ Initialization Parameters

    ■ Database Limits

    ■ Managing Special Accounts and Groups

    ■ Managing Security

    ■ Estimating Oracle8i Memory Usage

    ■ Server Resource Limits

    ■ Controlling the System Global Area

    ■ Building and Running Demonstrations

    ■ Relinking Executables

    acle8i 1-1

  • Setting the Environment

    Setting the EnvironmentThis section describes how to establish a common environment for your Oracle8i system.

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

    $ env | grep ORACLE_SID

    Setting and Exporting the Value of a Variable in a Current SessionThe following examples show how to set and export variable values in the current session.

    For the Bourne or Korn shell, enter:

    $ ORACLE_SID=test$ export ORACLE_SID

    For the C shell, enter:

    % setenv ORACLE_SID test

    In both examples, test is the value of the ORACLE_SID variable.

    Note: The env command shows the values of the environment variables that have been exported. You can set environment variables in the Bourne shell and Korn shell without exporting them.

    1-2 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Setting the Environment

    Setting a Common EnvironmentOracle8i enables 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 (coraenv for the C shell) command file is created during installation. It contains values for Oracle environment variables and provides:

    ■ A central means of updating all user accounts with database changes

    ■ A mechanism for switching back and forth between Oracle8i databases

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

    Local bin Directory Place oraenv (or coraenv) and dbhome scripts in a local bin directory, separate from the Oracle software home directory, to ensure that these files are accessible to all users. This also ensures that the oraenv (or coraenv) script continues to work even if you change the ORACLE_HOME environment variable path to point to a different $ORACLE_HOME directory. The local bin directory is specified by the root.sh script, which you run after the installation. The default location for the local bin directory on DYNIX/ptx is /usr/local/bin.

    Switching Between DatabasesTo switch from one database or database instance to another, call the oraenv routine. Reply to the prompt with the value of the ORACLE_SID environment variable of the database to which you are switching. Always provide the full path of the oraenv (or coraenv) command file. For example:

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

    Administering Oracle8i 1-3

  • Setting the Environment

    Database ExamplesIn the following examples, it is assumed that your local bin directory is /usr/local/bin and that your production database is named PROD.

    If you prefer not to be prompted for the value of the ORACLE_SID environment variable at startup, set the ORAENV_ASK environment variable to no. ORAENV_ASK is reset to the default, yes, after oraenv is executed. This ensures that the system prompts you for a different ORACLE_SID value the next time that it executes the oraenv file.

    If you have created a database manually instead of using Oracle Database Configuration Assistant, you must ensure that the system configuration is reflected in the /etc/oratab file. Add an entry for each server instance in the following format:

    ORACLE_SID:ORACLE_HOME:{Y|N}

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

    Single Instance ExampleFor the Bourne or Korn shell, add or replace the following line in the .profile file:

    . local_bin_directory/oraenv

    with the following lines:

    PATH=${PATH}:/usr/local/binORACLE_SID=PRODexport PATH ORACLE_SIDORAENV_ASK=NOexport ORAENV_ASK. oraenvORAENV_ASK=unset ORAENV_ASK

    1-4 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Setting the Environment

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

    source local_bin_directory/coraenv

    with the following lines:

    setenv PATH ${PATH}:/usr/local/binsetenv ORACLE_SID PRODsetenv ORAENV_ASK NOsource /usr/local/bin/coraenvunset ORAENV_ASK

    Multiple Instances ExampleFor multiple database instances, define the sid at startup.

    For the Bourne or Korn shell:

    #!/usr/bin/sh echo "The SIDs on this system are:" cat /etc/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 system are:" cat /ect/oratab | awk -F: ’{print $1}’ | grep -v "#" set ORAENV_ASK="YES" source /usr/local/bin/coraenv

    Administering Oracle8i 1-5

  • Environment Variables for Oracle8i

    Environment Variables for Oracle8iThis section describes the most commonly-used Oracle8i and UNIX environment variables.

    Oracle Environment Variables on UNIXYou must define some of these variables before you install Oracle8i. These are listed in the Oracle8i Installation Guide for DYNIX/ptx.

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

    Table 1–1 Oracle8i Environment Variables on UNIX

    Variable Detail Definition

    NLS_LANG Function Specifies the language and character set used for output. See the Oracle8i Installation Guide for IBM DYNIX/ptx for a list of values.

    Syntax language_territory.characterset

    Example french_france.we8dec

    ORA_NLS33 Function Points to the directory where languages and character sets are stored.

    Set to $ORACLE_HOME/ocommon/nls/admin/data

    ORACLE_BASE Function Specifies the base of the Oracle directory structure for 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/app/oracle/product/8.1.6

    ORACLE_PATH Function Specifies the search pathname for files used by Oracle applications, such as SQL*Plus. If not specified, the application reads from and writes to the current directory.

    Syntax colon-separated list of directories directory:directory:directory

    Example /u01/oracle/adhoc/816/bin:.

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

    1-6 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Environment Variables for Oracle8i

    ORACLE_SID Function Specifies the Oracle System Identifier.

    Syntax The string of numbers and characters that must begin with a letter. A maximum of four characters is recommended. For more information, see the Oracle8i Installation Guide for IBM DYNIX/ptx.

    Example SAL1

    ORACLE_TRACE Function Turns on tracing of Bourne shell scripts during install. If set to T, many Oracle shell scripts run with set -x flag on.

    Range of Values T or anything else.

    ORAENV_ASK Function Controls whether (c)oraenv prompts for ORACLE_SID or ORACLE_HOME. If set to NO (c)oraenv does not prompt and, if set to anything else, it does.

    Syntax string

    Range of Values NO or anything else.

    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 for IBM DYNIX/ptx.

    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 names identical to names of Oracle Server processes, for example: arch, pmon, and dbwr.

    Table 1–1 Oracle8i Environment Variables on UNIX (Cont.)

    Variable Detail Definition

    Administering Oracle8i 1-7

  • Environment Variables for Oracle8i

    Abbreviations for ORACLE_HOME and ORACLE_SIDIn Oracle8i files and programs, a question mark (?) represents the value of the ORACLE_HOME environment variable. For example, Oracle8i expands the question mark in the following SQL statement to the full path name of the ORACLE_HOME environment variable:

    ALTER TABLESPACE TEMP ADD DATAFILE ’?/dbs/dbs2.dbf’ SIZE 2M

    The @ sign represents the value of the ORACLE_SID environment variable. For example, to indicate a file belonging to the current instance, enter:

    ALTER TABLESPACE TABLESPACE_NAME ADD DATAFILE ’[email protected]

    UNIX Environment Variables Used with Oracle8iTable 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 for various Java applications. Refer to 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, $ORACLE_HOME/product/jlib.

    Note: JRE_Location is defined as $ORACLE_HOME/JRE

    DISPLAY Function Specifies the display device used by X-based tools for input and output. See vendor’s X Windows documentation for details.

    Syntax hostname:displayThe hostname is your computer 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:0bambi:0

    HOME Function Specifies the user’s home directory.

    1-8 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Environment Variables for Oracle8i

    Syntax directory_path

    Example home/jsmith

    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 DYNIX/ptx.

    LPDEST Function Specifies the user’s default printer for DYNIX/ptx systems.

    Syntax printer_name

    Example docqms

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

    LD_LIBRARY_PATH Function Used by the shared library loader (ld.so.1) at run time to find shared object libraries. See man pages on ld.so.1 for details.

    Syntax Colon-separated list of directories directory:directory:directory

    Example /usr/dt/lib: $ORACLE_HOME/lib:$ORACLE_HOME/javavm/admin

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

    Syntax Colon-separated list of directories directory:directory:directory

    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 for DYNIX/ptx systems.

    Syntax printer_name

    Example docqms

    SHELL Function Specifies the command interpreter used during a host command.

    Syntax Shell pathname.

    Range of Values /sbin/sh or /sbin/csh or /sbin/ksh or any other command interpreter supplied with DYNIX/ptx.

    Example /sbin/sh

    Table 1–2 UNIX Environment Variables Used with Oracle8i (Cont.)

    Variable Detail Definition

    Administering Oracle8i 1-9

  • Environment Variables for Oracle8i

    Setting the System TimeThe TZ variable sets your time zone. It enables 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.

    TMPDIR Function Specifies the default directory for temporary disk files; if set, tools that create 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.

    Caution: Oracle Corporation recommends that you do not change your personal TZ value. Using different values of TZ such as GMT+24 might change the day that a transaction is recorded. This affects Oracle applications that use SYSDATE, such as Oracle Financials. Use sequence numbers to order a table instead of date columns to avoid this problem.

    Table 1–2 UNIX Environment Variables Used with Oracle8i (Cont.)

    Variable Detail Definition

    1-10 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Initialization Parameters

    Initialization ParametersInitialization parameters enable you to configure and tune your Oracle8i instance. This section describes:

    ■ Customizing initialization parameters in the initsid.ora file for the Oracle8i instance

    ■ Pre-set default initialization parameters

    Optional initialization parameters are described in the Oracle8i Administrator’s Guide and Oracle8i Tuning.

    For information on Asynchronous I/O and I/O Slaves, see Chapter 2, "Tuning Oracle8i".

    Customizing the initsid.ora FileThis section describes the default initsid.ora file provided with the Oracle8i software. The Oracle Universal Installer creates it in the $ORACLE_BASE/admin/sid/pfile directory. You can modify it to customize your Oracle8i installation.

    Sample initsid.ora FileFor a sample initsid.ora file, look in the $ORACLE_HOME/dbs directory. This file is provided by Oracle Corporation to assist in customizing your Oracle8i installation.

    Administering Oracle8i 1-11

  • Initialization Parameters

    Default Initialization Parameter ValuesTable 1–3 lists default initialization parameter values on DYNIX/ptx. 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.

    To display the current values of these parameters on the system, use SQL*Plus to execute the statement SHOW PARAMETERS.

    See Also: For more information, see the Oracle8i Server Reference.

    Table 1–3 Initialization Parameters

    Parameter Default Value Value Range

    BACKGROUND_DUMP_DEST ?/rdbms/log Valid directory names

    BITMAP_MERGE_AREA_SIZE 1048576 65536 to unlimited

    COMMIT_POINT_STRENGTH 1 0 to 255

    CONTROL_FILES ?/dbs/cntrloracle_sid.dbf Valid file names

    CREATE_BITMAP_AREA_SIZE 8388608 65536 to unlimited

    DB_BLOCK_BUFFERS 48 MB of buffers 48 MB to unlimited

    DB_BLOCK_SIZE 4096 2 KB to 16 KB

    DB_FILES 200 1 to 2000000

    DB_FILE_DIRECT_IO_COUNT 64 (maximum of 1048576) 0 to 1048576/block size

    DB_FILE_MULTIBLOCK_READ_COUNT

    8 1 to min(DB_BLOCK_BUFFERS/4, 1048576/DB_BLOCK_SIZE)

    DISTRIBUTED_TRANSACTIONS 1/4 Transactions 0 to unlimited

    HASH_AREA_SIZE 2*SORT_AREA_SIZE 0 to unlimited

    HASH_MULTIBLOCK_IO_COUNT

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

    JAVA_POOL_SIZE 20000000 1000000 to 1000000000

    LOG_ARCHIVE_BUFFERS 4 0 to 128

    LOG_ARCHIVE_DEST null Valid directory names

    LOG_ARCHIVE_FORMAT "%t_%s.dbf" Valid file names

    LOG_BUFFER max (512 KB, 128 KB*CPU_COUNT) 66560 - unlimited

    1-12 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Initialization Parameters

    LOG_CHECKPOINT_INTERVAL 0 0 - unlimited

    MTS_MAX_DISPATCHERS 5 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 Hostname or IP 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 100 KB 10 KB - unlimited

    OPEN_CURSORS 50 1 - unlimited

    OS_AUTHENT_PREFIX ops$ Arbitrary string

    PROCESSES 30, if not PARALLEL_AUTOMATIC_TUNING

    6 - unlimited

    SHARED_POOL_SIZE 64 MB on 64-bit, 8 MB on 32-bit 300000 - unlimited

    SORT_AREA_SIZE 65536 0 - unlimited

    USER_DUMP_DEST $ORACLE_BASE/admin/sid/udump

    Valid directory name

    Table 1–3 Initialization Parameters (Cont.)

    Parameter Default Value Value Range

    Administering Oracle8i 1-13

  • Database Limits

    Database LimitsTable 1–4 lists the maximum and default values for parameters in a CREATE DATABASE or CREATE CONTROLFILE statement.

    For information on Oracle-specific file size limits, see Chapter 1 of Oracle8i Installation Guide for DYNIX/ptx.

    Managing Special Accounts and GroupsThe DBA should be familiar with the special accounts required by the Oracle server and should make sure these accounts belong to the appropriate groups.

    ■ Table 1–5 describes UNIX accounts.

    ■ Table 1–6 describes Oracle server accounts.

    ■ Table 1–7 describes special UNIX groups.

    Note: Interdependencies between these parameters can affect allowable values.

    Table 1–4 Determining the Size of Control Files

    Parameter Default Value Maximum Value

    MAXDATAFILES 30 65534

    MAXINSTANCES 1 63

    MAXLOGFILES 16 255

    MAXLOGMEMBERS 2 5

    MAXLOGHISTORY 100 65534

    1-14 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Managing Special Accounts and Groups

    Table 1–5 UNIX Accounts

    Account Name Description

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

    root The root user is a special UNIX account with maximum privileges (called superuser privileges). Use the root account to configure the UNIX kernel, configure and install networking software, and create user accounts and groups. Only the root user should be a member of the root group.

    Table 1–6 Oracle Server Accounts

    Account Name Description

    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 account is also a standard Oracle8i account, with DBA privileges automatically created during installation. Additional tables or views can be created by the SYSTEM user. DBAs can log in as SYSTEM to monitor or maintain databases.

    Table 1–7 Special UNIX Group Accounts

    Account Name Description

    dba 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.

    Administering Oracle8i 1-15

  • Managing Security

    Managing SecurityOracle8i 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 on the oracle program.

    Groups and SecurityTo ensure greater security for an Oracle8i database, create user groups at the operating system level. Groups are controlled by the UNIX /etc/group file. 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:

    ■ Before installing Oracle8i, create a database administrators’ UNIX group that has special database privileges. You can name the group anything, but this guide refers to it as the dba group. The oracle account must have the dba group as a secondary group. The primary group for the oracle account should be the oinstall group.

    ■ Create a group named oinstall. This is the group that owns the Oracle Universal Installer oraInventory. It is responsible for installing and

    oinstall All users installing Oracle8i in any $ORACLE_HOME directory must belong to the same UNIX group. All Oracle8i $ORACLE_HOME directories on one computer share the same Oracle Universal Installer oraInventory directory. Members of the installation group can write to the oraInventory directory. Oracle recommends installing with oinstall as the primary group.

    oper Members of this optional UNIX group have database OPERATOR privileges, which are a restricted set of DBA privileges.

    See Also: For more information on security issues, see the Oracle8i Administrator’s Reference.

    Table 1–7 Special UNIX Group Accounts (Cont.)

    Account Name Description

    1-16 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Managing Security

    upgrading the Oracle8i system. You can name the group anything, but this guide refers to it as the oinstall group. All oracle accounts must have the oinstall group as their primary group.

    ■ Although any user account which requires DBA privileges can belong to the dba group, the only user account which should belong to the oinstall group is the oracle account.

    Security for Server Manager CommandsIf you do not install SQL*Plus, you can use Server Manager to make SQL queries. However, be careful how you assign access to Server Manager. Only the oracle user and the dba group users have access to the following system-privileged statements, as they grant special operating system privileges:

    ■ STARTUP

    ■ SHUTDOWN

    ■ CONNECT INTERNAL

    Security for Database FilesThe user ID used to install Oracle8i should own the database files. The default user ID is the oracle software owner. Set the authorizations on the database files to 0600 which permits read/write (rw) by owner only, with no write authorizations 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.

    Note: Even though both the oracle user and root user should belong to the dba group, Oracle Corporation recommends that the oracle user is not a member of the root group. The root user should be the only member of the root group.

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

    Administering Oracle8i 1-17

  • Managing Security

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

    -rwsr-s--x

    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 the permissions on the oracle executable manually, enter:

    $ chmod 6751 $ORACLE_HOME/bin/oracle

    Security and Remote PasswordsYou can administer a database from a remote computer without operating system accounts, such as a personal computer. User validation is accomplished 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 located in the $ORACLE_HOME/dbs directory and contain the user name and password information for a single database. If there are multiple $ORACLE_HOME directories on a system, each has a separate password file. To enable the database to use the password file, set the initsid.ora parameter REMOTE_LOGIN_PASSWORDFILE to EXCLUSIVE.

    Running orapwdThe orapwd utility exists in $ORACLE_HOME/bin and is run by the oracle software owner. Start orapwd by entering:

    $ orapwd file=filename password=password entries=max_users

    This syntax is described as follows:

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

    password is the initial password you selected for INTERNAL and SYS. You can change this password after you create the database using an ALTER USER statement. This parameter is mandatory.

    1-18 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Managing Security

    orapwd Example$ orapwd file=/u01/app/oracle/product/8.1.6/dbs/orapwV816password=V816pw entries=30

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

    SQL> CONNECT INTERNAL/DBA_PASSWORD@ALIAS AS {SYSDBA|SYSOPER}

    Remote AuthenticationTable 1–8 shows the initsid.ora parameters that control the behavior of remote connections through non-secure protocols.

    max_users is the maximum number of users able 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.

    Table 1–8 Parameters for Controlling Remote Connections

    Parameter Description

    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

    Administering Oracle8i 1-19

  • Estimating Oracle8i Memory Usage

    Estimating Oracle8i Memory UsageYou need to know the Oracle8i memory usage requirements before starting the Installer. Knowing these requirements helps you determine the number of users you can have on your system, and helps you determine your physical memory and swap space requirement. To calculate the memory requirements, use the following formula:

    size of the oracle executable text+ size of the SGA+ number of background processes * (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)

    To determine the SGA size, see "Calculating the Size of the SGA" on page 1-22.

    For each Oracle 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 the 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. Program text is counted only once, no matter how many times the program is run because all oracle executable text is always shared.

    To calculate actual Oracle physical memory usage while the database is running and users are connecting to it, use the ps -elfF command. For each entry, total the RSS columns.

    The RSS column displays the real memory (resident set) size of the process.

    Finally, 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 run.

    See Also: See your operating system man pages or documentation for a list of available switches for the ps command.

    1-20 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Controlling the System Global Area

    Server Resource LimitsDYNIX/ptx 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 DYNIX/ptx 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 DYNIX/ptx system manager.

    Disk quotas established for the oracle user ID can hinder the operation of the Oracle8i system. Confer with your Oracle8i database administrator and the DYNIX/ptx system manager before establishing disk quotas.

    Controlling the System Global AreaThe System Global Area (SGA) is the Oracle structure that is stored 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.

    Size Limits of the SGAThe maximum size of a single shared memory segment is specified by the SHMMAX parameter. Oracle8i uses shared memory segments for the SGA.

    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: Using Intimate Shared Memory (ISM) can cause problems when SHMMAX is smaller than the database SGA size.

    Administering Oracle8i 1-21

  • Controlling the System Global Area

    Set the following initialization parameters to control the size of the SGA:

    ■ DB_BLOCK_BUFFERS

    ■ DB_BLOCK_SIZE

    ■ LARGE_POOL_SIZE

    ■ SORT_AREA_SIZE

    ■ SHARED_POOL_SIZE

    ■ JAVA_POOL_SIZE

    Be careful when setting values for these parameters. When values are set too high, performance is adversely affected because too much of the computer’s physical memory is devoted to shared memory.

    Calculating the Size of the SGAYou can determine the SGA size in one of the following ways:

    ■ You can calculate the approximate size of an instance’s SGA using the following formula:

    (DB_BLOCK_BUFFERS * DB_BLOCK_SIZE) + SORT_AREA_SIZE + SHARED_POOL_SIZE + LOG_BUFFER + LARGE_POOL_SIZE + JAVA_POOL_SIZE

    ■ To display the size of the SGA for a running database, in bytes, use the SQL*Plus SHOW SGA command.

    ■ You can also find the size of the SGA when you start the database system. The SGA size is displayed next to the heading Total System Global Area.

    Relocating the SGAThe address at which the SGA is attached affects the amount of virtual address space available for such things as database buffers in the SGA and cursors in the user’s application data area. To relocate the SGA, perform the following steps:

    1. To determine the valid virtual address range for attaching shared memory segments, use the tstshm executable included in this release of Oracle8i.

    1-22 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Controlling the System Global Area

    2. Enter the tstshm executable at the command prompt:

    $ tstshm

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

    3. Check the "Segment boundaries" output of the tstshm command to determine the valid virtual address boundaries at which a shared memory segment can be attached.

    4. Move to the $ORACLE_HOME/rdbms/lib directory and make a backup copy of the libserver8.a file:

    $ cd $ORACLE_HOME/lib$ cp libserve8.a libserver8.a orig

    5. Move to the $ORACLE_HOME/rdbms/lib directory, and run the genksms command to generate the ksms.s file:

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

    In this example, 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 7Mb for data segments. This amount must allow enough memory for such things as SORT_AREA_SIZE.

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

    You may 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 this is the case, then you probably lowered the start address into an area which the PGA needs to extend into. Raise sgabeg, and try again.

    Shut down the existing Oracle instance.

    Administering Oracle8i 1-23

  • Building and Running Demonstrations

    6. Create the ksms.o file and archive it into the libserver8.a file.

    $ cd $ORACLE_HOME/rdbms/lib$ make -f ins_rdbms.mk ksms.o$ ar r $ORACLE_HOME/lib/libserver8.a ksms.o

    7. Rebuild the oracle executable in the $ORACLE_HOME/rdbms/lib directory:

    $ make -f ins_rdbms.mk ioracle

    Using the ioracle command:

    ■ 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.

    Building and Running DemonstrationsThis section describes how to build and run the SQL*Loader and PL/SQL demonstration programs installed with Oracle8i.

    SQL*Loader DemonstrationsSQL*Loader demonstrations require that:

    ■ The user SCOTT/TIGER has CONNECT and RESOURCE privileges

    ■ The EMP and DEPT tables exist and are empty

    To create and run a demonstration:

    1. Run the ulcasen.sql script corresponding to the demonstration that you want to run. As SCOTT/TIGER, start SQL*Plus from the command line:

    $ sqlplus SCOTT/TIGER @ulcasen.sql

    This step creates the objects used by this demonstration.

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

    1-24 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Building and Running Demonstrations

    2. As SCOTT/TIGER, start the demonstration from the command line:

    $ sqlldr SCOTT/TIGER ulcasen.ctl

    This step loads the demonstration data into the objects created in step 1, but does not run the demonstration.

    3. As SCOTT/TIGER, run the SQL*Loader demonstrations in the following order:

    ■ ulcase1: Follow steps 1 - 2.

    ■ ulcase2: Follow step 2 to start the demonstration (you do not have to run the ulcase2.sql script).

    ■ ulcase3: Follow steps 1 - 2.

    ■ ulcase4: Follow steps 1 - 2.

    ■ ulcase5: Follow steps 1 - 2.

    ■ ulcase6: Run the ulcase6.sql script as SCOTT/TIGER, then enter the following at the command line:

    $ sqlldr SCOTT/TIGER ulcase6 DIRECT=true

    ■ ulcase7: Run the ulcase7s.sql script as SCOTT/TIGER, then enter the following at the command line:

    $ sqlldr SCOTT/TIGER ulcase7

    4. After running the example, run the ulcase7e.sql file to drop the insert trigger and global variable package.

    Administering Oracle8i 1-25

  • Building and Running Demonstrations

    Administering SQL*LoaderThis section describes SQL*Loader file processing options and newline characters in fixed length records.

    File Processing OptionThe SQL*Loader release 1.1 control file includes the following additional file processing option strings:

    ["STR" | "FIX n" | "VAR n" ]

    where:

    If you do not select a file processing option, 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.

    Newline Characters in Fixed Length RecordsWhen using the FIX option to read a file containing fixed-length records, where each record is terminated by a newline character, include the length of the newline character (one character) when specifying the record length to SQL*Loader.

    For example, to read the following file specify FIX 4 instead of FIX 3 to account for the additional newline character:

    AAA newlineBBB newlineCCC newline

    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 character, terminate all records with a newline character.

    STR (default) Specifies a string of records where each record is terminated by a newline character

    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 by the first five characters of the record

    1-26 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Building and Running Demonstrations

    Removing Newline CharactersUse the POSITION(x:y)function in the control file to discard the newline characters from fixed length records rather than loading them. To do this, enter the following in your control file:

    LOAD DATAINFILE 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.

    Loading PL/SQL DemonstrationsPL/SQL includes a number of sample programs that you can load. Demonstration and message files are in the demo directory. To load PL/SQL demonstrations, perform the following steps with the Oracle8i database open and mounted:

    1. Run SQL*Plus and connect with the user/password SCOTT/TIGER:

    $ cd $ORACLE_HOME/plsql/demo$ sqlplus SCOTT/TIGER

    2. To load the demonstrations, run exampbld.sql from SQL*Plus:

    SQL > @exampbld

    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.

    Note: Use any Oracle account with sufficient permissions to build the demonstrations. Run the demonstrations under the same account you used to build them.

    Administering Oracle8i 1-27

  • Building and Running Demonstrations

    Running PL/SQL DemonstrationsThe following PL/SQL demonstrations are available:

    The precompiler demonstrations are as follows:

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

    $ sqlplus SCOTT/TIGERSQL > @examp1

    To build the precompiler PL/SQL demonstrations, enter:

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

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

    $ make -f demo_plsql.mk examp9

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

    $ ./examp9

    To run the extproc demonstration:

    1. Add the following line to the tnsnames.ora file:

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

    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

    examp9.pc examp10.pc sample5.pc sample6.pc

    1-28 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Relinking Executables

    2. Add the following line to the listener.ora file:

    SC=(SID_NAME=extproc)(ORACLE_HOME=your_oracle_home)(PROGRAM=extproc))

    3. From the SQL*Plus session, enter:

    SQL> CONNECT SYSTEM/MANAGERConnected.SQL> GRANT CREATE LIBRARY TO SCOTT;Grant succeeded.SQL> CONNECT SCOTT/TIGERConnected.SQL> CREATE LIBRARY DEMOLIB AS’$ORACLE_HOME/plsql/demo/extproc.so’;Library created.

    4. Finally, to run the demonstrations:

    SQL> CONNECT SCOTT/TIGERConnected.SQL> @extproc

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

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

    Administering Oracle8i 1-29

  • Relinking Executables

    To relink, enter the following, where parameter is one of the parameters in Table 1–9:

    $ relink parameter

    Table 1–9 Relink Script Parameters

    Parameter Value

    all Everything that has been 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 all databases, Oracle Intelligent Agent, Oracle WebDB Listener, and other Oracle programs under this ORACLE_HOME when relinking executables.

    1-30 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Tuning Or

    2

    Tuning Oracle8i

    The more your Oracle8i applications increase in complexity, the more you need to tune the system to optimize performance and prevent data bottlenecks. This chapter describes how to configure your Oracle8i installation to optimize its performance. It contains the following sections:

    ■ Importance of Tuning

    ■ DYNIX/ptx Tools

    ■ SQL Scripts

    ■ Tuning Memory Management

    ■ Tuning Disk I/O

    ■ Monitoring Disk Performance

    ■ Tuning CPU Usage

    ■ Tuning Oracle Resource Contention

    ■ Tuning Block Size and File Size

    ■ Tuning the Buffer Cache Size

    ■ Tuning Resource Contention for Oracle Parallel Server

    ■ Using Trace and Alert Files

    ■ Raw Devices and Volumes

    acle8i 2-1

  • Importance of Tuning

    Importance of TuningOracle8i is a highly optimizable software product. Frequent tuning optimizes system performance and prevents data bottlenecks. Although this chapter is written from the perspective of single-processor systems, most of the performance tuning tips provided here are also valid when using the parallel options and features available with Oracle8i.

    Before tuning the system, observe its normal behavior using the tools described in in the next section..

    DYNIX/ptx Tools DYNIX/ptx provides performance monitoring tools that you can use to assess database performance and determine database requirements. In addition to providing statistics for Oracle processes, these tools provide statistics for CPU usage, interrupts, swapping, paging, and context switching for the entire system.

    sarUse the sar command to monitor swapping, paging, disk, and CPU activity, depending on the switches that you supply with the command. The following statement displays a summary of paging activity ten times, at 10 second intervals:

    $ sar -p 10 10

    See Also: For more information on parallel options, see Oracle8i Parallel Server Concepts and Administration and Oracle8i Designing and Tuning for Performance.

    See Also: For more information on tuning, see Oracle8i Tuning. DYNIX/ptx tools are described in the operating system documentation.

    2-2 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • DYNIX/ptx Tools

    The following example shows output from the sar -p command:

    00:00:01 vflt/s pflt/s pgfil/s rclm/s 01:00:00 28.91 0.00 0.00 0.00 02:00:00 25.84 0.00 0.00 0.00 03:00:00 26.89 0.00 0.00 0.00 04:00:00 26.71 0.00 0.00 0.00 05:00:00 25.52 0.00 0.01 0.00 06:00:01 25.40 0.00 0.00 0.00 07:00:01 27.31 0.00 0.00 0.00 08:00:00 26.02 0.00 0.00 0.00 08:20:00 35.65 0.00 0.00 0.00 08:40:00 22.26 0.00 0.00 0.00 09:00:01 22.51 0.00 0.00 0.00 09:20:00 34.92 0.00 0.00 0.00 09:40:00 21.67 0.00 0.00 0.00 10:00:01 28.86 0.00 0.07 0.00 10:20:00 38.95 0.00 0.00 0.00 10:40:00 23.24 0.00 0.00 0.00 11:00:01 29.21 0.00 0.00 0.00 11:20:00 41.64 0.00 0.01 0.00 11:40:00 41.94 0.00 0.00 0.00 12:00:00 1968.86 0.00 0.06 0.00 12:20:00 49.47 0.00 1.87 0.00

    Average 80.99 0.00 0.06 0.00

    swapThe swap -l command reports information about swap space usage. A shortage of swap space can cause slow response times or even cause the system to stop responding.

    The following example shows output from the swap -l command.

    path dev swaplo blocks /dev/vx/dsk/SWAPVOL 121,1 0 530688

    Tuning Oracle8i 2-3

  • SQL Scripts

    SQL Scripts Oracle8i includes a set of packages for database tuning called STATPACKS. For more information on STATPACKS, see Oracle8i Designing and Tuning Performance.

    The utlbstat.sql and utlestat.sql scripts are used to monitor Oracle database performance and tune the System Global Area (SGA) data structures. For information regarding these scripts, see Oracle8i Designing and Tuning for Performance. On DYNIX/ptx, the scripts are located in the following directory:

    $ORACLE_HOME/rdbms/admin

    Tuning Memory Management Start the memory tuning process by measuring paging and swapping space to determine how much memory is available.

    The Oracle buffer manager ensures that the more frequently accessed data is cached for longer periods. Monitoring the buffer manager and tuning the buffer cache can have a significant influence on Oracle performance. The optimal Oracle buffer size for your system depends on the overall system load and the relative priority of Oracle over other applications.

    Allocate Sufficient Swap Space Try to minimize swapping because it causes significant UNIX overhead. Use the sar -w command to check for swapping.

    If your system is swapping and you must conserve memory:

    ■ Avoid running unnecessary system daemon processes or application processes

    ■ Decrease the number of database buffers to free some memory

    ■ Decrease the number of UNIX file buffers, especially if you are using raw devices

    Use swap -l to determine how much swap space is in use. Start with a swap space two to four times the size of your system’s random access memory (RAM). Use a higher value if you plan to use Oracle Developer or Oracle Applications. Monitor the use of swap space and increase it as necessary.

    2-4 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Tuning Memory Management

    Control Paging Paging might not present as serious a problem as swapping because an entire program does not have to be stored in memory to run. A small number of page-outs might not noticeably affect the performance of your system.

    To detect excessive paging, run measurements during periods of fast response or idle time to compare against measurements from periods of slow response.

    Use vmstat or sar -p to monitor paging. The following columns from sar -p output are important:

    If your system consistently has excessive page-out activity, consider the following solutions:

    ■ Install more memory

    ■ Move some of the work to another system

    ■ Configure your kernel to use less memory

    Hold the SGA in a Single Shared Memory Segment You cannot start the database without sufficient shared memory. Reconfigure the UNIX kernel to increase shared memory. For more information, see Controlling the System Global Area in Chapter 1.

    Lock the SGA in Physical MemoryYou can now lock the SGA into physical memory. The potential performance benefit of locking the SGA in physical memory is up to 20 percent. Locking the SGA improves performance in two ways:

    ■ Hard-locking removes the overhead of paging PGA buffers in and out of memory.

    vflt/s indicates the number of address translation page faults. Address translation faults occur when a process references a valid page that is not in memory.

    rclm/s indicates the number of valid pages that have been reclaimed and added to the free list by page-out activity. This value should be zero.

    See Also: For more information on shared memory, see Chapter 2 of the Oracle8i Installation Guide for IBM DYNIX/ptx.

    Tuning Oracle8i 2-5

  • Tuning Memory Management

    ■ Each process no longer needs its own page tablespace for the SGA. This is significant because thousands of users attaching to a large SGA previously required page space on the order of a gigabyte.

    A disadvantage of hard-locking the SGA is that the locked SGA memory cannot be used by any other processes, even in an emergency. However, the overall memory use reduction and performance benefits outweigh this disadvantage. Carefully consider the size of the SGA, total machine resources, and anticipated usage to determine whether it is safe to lock the SGA into memory. The default is to lock SGA if the operating system is configured to allow it.

    To configure the operating system to use this feature:

    ■ Recompile the DYNIX/ptx kernel with the special tuning parameters which can be set by using the DYNIX/ptx configuration utility, menu.

    ■ Set SHM_LOCK_OK = 1 to enable hard-locking.

    ■ Set SHM_LOCK_UID = -1 to allow all users to use the hard-lock feature, or set SHM_LOCK_UID to the oracle software owner user ID to restrict the usage.

    Optimize Number of Database BuffersThe DB_BLOCK_SIZE parameter also determines the size of the database buffers in the SGA. The DB_BLOCK_BUFFERS parameter is the memory parameter with the most direct effect on system performance. By altering this parameter value, you can increase performance up to 200 percent.

    The hit ratio for the buffer cache is defined as:

    Hit Ratio = Logical Reads - Physical Reads Logical Reads

    where Logical Reads = db block gets + consistent gets

    If your hit ratio is less than 60 or 70 percent, increase the number of buffers in the cache by raising DB_BLOCK_BUFFERS.

    See Also: For information on using the X$KCBRBH table as an alternate method for estimating the number of buffers based on statistics gathered from a running system, see the Oracle8 Server Tuning guide.

    2-6 Oracle8i Administrator’s Reference for IBM DYNIX/ptx

  • Tuning Memory Management

    Use Indirect Database Buffers

    The maximum SGA size supported by DYNIX/ptx is 3 GB if you use direct database buffers, but you can increase this size to take advantage of large memory systems by using in


Recommended