Oracle7 Reference Addendum for HP 9000 Series 700/800 Release

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Oracle7 Reference Addendum

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . for HP 9000 Series 700/800

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Release 7.3

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Oracle7

t

Reference

Addendum for HP 9000

Series 700/800

Release 7.3

May 1997

Part No. A53259–01

The Universal Server

R

Enabling the Information Age

T

Oracle7 Reference Addendum for HP 9000 Series 700/800, Release 7.3

Part No. A53259–01

Copyright E Oracle Corporation 1997

All rights reserved. Printed in the U.S.A.

Contributing Authors: Lea Baylon, Gail D’Aloisio, Laura Ferrer, Donn Fisher,

Kevin Kerr, Joanne Lai, Ernie Messmann, John Norton, Nik Ormseth, Nonie

Rider, Lynn Robinson, Chris Underwood, Randy Urbano, Karin Welss

Contributors: Jim Boyce, Waichung Cheung, Danny Fields, Alex Ip, Monnia

Oropeza, Chirag Patel, Jeff Pau, Stephane Saux, Mike Yeung

This software was not developed for use in any nuclear, aviation, mass transit, medical, or other inherently dangerous applications. It is the customer’s responsibility to take all appropriate measures to ensure the safe use of such applications if the programs are used for such purposes.

This software/documentation contains proprietary information of Oracle

Corporation; it is provided under a license agreement containing restrictions on use and disclosure and is also protected by copyright law. Reverse engineering of the software is prohibited.

If this software/documentation is delivered to a U.S. Government Agency of the Department of Defense, then it is delivered with Restricted Rights and the following legend is applicable:

Restricted Rights Legend Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of DFARS

252.227–7013, Rights in Technical Data and Computer Software (October 1988).

Oracle Corporation, 500 Oracle Parkway, Redwood City, CA 94065.

If this software/documentation is delivered to a U.S. Government Agency not within the Department of Defense, then it is delivered with “Restricted Rights”, as defined in FAR 52.227–14, Rights in Data – General, including Alternate III

(June 1987).

The information 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.

ORACLE, SQL*Forms, SQL*Graph, SQL*Menu, SQL*Net, SQL*Plus,

SQL*QMX, SQL*Report, SQL*ReportWriter, and SQL*Star are registered trademarks of Oracle Corporation. Oracle7, Oracle Book, Oracle Browser,

Oracle Forms, Oracle Graphics, Oracle*Mail, Oracle Reports, Oracle Terminal,

Oracle Toolkit, and PL/SQL are trademarks of Oracle Corporation. UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited. DG/UX is a registered trademark of the Data General Corporation.

All other products or company names are used for identification purposes only, and may be trademarks of their respective owners.

Preface

T his Oracle7 Reference Addendum for HP 9000 Series 700/800 contains reference information that applies to all UNIX operating systems. It complements the Oracle7 Installation Guide for HP 9000 Series

700/800 specific to your operating system.

The topics covered in this chapter are:

Audience

Document Conventions

• Customer Support and Documentation Sales

Preface i

Audience

This document is intended for database administrators or others responsible for configuring and using Oracle tools on UNIX operating systems.

Additional Reading

If you are unfamiliar with the Oracle relational database management system, read the “Technical Introduction to the Oracle Server” chapter of

Oracle7 Server Concepts. The chapter is a comprehensive introduction to the concepts and terminology used throughout Oracle documentation.

The Oracle Documentation Set

For an explanation of the Oracle documentation set and a complete listing of the Oracle7 Server documentation set, see Getting Started with

Oracle7 for UNIX . The “Oracle Reading List” chapter of your Installation

Guide lists the documents referenced by this guide.

Document Conventions

Conventions used in this guide differ somewhat from those used in other Oracle documentation. Because UNIX is case-sensitive, commands and filenames are not highlighted by the use of uppercase letter; instead, they are printed in boldface type.

Type Conventions

Following are the type conventions: bold italics

[Space Bar]

UPPERCASE

Boldface type indicates UNIX commands, directory names, pathnames, and filenames (for example, the prefs.ora file).

Italics type indicates a variable and is used for emphasis. It also indicates portions of a filename that vary (for example sgadefx .

dbf ).

Words enclosed in brackets indicate key names (for example, Press [Return]).

Uppercase letters indicate Oracle commands and environment variables (for example, SYS).

ii Oracle7 Reference Addendum for HP 9000 Series 700/800

Command Syntax

Following are the syntax conventions for commands: backslash \ braces { } brackets [ ] ellipsis ...

italics monospace vertical line |

A backslash indicates a line is too long to fit on the printed page. Either enter the line as printed (with the backslash) or enter it as a single line without a backslash.

dd if=/dev/rdsk/c0t1d0s6 of=/dev/rst0 \ bs=10b count=10000

Braces indicate required items. Users choose one of the alternatives.

.DEFINE { macro1 | macro2 }

Brackets indicate optional items.

cvtcrt termname [outfile]

An ellipsis indicates an arbitrary number of similar items.

CHKVAL fieldname value1 value2 ... valueN

Italics type indicates variables. Users substitute an appropriate value for a variable.

arg1

Monospace indicates text to be entered.

set echo off

A vertical line indicates a choice within braces or brackets.

SIZE filesize [K|M]

Preface iii

The following symbols should always be entered as they appear in the command format:

colon comma double quote ” equal sign =

,

: hyphen parentheses period semicolon single quote ’

()

;

.

Icons

The following icons appear in the printed documentation. Icons do not appear in the online documentation.

See Also: The book icon indicates a reference to another document, published either by Oracle Corporation or another organization. The words “See Also” without an accompanying icon indicate a reference to another section of this document.

Attention: The attention icon indicates important information.

Suggestion: The suggestion icon indicates hints or recommendations.

OPS

For Parallel Server: The OPS icon indicates information specific to the Oracle Parallel Server.

Warning: The warning icon indicates an action that could damage your system.

Other Conventions

The term “Oracle7 Server” refers to the database server product from

Oracle Corporation.

The term “oracle” refers to an executable or account by that name.

The term “oracle” refers to the owner of the Oracle software.

Unless otherwise stated, examples use the Bourne shell (sh(1)) syntax.

iv Oracle7 Reference Addendum for HP 9000 Series 700/800

Customer Support and Documentation Sales

You can reach Oracle Worldwide Customer Support Services 24 hours a day.

In the USA: 1.415.506.1500

In Europe: +44 1344 860160

Supplying Technical Information

Please be prepared to supply the following information:

• your CSI number (this helps Oracle Corporation track problems recorded for each customer)

• the release numbers of the Oracle7 Server and associated products

• the operating system name and version number

• details of error numbers and descriptions (write down the exact errors)

• a description of the problem

• a description of any changes made to the system

For installation-related problems please supply:

• a printout of the various $ORACLE_HOME and

$STAGE_HOME directories.

• directory path names of your installation staging area

• $ORACLE_HOME directory

This information helps Oracle WorldWide Customer Support validate the information written to the installation log files.

Documentation Sales and Client Relations

In the United States:

• To order hardcopy documentation, call Documentation Sales:

1.800.252.0303

.

• For shipping inquiries, product exchanges, or returns, call Client

Relations: 1.415.506.1500.

Preface v

In the United Kingdom:

• To order hardcopy documentation, call Oracle Direct Response:

+44 990 332200 .

• For shipping inquiries and upgrade requests, call Customer

Relations: +44 990 622300.

Other European customers, please contact your local Oracle Support office for documentation or shipping inquiries.

Your Comments are Welcome

Please use the Reader’s Comment Form at the back of this guide to relay your comments to us. If the form is missing, or if you would like to contact us, you can reach us at:

Oracle for HP Documentation Manager

Oracle Corporation

500 Oracle Parkway

Box 659104

Redwood Shores, California 94065

Phone: 1.415.506.2834 FAX: 1.415.506.7357

E-mail: dochp@us.oracle.com

vi Oracle7 Reference Addendum for HP 9000 Series 700/800

Chapter 1

Chapter 2

Chapter 3

Contents

Oracle7 Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 1

Memory Utilization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Server Resource Limits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1 – 2

1 – 3

System Global Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Monitoring Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1 – 3

1 – 5

Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 8

Reducing Contention for Resources with Multiple Instances

Disk Management with HP–UX 10.X

. . .

. . . . . . . . . . . . . . . . . . . . . . .

1 – 11

1 – 18

Using Logical Volumes

Initialization Parameters

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 19

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 24

Oracle7 Tools

PL/SQL

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 – 1

2 – 2

SQL*Plus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 2

Oracle7 Interfaces

Oracle Precompiler Overview

Precompiler requirements

. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 – 2

3 – 11

Pro*Ada

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 1

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 12

Pro*C Version 2

Pro*COBOL

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 – 14

3 – 16

Pro*FORTRAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

SQL*Module for C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 – 18

3 – 19

Contents i

Chapter 4

Chapter 5

Appendix A

SQL*Net Version 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

SQL*Net Version 2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 – 1

4 – 2

Oracle APPC/LU6.2 Protocol Adapter . . . . . . . . . . . . . . . . . . . . . . 4 – 3

Oracle Names Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Oracle SPX/IPX Protocol Adapter . . . . . . . . . . . . . . . . . . . . . . . . . .

4 – 11

4 – 11

Oracle7 Server Documentation Set Addendum

Oracle7 Server Administrator’s Guide

. . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . .

5 – 1

5 – 2

Oracle7 Server Application Developer’s Guide

Oracle7 Server Concepts

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 – 3

5 – 3

Oracle7 Server Distributed Systems Volume 1:

Distributed Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 4

Oracle7 Server Distributed Systems Volume 2:

Replicated Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 5

Oracle7 Server Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Oracle7 Parallel Server Concepts and Administration . . . . . . . . .

5 – 5

5 – 6

Oracle7 Server Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Oracle7 Server SQL Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 – 7

5 – 7

Oracle7 Server Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 8

Oracle ConText Option Administration

Using Oracle ConText Option

. . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A – 1

A – 2

ii Oracle7 Reference Addendum for HP 9000 Series 700/800

List of Tables

Table 1 – 1 Database Block Sizes and Corresponding

MAXEXTENTS Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 9

Table 1 – 2 Default Initialization Parameters . . . . . . . . . . . . . . . . . 1 – 26

Table 3 – 1 Oracle Precompilers Requirements . . . . . . . . . . . . . . . 3 – 11

Table 5 – 1 Cluster Size Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 2

Table 5 – 2 Database Size Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 2

Table 5 – 3 Index Size Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Table 5 – 4 Block Size and Number of Extents . . . . . . . . . . . . . . .

5 – 3

5 – 6

Table 5 – 5 CREATE CONTROLFILE Parameter Values . . . . . . . 5 – 7

List of Tables i

ii Oracle7 Reference Addendum for HP 9000 Series 700/800

C H A P T E R

1

Oracle7 Server

T his chapter describes HP–UX-specific aspects of Oracle7 Server system administration and tuning. It provides supplementary

HP–UX-specific information for the Oracle7 Administrator’s Reference for

UNIX.

The topics covered in this chapter are:

Memory Utilization

Server Resource Limits

• System Global Area

Monitoring Performance

Tuning

Reducing Contention for Resources with Multiple Instances

Disk Management with HP–UX 10.X

• Using Logical Volumes

• Initialization Parameters

Oracle7 Server 1 – 1

Memory Utilization

Memory issues are important because Oracle7 can be memory intensive. This section discusses Oracle7 Server memory usage.

Estimating Oracle7 Server Memory Usage

To estimate Oracle7’s virtual memory requirement, before you start the

Oracle7 Server, use the following formula:

Virtual memory needed = 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 u area) where n = number of background processes.

For each Oracle backend connection, use the following formula:

Virtual memory needed = size of oracle executable data section

+ size of oracle executables uninitialized data section

+ 8192 bytes for the stack

+ 2048 bytes for processes u area

+ cursor area needed for the application

To get an executable’s text size, private data section size and uninitialized data section size (or bss), use the size command. Program text is only counted once, no matter how many times the program is invoked, because all Oracle executable text is always shared.

To compute actual Oracle physical memory usage while the database is up and users are connecting to it, do the following procedure:

• Run the ps command.

See the HP–UX documentation for a list of available switches for this command.

• Look for all the front end, server, and background Oracle process entries.

For each entry, add the “real size of process” columns for the resident memory use subtotal. Use the ps –el command to find out the process size.

1 – 2 Oracle7 Reference Addendum for HP 9000 Series 700/800

• 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 was invoked.

Server Resource Limits

HP–UX inherits resource limits from the parent process (see getrlimit (2) in your operating system documentation). These limits therefore apply to the Oracle7 Server shadow process that executes on behalf of any user process. As shipped, HP–UX default resource limits are high enough for any Oracle7 Server shadow or background process.

However, if these limits are administratively lowered, the Oracle7

Server system could be affected. This issue should be discussed with your HP–UX system manager.

Disk quotas established for the Oracle dba user ID can also hinder the operation of the Oracle7 Server system. Any such quotas should be established only after discussion between the Oracle7 database administrator and the HP–UX system manager.

System Global Area

The System Global Area (SGA) is the Oracle structure that resides in shared memory and contains, among other things, static data structures, locks, and data buffers. The shared memory feature of the

HP–UX IPC facility is required by the Oracle system. Enough shared memory must be available to each oracle process to address the entire

SGA.

SGA topics are:

• Size Limits of the SGA

Size limit of the SGA

The Oracle7 Server uses shared memory segments for the SGA. The maximum size of a single shared memory region is set by the HP-UX kernel parameter SHMMAX.

If the size of the SGA exceeds the maximum size of a shared memory segment (SHMMAX), Oracle7 attempts to attach two or more segments to fulfill the requested SGA size.

Oracle7 Server 1 – 3

☞ Attention: With HP–UX 10.X, the maximum size of the SGA is increased to 1.75 GB.

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

• db_block_buffers

• db_block_size sort_area_size

• shared_pool_size

Be careful when setting values for these parameters. If you set the values too high, too much of your machine’s physical memory is devoted to shared memory resulting in poor performance. As a guideline, the total of all instance’s SGA sizes should be no more than one third of your total physical RAM.

Using the values of the above parameters, you can calculate the approximate size of an instance’s SGA with the following formula:

(db_block_buffers db_block_size)

+ sort_area_size + shared_pool_size + 1Mb = SGA size

Alternatively, you can enter the HP–UX command ipcs -b. The SGA size, in bytes, is displayed under the heading “Shared Memory.”

To find the exact size of the SGA for a running database, use the Server

Manager command show sga. This command displays the size of the

SGA, in bytes, under the heading ”System Global Area.”

For more information on HP–UX shared memory operations, refer to ipcs , ipcrm, shmget, shmctl, and shmop in the HP–UX Reference

Manual.

1 – 4 Oracle7 Reference Addendum for HP 9000 Series 700/800

Monitoring Performance

Before tuning the system, observe its normal behavior with some of the

HP–UX tools described in this section, as well as with the Server

Manager MONITOR utility.

OPS

For Parallel Server: For the Oracle Parallel Server, dynamic performance tuning views are available to monitor and tune the system. These are described in Appendix C of the Oracle7

Parallel Server Concepts and Administration.

This section describes the following:

• Using HP–UX Tools

Monitoring Disk Performance

Disk Performance Issues

Using HP–UX Tools

GlancePlus/UX

Example

The following operating system tools are available to monitor the performance of the Oracle7 Server under HP–UX:

GlancePlus/UX iostat

• ps sar

• top

HP MeasureWare

HP PerfView

These tools provide statistics for CPU usage, interrupts, swapping, paging, and context switching, for the entire system, not just for the oracle processes. For more information about these commands, refer to your operating system documentation.

This Hewlett–Packard utility is an online diagnostic tool that measures the system’s activity. GlancePlus displays how the system resource are being used. GlancePlus displays dynamic information about the system’s I/O, CPU, and memory usage in a series of screens. You can also use GlancePlus to monitor how individual processes are using resources.

$ gpm

Oracle7 Server 1 – 5

top

The screens for this utility display important information about different aspects of the system’s performance.

DISK I/O

CPU SCREEN

This screen displays information about I/O to and from the disk drives on your system. You can apply this data when checking for I/O saturation on the different devices.

This screen measures the consumption of CPU resources. Note that the memory manager consumes no more than 10% of CPU resources.

MEMORY

SCREEN

This screen informs you if the program activity is using all of the memory resources and thereby generating page faults.

Additional Information: GlancePlus requires separate licensing from Hewlett–Packard. Contact your HP representative for more information.

top is a public domain tool available on HP–UX systems which can be used to collect and display information about system operations.

Three general classes of information are displayed by top.

• system data memory data

• process data

The first few lines at the top of the display show general information about the state of the system, including:

System name and current time.

Load averages in the last one, five, and fifteen minutes

• Number of existing processes and the number of processes in each state (sleeping, waiting, running,starting, zombie, and stopped).

• Percentage of time spent in each of the processor states (user, nice, system, idle, interrupt and swapper) per processor on the system.

• Average value for each of the processor states (only on multi–processor systems).

1 – 6 Oracle7 Reference Addendum for HP 9000 Series 700/800

The memory data displayed by top includes:

• virtual and real memory in use (with the amount of memory considered ”active” in parentheses) and the amount of free memory.

Process data includes information about individual processes on the system.

Note: top displays information in a format similar to ps.

Monitoring Disk Performance

To monitor disk performance, use sar –b and sar –u. Important sar –b columns for disk performance are: bread/s , bwrit/s blocks read and blocks written (important for file system databases) pread/s , pwrit/s partition reads and partition writes (important for raw partition database systems)

An important sar –u columns for disk performance is:

%wio

Key indicators are: percentage of CPU time waiting on blocked I/O

• The sum of bread, bwrit, pread and pwrit indicates the overall health of the disk I/O subsystem. The higher the sum, the greater the potential for disk I/O bottlenecks. The larger the number of physical drives, the higher the sum threshold number can be. A good default value is no more than 40 for two drives and no more than 60 for four to eight drives.

• The %rcache should be greater than 90 and %wcache should be greater than 60. Otherwise, the system may be disk I/O bound.

• If %wio is consistently greater than 20, the system is I/O bound.

Disk Performance Issues

Oracle block sizes should either match disk block sizes, or be a multiple of disk block sizes.

If possible, do a file system check on the partition before using it for database files, then make a new file system to ensure that it is clean and not fragmented. Distribute disk I/O as evenly as possible and separate log files from database files.

Oracle7 Server 1 – 7

Tuning

This section describes tuning the Oracle7 Server on HP–UX. Topics discussed are:

• Block Size and File Size

Associating Data Blocks with Instances

Table Striping

• Reducing Database Fragmentation

Block Size and File Size

Although data storage space is often measured in megabytes (one MB =

1024

*

1024 bytes), the HP–UX operating system and Oracle7 Server each perform input and output in units of data storage called blocks.

The size of the operating system blocks is not necessarily equal to

Oracle blocks.

Oracle7 Server block size is not fixed. You can set its value when creating a database by changing the DB_BLOCK_SIZE parameter in the init sid.ora file.

Changing the Oracle block size can change Oracle performance, depending on the disk hardware, file system, and application.

Experiment with different block sizes to see what is most efficient for your configuration. The default size 2 KB should be adequate for most circumstances, but some performance benefits can be gained by modifying the Oracle block size on your system.

Specifying Oracle Block Size

On HP–UX, Oracle has a default block size of 2 KB and a maximum block size of 16 KB.

You can set the actual block size to any multiple of 2 KB up to 16 KB, inclusive.

The optimal block size on HP–UX is typically 2 KB, but varies with the applications. To create a database with an Oracle block size that is different from the default, specify the new block size in the initsid.ora file by adding the line: db_block_size= new_block_size

Experiment with block size before transferring your data to a new database, since database creation is required for a block size change.

1 – 8 Oracle7 Reference Addendum for HP 9000 Series 700/800

Maximum Number of Extents

The first block of each segment contains an extent map for each extent.

The maximum number of extents allowed is therefore a function of the database block size and the size of each extent map entry.

To increase the limit, change the database block size (which requires a full export/import). Table 1 – 1 shows the database block size relative to the greatest MAXEXTENTS value.

Database Block Size

1 KB

2 KB

4 KB

8 KB

Greatest MAXEXTENTS Value

57

121

249

505

Table 1 – 1 Database Block Sizes and Corresponding MAXEXTENTS Values

Associating Data Blocks with Instances

If you are running the Oracle Parallel Server and have multiple Oracle instances, you can use free space lists. This allows transactions running on separate instances to insert and update data in the same table concurrently.

When an insert or update must locate free space in a table, the Oracle7

Server searches one of the free lists in the set associated with the instance running that transaction. If the free list does not contain a block with sufficient space, Oracle7 searches the master free list, not one of the other free lists for that instance.

If the master free list does not contain sufficient space, the Oracle7

Server allocates a new extent, if possible, and adds its space to the master free list. For this reason, it is important to pre-allocate extents to tables; otherwise, the free space in an extent allocated by the Oracle7

Server is available to all instances and you lose the performance advantages of partitioning data between instances.

To prevent the Oracle7 Server from allocating new extents for a table, you should set MAXEXTENTS to the number of pre-allocated extents plus MINEXTENTS.

If the Oracle7 Server cannot find sufficient space on the master free list and cannot allocate a new extent, it returns error message ORA-01547: failed to allocate extent of size num in tablespace ‘name’

Oracle7 Server 1 – 9

In this release of the Oracle7 Server, you can explicitly allocate new space to a table and specify a database file from which to take the new space. You can also use new options of the SQL statements CREATE

TABLE and ALTER TABLE to associate free space with particular instances.

• CREATE TABLE has a storage option, FREELIST GROUPS, that specifies the number of free list sets for the table, and another storage option, FREELISTS, that specifies the number of free lists per set.

• ALTER TABLE has the option ALLOCATE EXTENT, which allocates and associates space with a particular set of free lists.

In a multi-instance server configuration, MAXINSTANCES for the database could be many times larger than FREELIST GROUPS for a table, so that many instances share one set of free lists.

See Also: The Oracle7 Server Administrator’s Guide. for more information about CREATE TABLE and ALTER TABLE.

Table Striping

Striping is the process of dividing the data for a large table into small portions and storing these portions in separate data files on separate disks. This permits multiple processes to access different portions of the table concurrently without disk contention. Striping is particularly helpful in optimizing random access to tables with many rows.

See Also: The Oracle7 Server SQL Reference for information on the ALLOCATE EXTENT DATAFILE parameters of the ALTER

TABLE command.

Reducing Database Fragmentation

This section supplements the instructions for reducing database fragmentation in the Oracle7 Server Utilities. Refer to that document for more information about the Export and Import utilities.

1.

Use the MONITOR command in Server Manager to check for active users.

2.

Make sure all users have completed their transactions and do a full database export (FULL=Y) to back up the entire database.

3.

Shut down each Oracle instance when all users are logged off.

4.

When all instances are shut down, back up the database, redo log, and control files.

1 – 10 Oracle7 Reference Addendum for HP 9000 Series 700/800

5.

Recreate the database using the Server Manager command

CREATE DATABASE.

6.

Connect to oracle as SYS/password and run catalog.sql from the

?/rdbms/admin directory.

This file is run automatically when you use the Oracle Installer to create an Oracle instance and database. When you use Server

Manager to create an Oracle system, you must run this file yourself.

7.

Connect to oracle as system and run the catdbsyn.sql file from the

?/rdbms/admin directory.

8.

Create a rollback segment in the SYSTEM tablespace, as described in the Oracle7 Server Administrator’s Guide.

9.

If you create private rollback segments using the SQL statement

CREATE PRIVATE ROLLBACK SEGMENT, you must shut down the database and then edit the initsid.ora parameter file. Use the initialization parameter ROLLBACK_SEGMENTS to identify the new segments. For example: rollback_segments=(rb1 [, xxx,yyy,...]) where additional entries are delimited by commas. If you start up the database with this parameter file, the private rollback segments are enabled.

10. Start Oracle and run Import (FULL=Y) to import the exported database.

Reducing Contention for Resources with Multiple Instances

If you are running the Oracle Parallel Server on a multi-instance system and it suffers from poor performance, determine the cause of this behavior.

Among the possible causes are:

• Contention for CPU

• Contention for locks

Oracle7 Server 1 – 11

Contention for CPU

If you started Oracle in SHARED mode, and you have a number of instances running, ensure that the workload is balanced across the processors running the instances. For example, avoid running all the jobs on a single instance, or a few CPU-intensive jobs on one instance and some lightweight jobs on the other instances.

An overloaded instance can:

• run out of processing power have insufficient physical memory to hold all the data pages

When you connect to Oracle using SQL*Net TCP/IP, you can specify an

ORACLE_SID or class name for each instance. If you specify a class name, an entry for that class name must exist in the

/var/opt/oracle/oratab file. You can then choose to connect to Oracle in two different ways:

• If you connect to an instance via SQL*Net TCP/IP using an

ORACLE_SID, you connect directly to the specified instance; if that instance is currently overloaded, performance can be degraded. This option allows you to explicitly balance CPU load between instances based on your knowledge of system usage patterns at your site. Try to divide CPU-intensive jobs among multiple instances.

• If you connect to a class name, you can connect to a group of instances. This option provides simplified administration of a larger number of equal-weight jobs.

For example:

$ svrmgrl

SVRMGR> CONNECT SYSTEM/MANAGER@T: node:SID1

This connects you to the instance associated with the sid SID1.

If you have a class called GEN, and two instances on different processors with sids of SID1 and SID2 both with class name set to

GEN , you can connect to GEN via SQL*Net TCP/IP:

$ svrmgrl

SVRMGR> CONNECT SYSTEM/MANAGER@T: node:GEN

Connection requests are directed to both instances in turn.

1 – 12 Oracle7 Reference Addendum for HP 9000 Series 700/800

Contention for Locks

Oracle in SHARED mode allows multiple access to shared resources; to ensure data integrity, every database block is protected by a global lock.

The lock/unlock operations are handled by the distributed lock manager (DLM). The locking mechanisms impose some overhead in terms of performance, which you can minimize with careful tuning.

If a process in an instance attempts to change a database block, the instance must own the lock on this database block. If this lock is owned by another instance, the lock manager notifies the owner. The owner then returns the block to disk and releases the lock for the requesting process. The next process acquires the lock and reads a new copy of the block from the disk. This mechanism is called block-pinging.

Whenever possible, avoid block-pinging to keep I/O costs low.

Lock tuning topics are:

• Checking for lock contention

• Retaining locks

Assigning locks to files

Clustering database blocks

• General tips for reducing contention for locks

Checking for Lock Contention

To find out which blocks are most subject to block-pinging, you can run

?/rdbms/admin/catparr.sql

as SYS/password, and query the V$PING view. The affected blocks are those which are used concurrently by multiple instances.

This problem can be caused by contention for database blocks, or only for a lock on several blocks. Oracle7 has the following lock management techniques to reduce loss of performance caused by contention between processes for locked resources:

• retaining locks until they are required by another process

• assigning locks to specific files clustering database blocks

These are described in detail in the rest of this section and are followed by general tips for minimizing contention for locked resources.

Oracle7 Server 1 – 13

Retaining Locks

Oracle7 is implemented with a mechanism which allows one global lock to protect more than one database block. This means you can access many database blocks, without having to do a lock operation for each database block access.

If an Oracle instance has a lock on a database block (or group of blocks), it keeps the lock until another instance requests it. So if the database block leaves the instance cache, the lock is not released immediately. The instance can then re-access the same block without using the lock manager, since it still owns the lock on this block.

Assigning Locks to Files

When Oracle7 must lock a block, it looks at the database block address and hashes that to one of its resource names. The initialization parameter GC_DB_LOCKS allows you to specify the total number of different resource names to use in the system.

The initialization parameter GC_FILES_TO_LOCKS specifies how these resource names are spread over the database files.

For example, if you have one datafile (file#1) and one index file (file#2) and the majority of your transactions do not need to alter the index, you may want a high granularity of blocks-to-resource names for the datafile but not for the index file. For example:

GC_DB_LOCKS=1050

GC_FILES_TO_LOCKS=”1=1000:2=50”

# Total no of resources

# 1000 for datafile,

# 50 for index file

Here, for the datafile file#1, the first block is assigned to resource#1 , the second block to resource#2 , and so on. That is, they are assigned according to this formula: resource_number = block_number MOD file_resources

Clustering Database Blocks

You can also cluster blocks so that a resource name covers several contiguous blocks. For example, if the datafile has 5,000 blocks, you may want to use a clustering factor of 5 so that a resource name covered only a single area of the file (instead of resource#1 covering blocks 1, 1001, 2001, etc.). For example:

GC_DB_LOCKS=1050

GC_FILES_TO_LOCKS=”1=1000!5:2=50”

# Total no of resources

# 1000 for

# datafile,

1 – 14 Oracle7 Reference Addendum for HP 9000 Series 700/800

# cluster

# factor of 5

The resource name used to protect a block is calculated as described above. Once the resource name has been determined, Oracle uses a lock element to keep information about the status of the lock. The number of lock elements available for locking is exactly the same as the number of resources, so each resource name has its own lock element.

To find the correspondence between file numbers and filenames, query the V$DBFILE table.

Tips for Reducing Contention for Locks

• Organize the system so all processes working on the same dataset run on the same Oracle instance.

• Organize the data so large tables are stored in a separate tablespace. This tablespace can be stored on disk using a single large file. Also, you can group read-only tables together in a single tablespace in a single file, possibly spanning several disks.

Indexes that do not change can also be stored in a large file.

This means that the data is laid out very logically on the system, and it also allows you to protect files with read-only data with a single global lock, leaving lock space available for the blocks that are changed.

• Avoid having multiple processes working on different datasets that are stored in the same database blocks. To do this, it may be necessary to recreate the tables and lay out the data differently using pctfree and pctused.

• Avoid contention on a table for concurrent multi-instance inserts, by creating the table with the storage parameters FREELIST

GROUPS and/or FREELISTS set to a higher value. You may also have to allocate a separate extent for each instance to make the best use of free space lists. You can assign these extents to files if you have separate files in the tablespace.

Oracle7 Server 1 – 15

I/O balancing recommendations

When evaluating system I/O, consider optimizing head movement and controller activity. Try to balance the load across separate drives and controllers. In a typical environment, you must consider four kinds of

I/O:

• the HP–UX file system

HP–UX swapping and paging

Oracle tablespace

• Oracle log file

To balance I/O:

1.

Separate the redo logs and the database file(s) onto different drives.

In environments with a high transaction rate, a lot of I/O activity is directed to the redo logs. If possible, put the redo logs alone on a disk drive.

2.

Spread heavily used database files over different drives.

If you create several tablespaces composed of files that reside on different drives, you prevent hot spots from occurring.

You can also create a single tablespace composed of several files residing on different disks.

3.

Separate tables and their indexes.

If a SQL statement requires access to a table and its index, you can have greater throughput if you put the table and its index on separate drives.

4.

Create more than one rollback segment and distribute the segments evenly across the drives.

A high transaction rate environment requires heavier use of rollback segments. If you create additional segments across drives, you not only balance potentially heavy I/O, but you also avoid contention for the rollback segments themselves.

Cache the rollback segments to avoid physical I/O.

5.

Separate Oracle and HP–UX I/O.

If possible, put HP–UX on a drive separate from Oracle I/O.

You can also put raw partition files on the same drive as HP–UX file system files.

1 – 16 Oracle7 Reference Addendum for HP 9000 Series 700/800

Tuning the Oracle Buffer Cache Size

The Oracle buffer cache is the area in memory that stores the database buffers for Oracle. When Oracle uses raw devices, it does not need to use the HP–UX buffer cache.

When moving to raw devices, increase the size of the Oracle buffer cache.

Determining the Cache Hit Ratio

The cache hit ratio tells you the percentage of time a block is found in the cache and disk I/O is unnecessary. This ratio is determined by the formula:

(logical_reads - physical_reads) / logical_reads

The number of logical reads is the sum of CONSISTENT_GETS plus

DB_BLOCK_GETS.

The Oracle cache hit ratio is determined from the Server Manager monitor and statistics displays. (It can also be determined from the user display for individual processes.)

The HP–UX command sar may help you determine which buffer caches should be increased or decreased: sar –b sar –w sar –u sar –r sar –p reports the HP–UX buffer cache activity reports the HP–UX swapping activity reports CPU utilization reports memory utilization reports the HP–UX paging activity

Adjusting Cache Size

To adjust cache size:

• Increase Oracle cache size as long as the cache hit ratio goes up.

• Decrease cache sizes if the swapping/paging activity becomes high.

Oracle7 Server 1 – 17

Disk Management with HP–UX 10.X

Beginning with the 10.0 release of HP–UX, disks are managed identically on Series 800 and Series 700 systems. On both the Series

800 and Series 700, using logical volumes is recommended as the preferred method for managing disks.

Although the use of logical volumes is encouraged, disks on both the

Series 800 and Series 700 can also be managed as non–partitioned disks, or with hard partitions for those disk models that support hard partitions.

Existing disks that are non–partitioned or that have hard partitions can be converted to use logical volumes. Both LVM disks and non–LVM disks can exist simultaneously on your system, but a given disk must be managed entirely by either LVM or non–LVM methods. That is, you cannot combine these techniques for use with a single disk.

Existing hard partitioned disks from the Series 800 and non–partitioned disks from the Series 700 continue to be supported under release 10.01, except for SDS disks.

Hard partitions are provided only for models of disks that were supported prior to release 10.0. Hard partitions will not be provided on disks introduced with 10.0 or later.

You will not be able to use a partitioned disk for your root disk. You will only be able to use a non–partitioned disk or LVM disk for this purpose.

Additional Information: for more detailed information, see the Hewlett–Packard manual HP–UX System Administration

Tasks.

1 – 18 Oracle7 Reference Addendum for HP 9000 Series 700/800

Using Logical Volumes

OPS

For Parallel Server: Oracle Parallel Server on HP–UX requires the use of shared logical volumes.

Overview

Logical volumes are another way of viewing how disks and file systems are configured. In a traditional configuration, each disk is considered individually in terms of its sized partitions, each of which holds a file system, swap space, boot area, or raw data. In a configuration that uses logical volumes, all the disks mounted on a system are pooled together for data storage and consist of equally sized extents of 4 MBs. Multiple extents are then allocated for sufficient data storage.

Logical volumes provide capabilities that are unavailable when using fixed partitions. A logical volume can represent

• space apportioned on one disk multiple partitions on one disk

• multiple partitions on more than one disk

Note: The Logical Volume Manager is a disk management subsystem on Series 700 and 800 systems that lets you allocate disk space as logical volumes.

Logical Volume

Raw Disk 1

Raw Disk 2

Figure 1 – 1 Logical Volumes

Logical volumes offer the following benefits:

• easier configuration planning

• dynamic performance tuning

Oracle7 Server 1 – 19

• mirroring and online disk replacement

Configuration planning

Dynamic performance tuning

You can create logical volumes based on raw partition availability, since logical volumes can span multiple disk drives. The disk drives do not have to be re-formatted in order to obtain appropriate logical disk sizes.

The Logical Volume Manager helps you manage file systems whose size is likely to grow. You can specify the size of file systems based upon your needs, and can expand or contract a logical volume by adding or removing disk space from anywhere on your system.

Disk performance can be optimized when the database is online by moving “hot spots” to cooler drives. Most hardware vendors who provide the logical disk facility also provide a graphical user interface that can be used to perform this tuning.

Mirroring and online disk replacement

The HP/Mirror Disk utility lets you map a logical volume to different physical devices. Mirroring provides you with the means to recover from the loss of one copy of your data. If one copy of a mirror fails, dynamic re-synchronization is possible.

Setting up logical volumes

An experienced system administrator with specific knowledge about the machine you are using should create the logical volumes with

HP–UX commands and the SAM utility.

Additional Information: For more information on creating logical volumes, see the Hewlett–Packard manual HP–UX

System Administrator Tasks.

Step 1. Create volume groups.

Pool the physical volumes (disks that have been initialized) into a volume group with the vgcreate command:

Syntax $ mkdir /dev/vg nn

$ mknod /dev/vg nn/group c 64 0xNN0000

$ vgcreate /dev/vgnn /dev/dsk/c0t0d0 . . .

Step 2. Use SAM to set up the logical volume for use by ORACLE.

1 – 20 Oracle7 Reference Addendum for HP 9000 Series 700/800

Example

Example

Example

Example

Step 3. Make sure the logical volume is owned by ORACLE.

$ chown oracle /dev/vg01/rlvol5

Step 4. Make sure the logical volume is accessible only by

ORACLE.

To do this, use chmod.

$ chmod 600 /dev/vg01/rlvol5

Step 5. Create or add a new database.

From SQL*DBA, use the SQL statement create database to create the database using the logical volume.

create database sid logfile ’?/dbs/log1.f’ size 100K, ’?/dbs/log2.f’ size 100K datafile ’/dev/vg01/rlvol5’ size 10000K reuse;

Alternatively, if you wish to add the section to a tablespace in an existing ORACLE database, enter: alter tablespace tablespace_name add datafile

’/dev/vg01/rlvol5’ size 10000K reuse;

Additional Information: You can use the same procedure to set up a logical volume for the redo log files.

Using logical volumes

When using logical volumes, you should balance the load across separate drives and controllers. In a typical environment you must consider four kinds of I/O:

• the HP–UX file system

HP–UX swapping and paging

ORACLE tablespace

• ORACLE log file

When you attempt to balance I/O, follow this procedure:

Step 1. Separate the redo logs and the database file(s) onto different drives.

Oracle7 Server 1 – 21

In high transaction rate environments, a great deal of I/O activity will be directed to the redo logs. Ideally, the redo logs will exist alone on a disk drive.

Step 2. Spread heavily used database files over different drives.

If you create several tablespaces composed of files that reside on different drives, you keep “hot spots” from occurring.

Alternatively, you can create a single tablespace composed of several files residing on different disks.

Step 3. Separate tables and their indexes.

If a SQL statement requires access to a table and its index, you can have greater throughput if you put the table and its index on separate drives.

Step 4. Create more than one rollback segment, and distribute the segments evenly across the drives.

A high transaction rate environment requires heavier use of rollback segments. If you create additional segments across drives, you not only balance potentially heavy I/O, but you also avoid contention for the rollback segments themselves.

Cache your rollback segments to avoid physical I/O.

Step 5. Separate ORACLE and HP–UX I/O.

Ideally, you would put HP–UX I/O on a drive separate from

ORACLE I/O.

If HP–UX and ORACLE must reside on the same drive, put the

ORACLE file system files and HP–UX file system files as close together on the disk as possible.

Backing up logical volumes

Logical volume backup can be handled in either of two ways:

• Copy the contents of the logical volume to a HP–UX file and allow the normal backup procedures to copy it.

• Copy the logical volume directly to tape.

Copying to a HP–UX File:

1 – 22 Oracle7 Reference Addendum for HP 9000 Series 700/800

One backup technique is to copy the logical volume to a HP–UX file and allow the normal backup procedures to copy it. You must still use dd to copy from the logical volume.

Caution is required because some HP–UX backup programs ignore large files; you must verify that the HP–UX file is indeed backed up.

Copying to Raw Tape Device:

You can copy the logical volume directly to the raw tape device as in the example which follows:

$ dd if=/dev/vg01/rlvol5 of=/dev/rmt/0m

This gives one block per tape record and assumes that the database uses the entire disk section.

A more typical usage would be:

$ dd if=/dev/vg01/rlvol5 of=/dev/rmt/0m bs=10b count=10000

This copies the tape 10 blocks per tape record and copies 10000 blocks.

(This assumes 512K database blocks.)

Use dbfsize /dev/vg01/rlvol5 to determine the number of ORACLE blocks in the database file. Add one ORACLE block to that number for the database header block.

The dd command will typically run faster with a larger block size

(bs=20K or bs=32K). Block sizes larger than 20K are discouraged when copying to tape because the records get very long and are less reliable.

The dd command will not handle multiple tapes, so if the section size exceeds one tape, you must use multiple dd commands, as in:

$ dd if=/dev/vg01/rlvol5 of=/dev/rmt/0m bs=10b count=10000

Change tapes, then enter:

$ dd if=/dev/vg01/rlvol5 skip=10000 of=/dev/rmt/0m bs=10b count=10000

Blocking at 20 blocks per record, you can generally fit approximately

50000 blocks on a standard 2400 foot tape (at 1600 BPI).

For the sake of speed, the block size should be a multiple (or factor) of the number of blocks per track. Thus, for a device with 32 blocks per track, a block size of 16 would probably be optimal.

To utilize logical volumes fully, you must adjust the size of the Oracle buffer cache and, if memory is limited, the HP–UX buffer cache.

Oracle7 Server 1 – 23

Initialization Parameters

This section describes initialization parameters that can be modified in the init.ora file for your Oracle7 Server instance. Topics include:

• Default Initialization Parameter Values

Asynchronous I/O

Log Files

LOG_CHECKPOINT_INTERVAL

LOG_BUFFER

• Blocks

Latching

Parallel Server

SGA

Multi-Threaded Server

See Also: Appendix A, “Initialization Parameter Files,” in the

Oracle7 Server Administrator’s Guide, and “Default init.ora File” in Chapter 1, “Planning a Complex Database on UNIX”, in the

Oracle7 Administrator’s Reference for UNIX.

Default Initialization Parameter Values

The following table lists default initialization parameter values on

HP–UX. These values are assumed by an Oracle7 Server instance if you do not specify a different value for them in the initsid.ora file.

These values can differ from the parameter values supplied with the

UNIX init.ora template file. Oracle Corporation recommends that you include only those parameters that differ from the default initialization parameter values in the initsid.ora file. To display the current values of these parameters on the system, use Oracle Server Manager to execute the SQL statement SHOW PARAMETERS.

1 – 24 Oracle7 Reference Addendum for HP 9000 Series 700/800

AUDIT_FILE_DEST

Parameter

BACKGROUND_DUMP_DEST

COMMIT_POINT_STRENGTH

CONTROL_FILES

DB_BLOCK_SIZE

DB_FILES

DB_FILE_MULTIBLOCK_READ_COUNT

DB_FILE_SIMULTANEOUS_WRITES

DISTRIBUTED_TRANSACTIONS

INIT_SQL_FILES

INSTANCE_NUMBER

LOG_ARCHIVE_BUFFER_SIZE

LOG_ARCHIVE_BUFFERS

LOG_ARCHIVE_DEST

LOG_ARCHIVE_FORMAT

LOG_BUFFER

LOG_CHECKPOINT_INTERVAL

LOG_SMALL_ENTRY_MAX_SIZE

MTS_MAX_DISPATCHERS

MTS_MAX_SERVERS

NLS_LANGUAGE

NLS_TERRITORY

OPEN_CURSORS

OS_AUTHENT_PREFIX

PROCESSES

SHARED_POOL_SIZE

SORT_AREA_SIZE

SORT_SPACEMAP_SIZE

TEMPORARY_TABLE_LOCKS

TRANSACTIONS_PER_ROLLBACK_SEGMENT

Default Value

$ORACLE_HOME/rdbms/audit

$ORACLE_HOME/rdbms/log

1

$ORACLE_HOME/dbs/ctrl1 sid.dbf

$ORACLE_HOME/dbs/ctrl2 sid.dbf

$ORACLE_HOME/dbs/ctrl3 sid.dbf

2 KB

30 (maximum of 1022)

4 (range of 1–32)

4

8

$ORACLE_HOME/dbs/sql.bsq

0

16

32

$ORACLE_HOME/dbs/arch

%t_%s.dbf

4 x maximum block size

500 x (max block size/min. block size)

800

0

0

AMERICAN

AMERICA

50 per process ops$

25

3500000 bytes

65536

512

32

16

Oracle7 Server 1 – 25

USE_ASYNC_IO

USER_DUMP_DEST

Parameter

Table 1 – 2 Default Initialization Parameters

Asynchronous I/O

DB_WRITERS

USE_ASYNC_IO

Default Value

FALSE

$ORACLE_HOME/rdbms/log

Default value : 1

Range of values : 1...50

Specifies the number of database writer (DBWR) processes to be brought up when the database is started. The setting of this parameter depends on whether you use HP–UX asynchronous I/O (AIO) or

Oracle multiple database writers.

If you decide to use multiple database writers instead of asynchronous

I/O, set this parameter to the appropriate number of database writers and set USE_ASYNC_IO = FALSE. The number of database writers needed is application-specific. In general, however, this number should be at least equal to the number of disk drives used for holding tablespaces. Note that each additional DBWR process consumes one more semaphore on the system, so the PROCESSES parameter in the init sid.ora file and the HP–UX semaphore parameters may need to be raised accordingly.

Default value : false

Range of values : true/false

This parameter setting depends on whether Oracle7 Server uses

HP–UX asynchronous I/O (AIO). To turn on the HP–UX AIO feature, set this parameter to true in the initsid.ora file.

1 – 26 Oracle7 Reference Addendum for HP 9000 Series 700/800

Log Files

LOG_ARCHIVE_DEST

Default value : $ORACLE_HOME/dbs/arch

Range of values : any valid path or device name

Specifies the name of the redo log archive file. This value must be a filename. You receive an error if you specify a directory location for this parameter.

LOG_CHECKPOINT_INTERVAL

Default value : 4000

Range of values : 2...unlimited

Sets the number of redo log file blocks (operating system blocks, not

Oracle blocks) required to trigger a checkpoint. A checkpoint ensures that all blocks modified since the previous checkpoint are written to disk. A checkpoint occurs when either the redo log file is full or the

LOG_CHECKPOINT_INTERVAL is reached.

LOG_CHECKPOINT_TIMEOUT

Default value : 0 seconds

Range of values : 0...unlimited

Sets the maximum interval between checkpoints, in seconds, for a secondary database. This parameter does not override and is not overridden by the LOG_CHECKPOINT_INTERVAL parameter.

See Also: Oracle7 Server Administrator’s Guide for further discussion of performance and tuning issues related to setting checkpoints.

Oracle7 Server 1 – 27

LOG_FILES

LOG_BUFFER

Default value : 16

Range of values : 2...255

Sets the maximum number of redo log files that can be opened at runtime for this database. This is in effect every time an instance opens a database, and lasts until the database is closed.

This parameter is related to the MAXLOGFILES argument for the

CREATE DATABASE statement, that is the absolute maximum number of redo log files for all instances. If neither LOG_FILES nor

MAXLOGFILES is used, the default limit of the number of redo log files is the Oracle limit of 255 files. Otherwise, the default is 16 files.

Default value : 4 * DB_BLOCK_SIZE

Range of values : 2 KB...unlimited

Sets the number of bytes allocated to the redo log buffers in the System

Global Area (SGA). In general, larger values reduce redo log file I/O, particularly if transactions are long or numerous. The default is four times the value of DB_BLOCK_SIZE. For efficiency, LOG_BUFFER should be a multiple of DB_BLOCK_SIZE.

When the system writes to the redo log buffers, it includes the block of altered bytes, the rollback segments block, and the database header data. Therefore, the entry in the redo log buffer is normally larger than the database buffers.

Blocks

CCF_IO_SIZE

Default value : 131072

Range of values : 1...131072

Determines the number of contiguous blocks per write when creating a database. The higher the number, the faster the database can be created.

1 – 28 Oracle7 Reference Addendum for HP 9000 Series 700/800

DB_BLOCK_SIZE

Default value : 2 KB

Range of values : 512...16 KB

Sets the size in bytes of an Oracle database block. The current value of

DB_BLOCK_SIZE on the system can be found using the SQL command

SHOW PARAMETERS.

DB_FILE_MULTIBLOCK_READ_COUNT

Default value : 8

Range of values : 1...32

Used for multi-block read operations. It sets the number of blocks to read when doing I/O during a sequential scan. This parameter is useful for performing a full table scan in which the WHERE clause does not refer to an indexed column.

USE_READV

Default value : false

Range of values : true/false

Enables you to use the readv system call to handle scattered read operations. If you set this parameter to TRUE, multi-block read operations are done through the readv call. If you set this parameter to

FALSE, a buffer is allocated and scattered read operations are simulated by reading all blocks, followed by memory-to-memory copies.

Latching

LOG_SIMULTANEOUS_COPIES

Default value : CPU_COUNT

Range of values : 0...unlimited

Specifies the number of copy latches. If this is not specified, the default value is set to CPU_COUNT or set internally. Note that the SQL command SHOW PARAMETERS shows the value of this parameter as the default (which is 0), rather than the internally determined value.

Oracle7 Server 1 – 29

SPIN_COUNT (for machines with multiple CPUs only)

Default value : 2000

Range of values : 2000...unlimited

Sets the number of times an Oracle process attempts to get a latch before sleeping. If the latch is busy, Oracle7 Server spins and checks back with the latch up to SPIN_COUNT number of times until the latch is free. Once it attains SPIN_COUNT, the Oracle process sleeps for a set period of time, then tries again.

You can adjust performance by changing the value of SPIN_COUNT.

A high value obtains the latch sooner than a low value, if the degree of latch contention is low. However, a high value can also use more CPU time. A good starting SPIN_COUNT value is 2000.

If there is a great deal of latch contention, so that you are unlikely to obtain a latch during the spin, set this number low so that the process can relinquish the CPU to other processes.

TIMEOUTS

Default value : varies by machine

Range of values : 0...unlimited

Note that the TIMEOUTS column in the Server Manager display is system-specific in meaning. The number of TIMEOUTS is the number of times the process was unable to get a resource because it could not get a latch for that resource. (This number is different on different machines.)

Parallel Server

MAX_COMMIT_PROPAGATION_DELAY

Default value : 90000

Range of values : 0...90000

Indicates the maximum time in seconds allowed before the system commit number (SCN) held in the SGA of an instance is refreshed.

Units are in hundredths of seconds. When user-level queries are issued in a Parallel Server environment, the SCN is used to obtain a consistent read from the database. Since the system uses the value of the local

SCN, held in the SGA, this may be inconsistent with the global SCN, maintained by the distributed lock manager (DLM), or an SCN server.

1 – 30 Oracle7 Reference Addendum for HP 9000 Series 700/800

The MAX_COMMIT_PROPAGATION_DELAY parameter specifies how often the local SCN value is refreshed. Setting the parameter to zero enforces a refresh for each user-level query. The default value of

90,000 (15 minutes) ensures that a refresh only occurs during a commit, or a data dictionary operation.

This parameter does not need to be identical in all instances.

SGA

PRE_PAGE_SGA

Default value : no

Range of values : yes/no

When set to YES, this parameter touches all the SGA pages, causing them to be brought into memory. As a result, it increases instance startup time and user login time, but can reduce the number of page faults that occur shortly after. The reduction in page faults allows the instance to reach its maximum performance capability quickly, rather than an incremental buildup. It is most useful on systems that have sufficient memory to hold all the SGA pages without degrading performance in other areas.

Multi-Threaded Server

MTS_MAX_SERVERS

Default value: 0

Range of values: 0...50

This is the maximum number of multi-threaded server processes that can run simultaneously.

MTS_SERVERS

Default value: 0

Range of values: 0...MTS_MAX_SERVERS

Sets the number of multi-threaded server processes that are created at instance startup. A value of 0 for this parameter indicates that the multi-threaded server is disabled. Any positive, non-zero value indicates that the multi-threaded server is enabled.

Oracle7 Server 1 – 31

1 – 32 Oracle7 Reference Addendum for HP 9000 Series 700/800

C H A P T E R

2

Oracle7 Tools

T his chapter presents HP–UX-specific information that complements the chapter for each Oracle product in the Oracle7 Administrator’s

Reference for UNIX.

The topics covered in this chapter are:

PL/SQL

SQL*Plus

Oracle7 Tools 2 – 1

PL/SQL

There is no HP–UX-specific information for this product.

SQL*Plus

Administering SQL*Plus

SQL*Plus TIMING Displays

The SQL*Plus TIMING command shows the time used by SQL commands and command files. An example of the output of the

TIMING command is: real 1.70

The numbers represent times in seconds. For more information about this command, refer to the SQL*Plus User’s Guide and Reference.

Using SQL*Plus

SQL*Plus START Command

Normally, SQL*Plus looks in the current directory for filename.sql whenever you use the START filename.sql command. To use one central directory to hold all the .sql files, set the SQLPATH environment variable. This environment variable points to a number of directories.

The format for the SQLPATH environment variable is the same as for the

PATH environment variable.

See Also: The Oracle7 Server SQL Reference.

SQL*Plus Restrictions

PRODUCT_USER_PROFILE table

Do not remove the PRODUCT_USER_PROFILE table from the system account once it has been created. Removing it can cause CONNECT statements within SQL*Plus to hang.

2 – 2 Oracle7 Reference Addendum for HP 9000 Series 700/800

SQL*Plus Version

The Oracle7 Server requires SQL*Plus version 3.1 or following. Do not use SQL*Plus version 3.0 because it cannot access data from a version 7 database.

Oracle7 Tools 2 – 3

2 – 4 Oracle7 Reference Addendum for HP 9000 Series 700/800

C H A P T E R

3

Oracle7 Interfaces

T his chapter presents HP–UX-specific information that complements the section for each interface product in Chapter 8, “Oracle Precompilers and Interfaces”, in the Oracle7 Administrator’s Reference for UNIX.

The topics covered in this chapter are:

Oracle Precompiler Overview

Precompiler requirements

Pro*Ada

Pro*C Vesion 2

• Pro*COBOL

Pro*FORTRAN

SQL*Module for C

Oracle7 Interfaces 3 – 1

Oracle Precompiler Overview

Precompilers and SQL*Net Drivers

If your precompiler program requires a network driver, note the following:

• Install the required network library on your system. The libraries are located in $ORACLE_HOME/lib.

• The network library $ORACLE_HOME/lib/libsqlnet.a must include the required driver module. The modules are added to this library automatically when you install SQL*Net products.

• $ORACLE_HOME/rdbms/lib/osntab.c

must reference the network driver. If you are using SQL*Net version 2, include osntns in osntab.c.

SQL*Net version 2 drivers

You can use gennttab to create a new ntcontab.c. This is used to exclude SQL*Net version 2 products. As with genosntab, all SQL*Net version 2 drivers will be included unless otherwise specified.

To exclude a SQL*Net version 2 driver, perform the following steps:

1.

Create a new ntcontab.c by entering the following:

$ gennttab > ntcontab.c

2.

Edit the new ntcontab.c file to remove a network driver, or use the

–n switch as with genosntab. For example to exclude the DECnet

Protocol Adapter, enter the following:

$ gennttab –n ITCP > ntcontab.o

3.

Make a new ntcontab.o by entering the following:

$ make ntcontab.o

4.

Archive this new file into libsqlnet.a by entering the following:

$ ar cr $ORACLE_HOME/lib/libsqlnet.a ntcontab.o

5.

Relink any precompiler applications.

Warning: If you create a new ntcontab.c and later re-link other precompiler applications, you could affect other users.

3 – 2 Oracle7 Reference Addendum for HP 9000 Series 700/800

Administering Programmatic Interfaces

System libraries

The Oracle precompiler libraries are named so you can move them to

/usr/lib . This simplifies loading of the precompiler libraries. If you move the precompiler libraries, change the command for linking a program from:

$ cc –o foo.c $ORACLE_HOME/lib/libsql.a

to:

$ cc –o foo.c –lsql

Installing programs and libraries in system directories often requires a system administrator with root privileges. Control and updating may thus become more difficult due to loss of some direct control for the database administrator.

Note: To move files to the /usr/lib directory, ensure that the directory is writeable.

Signals

Oracle uses the following signals for two-task communications. They are installed in a user process when you connect to the database, and are de-installed when you disconnect.

SIGCONT used by the pipe two-task driver to send out-of-band breaks from the user process to the oracle process.

SIGINT

SIGPIPE

SIGTERM used by all two-task drivers to detect user interrupt requests. SIGINT is not caught by oracle; it is caught by the user process. used by the pipe driver to detect end-of-file on the communications channel. When writing to the pipe, if no reading process exists, a SIGPIPE signal is sent to the writing process. SIGPIPE is caught by both the oracle process and the user process. used by the pipe driver to signal interrupts from the user side to the oracle process. This occurs whenever the user presses [CTRL]-c. SIGTERM is not caught by the user process; it is only caught by oracle .

Oracle7 Interfaces 3 – 3

Catching SIGINT osnsui() osncui()

These signals affect Pro*C or other precompiler applications. Users can install one signal handler for SIGCLD (or SIGCHLD) and SIGPIPE when connected to oracle. You can have multiple signal handlers for

SIGINT as long as the osnsui routine is called to set this up. As many signal handlers can be installed as desired for other signals. If you are not connected to oracle, you can have multiple signal handlers.

This section shows how you can set up a signal handler for user interrupts (SIGINT). Use osnsui() and osncui() to register and delete functions which catch user interrupts. Use these functions to register several signal handlers for SIGINT.

This function registers an interrupt handler. The function declaration is as follows:

/* osnsui: OS dependent Network Set User side interrupt */ int osnsui(handlp, astp, ctx) int *handlp; /* handle (also used with osncui()) */ void (*astp); /* pointer to handler function */ char *ctx; /* passed to handler when interrupt occurs */

After calling osnsui(), the function passed in astp is called whenever a user interrupt ([CTRL]-c, for example) occurs. The character pointed to by ctx is passed to the handler as a parameter. Your C program must also supply an integer pointer in handlp, which is filled in by osnsui().

Use the returned handle when you call osncui() (see below) to clear the handler function.

You can register several handler functions using osnsui(); multiple handlers are called in a random order. The function returns zero if successful, or a non-zero code if an error occurs.

This function clears a previously registered interrupt handler. The function declaration is as follows:

/* osncui: OS dependent Network Clear User side interrupt */

3 – 4 Oracle7 Reference Addendum for HP 9000 Series 700/800

int osnsui(handl) int handl; osnsui() */

/* the handle obtained from

The function corresponding to the handle is cleared, and no longer called when an interrupt occurs. The function returns zero if successful, or a non-zero code if an error occurs.

Template for osnsui() and osncui()

The following template shows you how to use osnsui() and osncui() in a

C program:

/* this is the signal handler function */ void sig_handler(c) char c;

{

...

} main(argc, argv) int arc; char **argv;

{ int handle, err;

...

/* set up user interrupt handler */ if (err = osnsui(&handle, sig_handler, (char *)

0))

{

/* if the return value is non–zero, an error has occurred. Do something appropriate here. */

...

}

...

/* clear interrupt handler */ if (err = osncui(handle))

{

/* if the return value is non–zero, an error has

...

occurred. Do something appropriate here. */

Oracle7 Interfaces 3 – 5

}

}

...

The Oracle Call Interface

Under HP–UX, the Oracle Call Interface supports the C language.

☞ Attention: OCI–C++ is not supported on HP–UX.

The Oracle Call Interface is a set of host language calls used with the supported programming language(s) to access data in an Oracle database via kernel calls. Oracle Call Interface calls are described fully in the Programmer’s Guide to the Oracle Call Interfaces.

Oracle precompiler products offer a higher level interface to the Oracle7

Server (one precompiler call is translated to several Oracle Call Interface calls). As the precompilers are simpler to use, and in a few cases offer more functionality than Oracle Call Interface, you may prefer to use the precompilers for some applications.

When compiling and linking C source programs using a customized makefile, remember to use the following switch:

–s strip the symbol tables from the program

Linking OCI-C Programs

The directory $ORACLE_HOME/rdbms/demo contains oracle.mk, a makefile used with the HP–UX make command to compile and link C programs.

The makefile oracle.mk uses the following libraries and modules:

$(ORACLE_HOME)/lib/libsqlnet.a

$(ORACLE_HOME)/lib/libora.a

$(ORACLE_HOME)/lib/osntab.o

$(ORACLE_HOME)/lib/libocic.a

Note: Remember to include all the libraries when creating a customized makefile for OCI-C.

Sample Linking of an OCI-C Program

The sample programs are called

• cdemo1.c

cdemo2.c

3 – 6 Oracle7 Reference Addendum for HP 9000 Series 700/800

Example

Process Structures

• cdemo3.c

cdemo4.c

• cdemo5.c

and are located in the $ORACLE_HOME/rdbms/demo directory.

To compile, and link the sample programs using oracle.mk, change directories to $ORACLE_HOME/rdbms/demo/oracle.mk, and enter the following:

$ make –f oracle.mk <sample_filename>

To execute a sample program, enter the following:

$ ./<sample_filename>

$ ./cdemo4.c

The process structures csredf and ldadef contain information about the user process, such as user ID and login type. They are used by applications connecting to the database, for example, precompiler applications and Oracle Call Interfaces.

The following shows the form of these structures: struct csrdef

{

short csrrc; /* return code:v2 codes,v4 codes neg.*/

unsigned short csrft;

unsigned long csrrpc;

/* function type */

/* rows processed count */

unsigned short csrpeo; offset */

unsigned char csrfc;

unsigned char csrlfl;

/* parse error

/* function code */

/* lda flag to indicate login type*/

unsigned short csrarc; untranslated return code */

unsigned char csrwrn;

unsigned char csrflg;

int

riddef csrcn; csrrid;

/* actual

/* warning flags */

/* error action */

/* cursor number */

/* rowid structure */

Oracle7 Interfaces 3 – 7

OCI data structures

word error code */

unsigned char csrchk; in cursor */ csrose; /* os dependent

/* check byte = CSRCHECK –

/* check byte = LDACHECK – in

LDA */ struct hstdef *csrhst; /* pointer to the hst */

}; typedef struct csrdef csrdef; typedef struct csrdef ldadef; /* lda is the same as a csr */

Two files are supplied with your Oracle distribution that define LDA and CDA structures for Oracle Call Interface programs:

• ocidfn.h

oratypes.h

These files are located in $ORACLE_HOME/rdbms/demo. While the ocidfn.h

file is generic, the oratypes.h file is system-specific and defines the basic Oracle C types. When compiling an Oracle Call Interface program using the C language, make sure the pathnames for both of these files are in the include path.

Use the following values (in bytes) with the ocidfn.h file to determine offsets: size of structure cda_def = 64 size of v2_rc = 2 size of ft = 2 size of rpc = 4 size of peo = 2 size of fc = 1 size of rcs1 = 1 size of rc = 2 size of wrn = 1 size of rcs2 = 1 size of rcs3 = 4 size of struct rid = 16 size of struct rd = 8 size of rid.rd.d1 = 4

3 – 8 Oracle7 Reference Addendum for HP 9000 Series 700/800

size of rid.rd.d2 = 2 size of rid.rd.d3 = 1 size of rid.d4 = 4 size of rid.d5 = 2 size of ose = 4 size of rcsp = 4 size of rcs4 = 20

Dynamic SQL

The Dynamic SQL package, DBMS_SQLNew, is now available with release 7.1 of the Oracle7 Server. You can write stored procedures and anonymous PL/SQL blocks using dynamic SQL. Dynamic SQL statements are not embedded in your source program; they are stored in character strings that are input to, or built by, the program at runtime.

For example, you could use Dynamic SQL to create a procedure that operates on a table whose name is not known until runtime.

For a detailed description of Dynamic SQL, and how to use it, see your

Oracle7 Server Documentation Addendum.

Data Areas and Datatypes

The cursor data area

Refer to the corresponding manual for each language (for example, the

Programmers Guide to the Pro*C Precompiler) for details of the cursor data area.

Optional Parameters

Missing optional parameters are not allowed by C. This means that all call parameters must be specified (see the sample C program).

Missing optional parameters are also not allowed by LPI–COBOL or

LPI–FORTRAN.

If a length parameter is –1, the length is determined by scanning the associated string parameter for a null byte. Missing address parameters may be specified by a –1. In C, the –1 should be cast to the proper type.

Oracle7 Interfaces 3 – 9

Binary integers

Binary integers are 32 bits for HP–UX. They are defined as follows:

Language

C

FORTRAN

COBOL

Type Specifier int;

INTEGER*4

PIC S9(9) COMP.

Short Binary Integers

Short binary integers are 16 bits for HP–UX. They are declared as follows:

Language

C

FORTRAN

COBOL

Type Specifier short;

INTEGER*2

PIC S9(4) COMP.

Restrictions

Debuggers

Precompiler programs and vendor-supplied debuggers may have incompatibilities. We do not guarantee that a program run under the debugger will run the same way under the operating system.

Linking single task

It is not possible to link precompiler executables (for example proc, procob ) single-task to an Oracle kernel that has PL/SQL linked into it.

It must be installed as a two-task application.

Nulls

In this release, it is not possible to SELECT or FETCH nulls into a host variable not associated with an indicator variable when precompiler options are set to mode=oracle and dbms=v7 . The workaround to this restriction is to either set dbms=v6 or to make use of indicator variables

(for example, NVL). For further information, refer to the Programmer’s

Guide to the Oracle Precompilers.

3 – 10 Oracle7 Reference Addendum for HP 9000 Series 700/800

Operating system interference

On HP–UX, certain operating system calls interfere with the functioning of the Oracle precompilers. See the “Signals” section on page 3 – 3 for further information.

Precompiler demonstrations

Because of extra information in some of the precompiler demos, the precompiler may return warning messages such as “Ireclen exceeded”.

Ignore these warning messages.

Precompiler requirements

The following table shows the precompilers available with your distribution and the prerequisites for each precompiler.

Pro*Ada r1.8

Pro*COBOL r1.8

Pro*FORTRAN r1.8

Pro*C r2.2

Product

SQL*Module for C r1.1

Other Requirements

Compiler: For HP-UX 10.0x, Version 5.5.4 of the

AdaWorld compiler from Alsys

Compiler: For HPX 10.0x, Version B.10.25 of the

COBOL/HP–UX compiler.

Compiler: For HP-UX 10.0x, Version 10.00.01.00 for the HP FORTRAN 77 compiler

Compiler: For HP-UX 10.0x, Version A.10.13 of the

Hewlett-Packard C compiler

Software: Oracle Common Libraries and Utilities r7.1

Notes: HP–UX 10.X requires that the C/ANSI C compiler be installed on the system.

Pro*C++ is not supported on the HP 9000.

Compiler: For HP-UX 10.0x, Version A.10.13 of the

Hewlett-Packard C compiler

Software: Oracle Common Libraries and Utilities r7.1

General Hardware Requirements

There are no specific hardware requirements for the Oracle precompilers.

Table 3 – 1 Oracle Precompilers Requirements

Oracle7 Interfaces 3 – 11

Pro*Ada

This section provides HP–UX-specific additions to “Pro*Ada” in

Chapter 8, “Oracle Precompilers and Interfaces”, of the Oracle7

Administrator’s Reference for UNIX.

Topics include:

Administering Pro*Ada

Using Pro*Ada

Administering Pro*Ada

Setting the Ada environment

The Pro*Ada precompiler requires the ALSYCOMP_DIR environment variable to be set to the home directory of the Alsys Ada compiler.. You must include this directory in your PATH statement. To add the Ada compiler directory to your PATH, enter the following:

For the Bourne shell:

PATH=$PATH:$ALSYCOMP_DIR

For the C shell:

$ setenv PATH ”$PATH”:”$ALSYCOMP_DIR”

Linking instructions

The library directory for Pro*Ada

($ORACLE_HOME/precomp/demo/proada) contains the file proada.mk

. In the demo subdirectory, you can use the make command and the proada.mk file to compile and link the demonstration programs.

To link programs, you must set up the environment and then link the programs in the Bourne shell. This is true of both Oracle and user programs.

Step 1. Verify that the ALSYCOMP_DIR environment variable points to the area where the Alsys Ada compiler was installed: echo $ALSYCOMP_DIR

Step 2. Make sure that the directory where the compiler executables were installed ($ALSYCOMP_DIR) is included in your path.

echo $PATH

3 – 12 Oracle7 Reference Addendum for HP 9000 Series 700/800

Step 3. To precompile and compile your sample Ada programs, move to the $ORACLE_HOME/precomp/demo/proada directory and enter:

$ make -f proada.mk simple

Step 4. To execute this sample program, enter:

$ simple

Pro*Ada runtime library

Starting with the V1.3.18 release of Pro*Ada, Pro*Ada runtime library files are provided. These files will be compiled at Pro*Ada installation time. Pro*Ada installation must be run again after each reinstallation or upgrade of the Ada compiler.

Using Pro*Ada

Writing Pro*Ada programs

When you install Pro*Ada, the install script does the following:

• creates the ora_alsys family in the

$ORACLE_HOME/precomp/pubsrc/adalib directory

• appends the alsys library to the ora_alsys family

• makes the alsys library read-write

When you are ready to write Pro*Ada programs, create a library with links to the $ORACLE_HOME/precomp/pubsrc/adalib/alsys library.

Use the create_lib utility to create new application libraries. This utility creates a new library with links to the required ORACLE compilation units.

Refer to the way by which

$ORACLE_HOME/precomp/demo/proada/proada.mk

creates the demo_alsys library. Do not change the access rights on

$ORACLE_HOME/precomp/pubsrc/adalib/alsys or compile user applications into it. If you do, you may be required to reinstall Pro*Ada.

Setting ALSYCOMP_DIR

Alsys Ada requires you to set te ALSYCOMP_DIR environment variable to the home directory of the compiler. You must also add

$ALYSCOMP_DIR to the PATH variable.

Oracle7 Interfaces 3 – 13

Pro*C Version 2

This section provides HP–UX-specific additions to “Pro*C” in Chapter 8,

“Oracle Precompilers and Interfaces”, of the Oracle7 Administrator’s

Reference for UNIX.

Administering Pro*C Version 2

Linking instructions

The library directory for Pro*C

($ORACLE_HOME/precomp/demo/proc) contains the file proc.mk. In the demo subdirectory, you can use the HP–UX make command and the proc.mk

file to compile and link the demonstration program.

Additional Information: You may see messages warning you that the extended options to the HP C compiler are needed.

These options are to ensure compatibility with other C compilers. The lack of these options on your system do not affect the linking process. You can ignore these warnings.

Sample C programs

You have two alternatives for precompiling, compiling, and executing the demonstration programs.

A. Using the shared libraries

If you intend to use Oracle’s client shared library, follow these steps to link the demonstration programs:

Step 5. Set the ORA_CLIENT_LIB environment variable.

$ ORA_CLIENT_LIB=shared

$ export ORA_CLIENT_LIB

Step 6. Move to the $ORACLE_HOME/precomp/demo/proc directory and enter:

$ make -f proc.mk sample n

$ sample n

Where n=1, 2, . . .

B. Not using the shared libraries

Step 1. Move to the $ORACLE_HOME/precomp/demo/proc directory and enter:

3 – 14 Oracle7 Reference Addendum for HP 9000 Series 700/800

$ make -f proc.mk sample n

$ sample n

Using Pro*C Version 2

Error 1043 in Pro*C programs

If you encounter error message 1043 while in your Pro*C program, you have tried to connect to the database with the CONNECT command too many times. Disconnect from the database with the COMMIT WORK

RELEASE command before trying to connect again.

Restrictions

OCI support

On HP–UX the Oracle Call Interface supports the C language only. OCI calls are fully described in the Programmer’s Guide to the Oracle Call

Interface.

ROWID data type

The fixed-length field that stores the ROWID data type must be set to 14 bytes.

Note: The length of a ROWID block component is 8 characters.

The length of a ROWID file component is 4 characters.

Extending defines over one line

The Pro*C precompiler has a problem with defines that are extended over more than one line using the ‘\’ continuation character. The precompiler reports this as an error with the message “Unterminated comment/string”. Oracle Corporation recommends that you avoid continuing defines over more than one line.

Linking samplen program

If the samplen program does not link properly because symbols such as osnttt , osndnt, or osnasy are unresolved, this means one or more of the

SQL*Net drivers has not been installed, or that one or more of the

SQL*Net libraries is missing from the makefile. Correct this problem either by installing the missing drivers or libraries, or by putting references to the SQL*Net driver libraries in the proc.mk file. The references must go in the link line after the libsqlnet.a entry.

Oracle7 Interfaces 3 – 15

Optional parameters

Missing optional parameters are not allowed by Pro*C. All call parameters must be specified.

If a length parameter is -1, the length is determined by scanning the associated string parameter for a null byte. Missing address parameters may be specified by a -1. In C, the -1 should be cast to the proper type.

Pro*COBOL

This section provides HP–UX-specific additions to “Pro*COBOL” in

Chapter 8, “Oracle Precompilers and Interfaces”, in the Oracle7

Administrator’s Reference for UNIX. Topics include:

• Administering Pro*COBOL

Using Pro*COBOL

Pro*COBOL Restrictions

Administering Pro*COBOL

Linking Instructions

To link programs, you must set up the environment and then link the programs in the shell. This is true of both Oracle and user programs.

Setting COBDIR

The HP COBOL/UX compiler requires you to do the following:

• set the COBDIR environment variable to the /cobdir subdirectory under the home directory of the COBOL compiler.

• add the /bin subdirectory of the COBOL compiler to the PATH variable.

For most systems, these locations are /opt/cobol/cobdir and

/opt/cobol/cobdir.

Sample COBOL program

Sample COBOL programs are available in your

$ORACLE_HOME/precomp/demo/procob directory. Before you can run these COBOL programs, you must build your demonstration database using the demobld.sql file, as discussed in “Installing the

3 – 16 Oracle7 Reference Addendum for HP 9000 Series 700/800

SQL*Plus Demonstrations Manually” in the SQL*Plus chapter of the

Oracle7 Administrator’s Reference for UNIX.

To precompile and compile the programs, follow these steps:

Step 1. Verify that the COBDIR environment variable points to the cobdir subdirectory under the area where the COBOL compiler was installed: echo $COBDIR

Step 2. Make sure that the /bin subdirectory under the area where the COBOL compiler executables were installed is included in your path.

echo $PATH

Step 3. To precompile and compile your sample COBOL programs, move to the $ORACLE_HOME/precomp/demo/procob directory and enter:

$ make -f procob.mk sample n

Where n=1, 2, . . .

Step 4. To execute this sample program, enter:

$ sample n

Using Pro*COBOL

COBOL runtime system rtsora

The installation procedure for Pro*COBOL builds a modified COBOL runtime system with Oracle entry points called rtsora. It places this in the $ORACLE_HOME/bin directory.

There are two methods for generating a COBOL program, either by generating dynamically loadable generated code (.gnt files) and running it through the Oracle runtime program rtsora by entering the following:

$ make –f procob.mk sample1.gnt

$ rtsora sample1.gnt

or, by generating a standalone program, for example:

$ make –f procob.mk sample1

$ sample1

Oracle7 Interfaces 3 – 17

To create a new runtime system, change directories to

$ORACLE_HOME/precomp , and enter the following:

$ make –f ins_precomp.mk rtsora

Copy the executable rtsora to the $ORACLE_HOME/bin directory. Use rtsora instead of cobrun on runtime systems with Oracle libraries.

The makefile can build both fully linked modules and COBOL intermediate code to be used with a COBOL runtime system with Oracle calls. A runtime system with Oracle calls is distributed with this release, but to add any new SQL*Net Protocol Adapters, or to have the runtime system support your own calls as well as Oracle calls, alter the runtime system.

Pro*COBOL Restrictions

FORMAT Option

The FORMAT precompiler option is not available with this COBOL compiler.

Pro*FORTRAN

This section provides HP–UX-specific additions to “Pro*FORTRAN” in

Chapter 8, “Oracle Precompilers and Interfaces”, in the Oracle7

Administrator’s Reference for UNIX.

Administering Pro*FORTRAN

Linking Instructions

To link programs, set up the environment and link the programs in the shell. This is true of both Oracle and user programs.

System libraries

The Oracle precompiler libraries are named so that they can be easily moved to /usr/lib if desired. This simplifies the loading step somewhat.

Installing programs and libraries in system directories often requires a system administrator with root privileges. Control and updating may become more difficult due to loss of direct control for the database administrator.

3 – 18 Oracle7 Reference Addendum for HP 9000 Series 700/800

The /usr directory must be writeable to do this. It may be read-only by default. If the /usr directory is read-only by default, have your system manager perform the move.

Using Pro*FORTRAN

Sample FORTRAN program

To precompile, compile, and execute the demonstration programs, follow these steps:

Step 1. Move to the $ORACLE_HOME/preccomp/demo/profor directory and enter:

$ make -f profor.mk sample n

Where n=1, 2, . . .

Step 2. To execute this sample program, enter:

$ sample n

To run the demonstration program sample9.pro in the

$ORACLE_HOME/profor/demo directory successfully, first run

$ORACLE_HOME/proc/demo/calldemo.sql

using scott/tiger. This creates the “calldemo” package which all sample9 samples need for all the precompilers.

SQL*Module for C

This section provides HP–UX-specific additions to “SQL*Module for

Ada and C” in Chapter 8, “Oracle Precompilers and Interfaces”, in the

Oracle7 Administrator’s Reference for UNIX. Topics include:

• Administering SQL*Module for C

• Using SQL*Module for C

Administering SQL*Module for C

Linking Instructions

To link programs, set up the environment and then link the programs in the shell. This is true of both Oracle and user programs.

Oracle7 Interfaces 3 – 19

Using SQL*Module for C

To run a demonstration of SQL*Module for C:

$ cd $ORACLE_HOME/mod/demo/c

$ make –f moddemoc.mk all

3 – 20 Oracle7 Reference Addendum for HP 9000 Series 700/800

C H A P T E R

4

SQL*Net Version 2

T his chapter presents HP–UX-specific information that complements the section for each SQL*Net version 2 product in Chapter 9, “SQL*Net

Version 2”, in the Oracle7 Administrator’s Reference for UNIX.

The topics covered in this chapter are:

SQL*Net Version 2 Overview

Oracle APPC/LU6.2 Adapter

Oracle Names Server

Oracle SPX/IPX Protocol Adapter

SQL*Net Version 2 4 – 1

SQL*Net Version 2 Overview

Topics include:

Oracle Protocol Adapters

SQL*Net Version 2 Files and Utilities

Oracle Protocol Adapters

Default Adapter

The IPC protocol adapter, which is implemented on top of UNIX

Domain Sockets, is used for local connections to the multi-threaded server (MTS). The BEQ protocol adapter, implemented on top of UNIX pipes, cannot be configured. The BEQ protocol adapter spawns and connects processes via UNIX pipes.

Out-of-Band Breaks

Out-of-band breaks are not supported with SQL*Net version 2. You cannot cancel a query over a SQL*Net version 2 connection by entering

[CTRL]-c.

SQL*Net Version 2 Files and Utilities

TNS Listener

This step is only necessary if you have a SQL*Net version 1 database link to a SQL*Net version 1 server that is contacted by a SQL*Net version 2 client. Set the TNS listener process setuid root for the

SQL*Net version 2 listener on the intermediate node.

As root, set the TNS listener process setuid root:

# cd $ORACLE_HOME/bin

# chown root tnslsnr

# chmod 4751 tnslsnr

4 – 2 Oracle7 Reference Addendum for HP 9000 Series 700/800

Oracle APPC/LU6.2 Protocol Adapter

Using Oracle APPC/LU6.2 Protocol Adapter

Specifying the APPC/LU6.2 address

Once APPC/LU6.2 and the Oracle APPC/LU6.2 protocol adapter are installed for your system, use the APPC/LU6.2-specific parameters within the connect descriptors in the tnsnames.ora file to identify the nodes within the APPC/LU6.2 community.

The APPC/LU6.2 protocol adapter parameters are defined in a connect descriptor for each node. Each connect descriptor contains several keyword=value pairs. The APPC/LU6.2-specific keywords can be entered in any order within the connect descriptor. The syntax for the

APPC/LU6.2 protocol adapter connection is:

)

(ADDRESS=

[(COMMUNITY=community_name)]

(PROTOCOL=LU62)

(TP_NAME= transaction_program_name)

(LU_NAME= logical_unit_name)

(LOCAL_LOOKUP= pointer) where: community_name specifies the protocol-specific community name when you also have the MultiProtocol Interchange product. The community name should be unique on the network and identify the community by a name that is indicative of the community. The name, however, should not contain the protocol name, in case multiple networks are integrated using the MultiProtocol Interchange and several community names use the same protocol.

protocol transaction_ program_name logical_unit_ name specifies the protocol adapter to be used; the value can be uppercase or lowercase. For APPC/LU6.2, the value is lu62. specifies the name of the transaction program to run at the target or the transaction program name to use when “listening” for incoming connection requests.

This value is required.

in tnsnames.ora, it specifies the name for the remote partner LU. When this keyword appears in

SQL*Net Version 2 4 – 3

pointer listener.ora

, it specifies the name of the local LU.

LU_NAME may be ignored on many platforms or overridden by the values in other parameters. Due to the requirements of some APPC/LU6.2

implementations, LU_NAME should always specify the fully qualified LU name (that is, netid.lu_name

). specifies a pointer to the protocol.ora file which contains the operating system-specific address parameters. The pointer is formed by prefixing the value with “LOCAL_LOOKUP.” The

LOCAL_LOOKUP keyword can be replaced by the operating-specific parameters (which makes the

APPC/LU6.2 ADDRESS connect descriptor non-global). The LOCAL_LOOKUP keyword is required when the APPC/LU6.2 connect descriptor does not contain the operating-specific address parameters.

HP–UX address parameters

Since there is no standard APPC API, the information needed to contact a remote partner varies by operating system and implementation. These values can be specified in one of the following ways:

• in the protocol.ora file, which is pointed to by the

LOCAL_LOOKUP parameter in the tnsnsames.ora file

• in the tnsnsames.ora file, within the APPC/LU6.2 address parameters in place of the LOCAL_LOOKUP parameter

In some cases, it may be easier to include these address parameters in tnsnames.ora

rather than creating and managing an additional file.

Note: If your communications use listener.ora, you are using a multi-threaded server. If you prefer to use the SQL*Net configuration tool to create your tnsnames.ora file, then use the LOCAL_LOOKUP parameter and specify the platform-specific parameters in the protocol.ora

file.

A set of LU6.2 platform–specific parameters must be specified for each different remote partner node. These parameters are normally specified in the PROTOCOL.ORA file, but can also be specified in the

TNSNAMES.ORA file (see previous section).

☞ Attention: HP–UX provides APPC support.

4 – 4 Oracle7 Reference Addendum for HP 9000 Series 700/800

The syntax of the LU6.2 platform–specific address parameters for

HP–UX specified in the PROTOCOL.ORA file is as follows:

LOCAL_LOOKUP.

pointer=(ADDRESS=

(PROTOCOL=LU62)

[(PARTNER_LU_NAME= partner LU name)]

[(LOCAL_LU= alias name of local LU)]

[(PARTNER_LU_LOCAL_ALIAS= local alias for partner LU)]

[(MODE=mode name)] where: pointer

PARTNER_LU_NAME or

PLU_LA

LOCAL_LU or LLU

PARTNER_LU_LOCAL_

ALIAS or PLU_LA

Specifies the pointer specified by the

LOCAL_LOOKUP parameter in the

TNSNAMES.ORA file.

Specifies the LU name of the partner. If present, this overrides the LU_NAME specified in TNSNAMES.ORA. Depending on the environment and the capabilities of the partner, PARTNER_LU_NAME may need to be a fully qualified LU name such as. netid.lu_name. A full qualified LU name always works correctly.

This parameter is required if LU_NAME or

PARTNER_LU_LOCAL_ALIAS are not specified.

Specifies the alias name of the local LU. If present, it overrides the value of

LU_NAME in LISTENER.ORA.

LOCAL_LU may be required in some cases and optional in others, depending on the environment. In the APPC environment, or where the default is sufficient, LOCAL_LU can often be omitted. If omitted, the default

(defined in the NDF file) is used. Note that

LOCAL_LU is a defined alias and may not be the same as the actual LU name. It is a good idea to define an alias that is the same as the actual name to avoid confusion.

Specifies the locally defined alias for the partner LU. If present, this overrides the

LU_NAME and PARTNER_LU_NAME parameters.

SQL*Net Version 2 4 – 5

The PARTNER_LU_LOCAL_ALIAS provides a level of indirection from the actual partner LU name. This may be useful for the non–APPC environment or when the remote partner node is a LEN node.

This parameter is required if LU_NAME or

PARTNER_LU_NAME is not specified.

MODE Specifies the mode to use in the allocation request. Can be any 8–character string.

Both partners in a connection must use the same mode. If omitted, a name of all blanks or the defined default is used. Since the need for this parameter depends on the target platform, this parameter is optional.

Here is an example of platform–specific parameters for HP–UX as specified in a PROTOCOL.ORA file that defines two different LU6.2

remote partners in the network:

LOCAL_LOOKUP.HQHW202 = (ADDRESS=

(PROTOCOL=LU62)

(PARTNER_LU_NAME=ORACLE.HQHW202)

(MODE=ORAPLU62)

(LOCAL_LU=HQHW102)

)

LOCAL_LOOKUP.HQHW102 = (ADDRESS=

(PROTOCOL=LU62)

(MODE=ORAPLU62)

(LOCAL_LU=HQHW102)

)

Here is an example of platform–specific parameters for HP–UX as specified in the TNSNAMES.ORA file that defines a LU6.2 remote partner in the network:

APPCRS6 = (DESCRIPTION=

(ADDRESS=

(PROTOCOL=LU62)

(PARTNER_LU_NAME=ORACLE.HQHW201)

(TP_NAME=tphp)

(MODE=ORAPLU62)

(LOCAL_LU=HQHW101)

)

(CONNECT_DATA=

(SID=HSW)

4 – 6 Oracle7 Reference Addendum for HP 9000 Series 700/800

)

)

Maintaining security

If, for security reasons, you want to conceal the field net_name in the

SNAplus configuration record, you can do the following:

• set the PLU_LA parameter to a fully qualified LU name

• define this symbolic destination name with the SNAplus snapconfigure tool

Configuring an HP–UX Server to Listen for LU6.2 Connection Requests

Currently the use of TNSLSNR is not supported under HP–UX.

• The SNAplus Snapconfig tool should be used to define the transaction.

• All listening transactions are started at the server using the

SNAplus Snapmanage tool.

Note: The motif version of this tool is named xsnapmanage.

Parameters to Define for a Listening Transaction Program

You can use the information in this section to define a listening transaction, or if you prefer, follow the step–by–step instructions in the next section.

You need to define the following elements in a listening transaction with the snapconfig tool .

link(s) node(s)

A link defines SNAplus’s physical connection to the SNA network.

the area in the host which routes and controls data flow through the network.

remote LU the LU (logical unit) on the other end of the session the LU on the user end of the session local LU

Invocable TP an APPC TP (transaction program) started in response to a request from another TP.

You also need to define the LU6.2 connection descriptors in the

TNSNAMES.ORA file for HP APPC

SQL*Net Version 2 4 – 7

Note: How to define these elements is described in the following section.

Sample Listening Transaction Program

Node: NODE1

Mode: ORALU62

Local Partner LUs: ORACLILU (client LU)

ORASRVLU (server LU)

Invocable TP: ORASRVTP exe:/home/oracle714/bin/oracle

par: hpuxdbparm (see tnsnames.ora)

env: ORACLE_HOME=/home/oracle714

ORACLE_SID=HPUX10

Note: The TNS_ADMIN environment variable does not need to be specified in the Invokable TP configuration if you assume the default location of tnsnames.ora in

$ORACLE_HOME/network/admin .

Defining a Transaction Program

You can configure the HP–UX server with the SNAplus snapconfig tool.

Step 1. Invoke the SNAplus snapconfig tool.

$ snapconfig

Note: To use this tool, the PATH variable must include the following: /opt/sna/bin/snapmanage.

Attention: These steps are performed by the system or network administrator at root level.

Step 2. Open the SNAplus snapconfig tool.

Step 3. Define LINK

• Select ”Services”

• Select ”Links”

• Use the template link [NEW] to define the linkname and linktype

(SDLC, QLLC, or Token Ring)

4 – 8 Oracle7 Reference Addendum for HP 9000 Series 700/800

Step 4. Define CONNECTION

• Select ”Services”

Select ”Connections”

Use the template link {NEW} and enter the connection type

(SDLC, QLLC, or Token Ring), the linkrole, and type of computer

(host/peer) at the other end of the connection

Step 5. Define Node(s)

• Select ”APPC”

Select ”Node(s)”

Enter the node name (for example, ORAPLU62) and session limit

Step 6. Define Remote LU’s

• Select ”APPC”

• Select ”Remote LU(s)

• enter the full network name (for example, oracle.hq1.1)

Define the type of Session (for example, Parallel)

• Define session level security

Step 7. Define Local LU

Select ”APPC”

Select ”Local LU”

• Enter the full network name (for example, oracle.hq1.1)

Define session limit

Define other partner LU names

Step 8. Define the Invocable TP

• Select ”APPC”

Select ”Invocable TP”

Define the following fields;

– the TP name (for example, tphp)

Note: This value is the name of the transaction and appears as the TP_NAME address parameter of the connection descriptor

SQL*Net Version 2 4 – 9

Example

– the oracle executable file path (for example,

/opt/oracle/bin/oracle)

– the parameter which is the name for the connection descriptor (for example, hpuxparam)

– the timeout value for loading TP

Note: This value must be expressed in seconds

– the string that defines the environment variables for

ORACLE_HOME (/home/oracle) and ORACLE_SID (HSW) separated by a |

Example /home/oracle|HSW

Note: HP–UX SNAplus limits this string to 64 characters or less.

Step 9. Save the above definitions and exit the SNAplus snap

Configuration tool.

Step 10. Define the parameter in TNSNAMES.ORA that is passed to the ORACLE7 program when it is started.

$ hpuxparam=(DESCRIPTION=

(ADDRESS= (PROTOCOL=LU62)

(TP_NAME = tphp))

(CONNECT_DATA = (SID = HSW))

Step 11. Open the SNAplus Snapmanage tool.

• Select ”Services”

• Select the local node and connection name that you defined earlier

• Select ”Start” to startup the service.

Additional Information: For more information, consult the Hewlett–Packard manuals on SNAplusLink.

4 – 10 Oracle7 Reference Addendum for HP 9000 Series 700/800

Oracle Names Server

Using Oracle Names Server

Configuration files

The configuration files required for the Names Server installation must be generated using the Oracle Network Manager release 2.1.

Oracle SPX/IPX Protocol Adapter

Restrictions

Additional Information: For networking software requirements, see Appendix A, “Requirements”, of the ICG.

SQL*Net Version 2 4 – 11

4 – 12 Oracle7 Reference Addendum for HP 9000 Series 700/800

C H A P T E R

5

Oracle7 Server

Documentation Set

Addendum

T his chapter contains HP–UX-specific information referenced by guides in the Oracle7 Server documentation set. This chapter is not intended for use on its own. It is an addendum to the Oracle7 Server documentation set.

• Oracle7 Server Administrator’s Guide

Oracle7 Server Application Developer’s Guide

Oracle7 Server Concepts

Oracle7 Parallel Server Concepts and Administration

Oracle7 Server Distributed Systems Volume 1: Distributed Data

• Oracle7 Server Distributed Systems Volume 2: Replicated Data

Oracle7 Server Migration

Oracle7 Parallel Server Concepts and Administration

Oracle7 Server Reference

Oracle7 Server SQL Reference

Oracle7 Server Documentation Set Addendum 5 – 1

Oracle7 Server Administrator’s Guide

This section provides HP–UX-specific information to supplement

Appendix A in the Oracle7 Server Administrator’s Guide. These topics are listed alphabetically.

Calculating Cluster Size

Use the following figures for calculating cluster size using the formula in the Oracle7 Server Administrator’s Guide:

Type fixed header size variable transaction header row directory

Table 5 – 1 Cluster Size Values

Size

68 bytes

24* INITRANS value for the table

4 bytes per row of a clustered table

Calculating Database Limits

For the equation given in the Oracle7 Server Administrator’s Guide, use the following figures:

Type database file size database files instances locks

MAXEXTENTS

Size

5 MB

255 or the value of the DB_FILES parameter in the init.ora file

255

100 (DML_LOCKS parameters value)

57 for a 1KB block size, 121 for a 2 KB block size, 249 for a 4 KB block size, and

505 for an 8 KB block size

255 redo log files

Table 5 – 2 Database Size Values

Data files are located in $ORACLE_HOME/dbs by default.

5 – 2 Oracle7 Reference Addendum for HP 9000 Series 700/800

Calculating Index Size

Use the following figures for calculating the size required by an index using the formula in the Oracle7 Server Administrator’s Guide:

Type fixed header size variable transaction header entry header

Table 5 – 3 Index Size Values

Size

113 bytes

24* INITRANS value for the index

5 bytes

Oracle7 Server Application Developer’s Guide

This section provides HP–UX-specific information to supplement

Chapter 9, “Using Database Triggers”, and Chapter 11, “Managing

Dependencies Among Schema Objects” in the Oracle7 Server Application

Developer’s Guide.

All rdbms SQL scripts are located in the rdbms/admin directory.

Oracle7 Server Concepts

This section provides HP–UX-specific information to supplement

Oracle7 Server Concepts. These topics are listed in alphabetical order.

Authentication and Privileges

User authentication, administrator privileges, database roles, and other security issues are discussed in Chapter 5, “Administering Oracle7 on

UNIX” in the Oracle7 Administrator’s Reference for UNIX.

Archiver Process

Archiving is discussed in Chapter 4, “Backing Up and Recovering

Oracle7 on UNIX”, in the Oracle7 Administrator’s Reference for UNIX.

Oracle7 Server Documentation Set Addendum 5 – 3

Asynchronous I/O

Multiple Database Writers

Multiple database writers (DBWRs) are discussed in “I/O Types” in

Chapter 1.

Oracle7 Server Distributed Systems Volume 1: Distributed Data

This section provides HP–UX-specific information to supplement

Chapter 7, “Application Development”, in the Oracle7 Server Distributed

Systems Volume 1: Distributed Data. These topics are listed in alphabetical order.

Distributed Transactions

Distributed transactions and related locking issues are discussed in

“Task 7: Tuning Resource Contention for Oracle Parallel Server” in

Chapter 3, “Tuning Oracle7 for UNIX” in the Oracle7 Administrator’s

Reference for UNIX.

The init.ora File

The init.ora file is discussed in “Initialization Parameters” on page

1 – 24 in this guide, and in Chapter 1, “Planning a Complex Database on

UNIX”, in the Oracle7 Administrator’s Reference for UNIX.

Memory Requirements

Memory requirements are discussed in “Task 3: Tuning Memory

Management” in Chapter 3, “Tuning Oracle7 for UNIX” in the Oracle7

Administrator’s Reference for UNIX.

XA Libraries

Oracle*XA support for shared libraries is discussed in “Shared Libraries and Shared Objects Support” in Chapter 8, “Oracle Precompilers and

Interfaces”, in the Oracle7 Administrator’s Reference for UNIX.

5 – 4 Oracle7 Reference Addendum for HP 9000 Series 700/800

Library Names

Library naming conventions are discussed in Chapter 2, “Oracle7

Architecture on UNIX”, in the Oracle7 Administrator’s Reference for UNIX.

The README.doc File

The README.doc file located in the $ORACLE_HOME/xa/doc directory describes changes, bugs, or restrictions in the Oracle XA

Library since the last version. The README.doc file is an outline supplement to the printed documentation.

XAVIEW.SQL Location

The XAVIEW.SQL script used to manually create the V$XATRANS$ view is located under $ORACLE_HOME/xa/admin/xaview.sql.

Oracle7 Server Distributed Systems Volume 2: Replicated Data

This section provides HP–UX-specific information to supplement

Oracle7 Server Distributed Systems Volume 2: Replicated Data.

Advanced Replication Option

To install a separate feature, such as the Advanced Replication Option, see the Oracle7 Installation Guide for HP 9000 Series 700/800 . HP 9000

Series 700/800.

Oracle7 Server Migration

This section provides HP–UX-specific information to supplement the

Oracle7 Server Migration.

All HP–UX-specific migration tasks are discussed in Chapter 8,

“Migrating to Oracle7”, in the Oracle7 Installation Guide for HP 9000

Series 700/800 . HP 9000 Series 700/800.

Oracle7 Server Documentation Set Addendum 5 – 5

MAXEXTENTS

Calculate the MAXEXTENTS parameter from the block size on your system:

Block

Size

2 KB

Number of Extents

121

Platforms and Uses for Block Size

(most can be set larger)

Sun, Hewlett-Packard, Sequent, most UNIX platforms

Table 5 – 4 Block Size and Number of Extents

Memory Requirements

Memory requirements are discussed in “Disk Space and Memory

Requirements” in Chapter 1, “Features and Requirements”, in the

Oracle7 Installation Guide for HP 9000 Series 700/800 .

Oracle7 Installer

The Oracle7 Installer method of performing migration is discussed in the Oracle7 Installation Guide for HP 9000 Series 700/800 .

SGA

Shared memory segment size and the SGA are discussed in

“Tip 1: Hold the SGA in a Single Shared Memory Segment” in Chapter

3, “Tuning Oracle7 for UNIX”, in the Oracle7 Administrator’s Reference for

UNIX.

Oracle7 Parallel Server Concepts and Administration

This section provides HP–UX-specific information to supplement

Chapter 19, “Administering Multiple Instances”, in Oracle7 Parallel

Server Concepts and Administration.

User authentication, administrator privileges, database roles, and other security issues are discussed in Chapter 5, “Administering Oracle7 on

UNIX” in the Oracle7 Administrator’s Reference for UNIX.

5 – 6 Oracle7 Reference Addendum for HP 9000 Series 700/800

Oracle7 Server Reference

This section provides HP–UX-specific information to supplement the

Oracle7 Server Reference.

Initialization Parameters

Initialization parameters and their default values are discussed in

“Initialization Parameters” on page 1 – 24.

SQL Scripts

All rdbms SQL scripts are located in the rdbms/admin directory.

Oracle7 Server SQL Reference

This section provides HP–UX-specific information to supplement

Appendix C in the Oracle7 Server SQL Reference. These topics are listed alphabetically.

CREATE CONTROLFILE Parameters

The values of the following parameters determine the size of control files for a database.

Parameter

MAXDATAFILES

MAXINSTANCES

MAXLOGFILES

MAXLOGMEMBERS

MAXLOGHISTORY

Default Value

30

63

16

2

100

Table 5 – 5 CREATE CONTROLFILE Parameter Values

Maximum Value

1022

63

255

5

63000

CREATE TRIGGER Parameters

All rdbms SQL scripts are located in the rdbms/admin directory.

Oracle7 Server Documentation Set Addendum 5 – 7

STORAGE Parameters

The maximum value for these parameters is any positive integer.

• INITIAL

NEXT

PCTINCREASE

• OPTIMAL

Oracle7 Server Utilities

This section provides HP–UX-specific information to supplement

Oracle7 Server Utilities.

Error Messages

HP–UX-specific error messages are documented in Appendix A, “Oracle

Messages on UNIX”, in Oracle7 Administrator’s Reference for UNIX.

I/O Buffers

I/O performance problems are discussed in “Task 3: Tuning Memory

Management” and “Task 4: Tuning Disk I/O” in Chapter 3, “Tuning

Oracle7 for UNIX”, in the Oracle7 Administrator’s Reference for UNIX.

Import

Import concerns and the Oracle7 Installer are discussed in Chapter 9,

“Import/Export”, in the Oracle7 Installation Guide for HP 9000 Series

700/800 .

Naming Conventions

Oracle7 file naming conventions are discussed in Chapter 2, “Oracle7

Architecture on UNIX”, in the Oracle7 Administrator’s Reference for UNIX.

SQL Scripts

All rdbms SQL scripts are located in the rdbms/admin directory.

5 – 8 Oracle7 Reference Addendum for HP 9000 Series 700/800

A P P E N D I X

A

Oracle ConText Option

Administration

T his appendix contains information about using Oracle ConText

Option.

The topic covered in this appendix is:

• Using Oracle ConText Option

Oracle ConText Option Administration A – 1

Using Oracle ConText Option

The following section provides usage information for Oracle ConText

Option.

Setting TEXT_ENABLE for the Current Session

The TEXT_ENABLE initialization parameter can be set to enable single-step queries at the session level. To set TEXT_ENABLE for the current session:

1.

Start up the database.

2.

Log in to SQL*Plus as SYS and issue the following command: alter session set text_enable = true

3.

Start one or more ConText servers with the Query (Q) personality.

Loading Proper Names Table for Lingusitic Services

The proper names table is required only for enabling case-sensitivity for Oracle ConText Option Linguistic Services

See Also: Chapter 5, “Linguistic Services Concepts,” in the

Oracle7 ConText Option Administrator’s Guide.

The list of proper nouns for CTX_PROPER_NAME is provided in an export file, ctxprop.dmp, located in $ORACLE_HOME/ctx/admin.

☞ Attention: Once imported, the CTX_PROPER_NAME table and the Oracle index for the table are quite large (nearly 140

MB). To ensure the table is imported successfully, the default tablespace for CTXSYS should be large enough to accommodate both the table and its Oracle index, as well as the other Oracle ConText Option database objects.

To import ctxprop.dmp into CTX_PROPER_NAME, change directories to $ORACLE_HOME/ctx/admin and use the import utility:

$ imp ctxsys/ ctxsys_passwd FILE=ctxprop.dmp FULL=y\

IGNORE=y COMMIT=y BUFFER= number_of_bytes

A larger buffer size enables faster importing of data. A buffer size of at least 1 MB is suggested for HP–UX.

See Also: Chapter 2, “Import,” in Oracle7 Server Utilities.

A – 2 Oracle7 Reference Addendum for HP 9000 Series 700/800

Index

A address space, 1 – 3 allocating, free space, 1 – 10

ALYSCOMP_DIR, 3 – 12 archiving redo log files, destination, 1 – 27 asynchronous I/O, initialization parameters,

1 – 26

AUDIT_FILE_DEST parameter, 1 – 25

B

BACKGROUND_DUMP_DEST parameter,

1 – 25

BEQ protocol adapter, 4 – 2

Binary integers, 3 – 10 block size, 1 – 8 blocks, initialization parameters, 1 – 28 buffer cache size

See also cache size dynamic sizing with HP–UX10.X. See cache size

C

C language, SQL*Module for, 3 – 19

C/ANSI C compiler, must be installed on system, 3 – 11 cache hit ratio, 1 – 17 cache size, dynamic sizing with HP–UX 10.X,

1 – 23

CCF_IO_SIZE parameter, 1 – 28 cluster, estimating size, 5 – 2

COBDIR environment variable, 3 – 16

COBOL, Pro*COBOL, 3 – 16

COMMIT_POINT_STRENGTH parameter,

1 – 25 community_name, Oracle APPC/LU6.2

specification, 4 – 3

ConText Option. See Oracle ConText Option control files, parameters, 5 – 7

CONTROL_FILES parameter, 1 – 25 conventions used, ii

CPU, tuning for Parallel Server, 1 – 12 csrdef, process structure, 3 – 7

Cursor data area, 3 – 9

D

Data areas, 3 – 9 types, 3 – 9 database fragmentation, 1 – 10 limits, 5 – 2 datablocks, associating with instances, 1 – 9

DB_BLOCK_SIZE parameter, 1 – 25, 1 – 29

DB_FILE_MULTIBLOCK_READ_COUNT parameter, 1 – 25, 1 – 29

DB_FILE_SIMULTANEOUS_WRITES parameter, 1 – 25

Index – 1

DB_FILES parameter, 1 – 25

DB_WRITERS parameter, 1 – 26

DBMS_SQLNew, Dynamic SQL package, 3 – 9 debuggers, 3 – 10 disk, monitoring performance, 1 – 7 disk management with HP–UX 10.X, 1 – 18 disk quotas, 1 – 3

DISTRIBUTED_TRANSACTIONS parameter,

1 – 25

Dynamic SQL, 3 – 9

E environment variables, ORACLE,

ALSYCOMP_DIR, 3 – 12 errors, precompiler demonstrations, 3 – 11 extents, automatic allocation, 1 – 9

F file size, 1 – 8

FORTRAN, Pro*FORTRAN, 3 – 18 fragmentation, reducing database, 1 – 10 free space lists associating with instances, 1 – 9 locating space, 1 – 9

G

GC_DB_LOCKS parameter, 1 – 14

GC_FILES_TO_LOCKS parameter, 1 – 14 gennttab, 3 – 2

GlancePlus/UX, 1 – 5

GlancePlus/UX tool, 1 – 5

H

HP MeasureWare, 1 – 5

HP PerfView, 1 – 5

HP–UX, measuring system performance, 1 – 6

I

I/O, balancing, 1 – 16 importing, ConText Option tables, A – 2 index size, calculating, 5 – 3

INIT_SQL_FILES parameter, 1 – 25

INITIAL parameter, 5 – 8 initialization parameters defaults, 1 – 24 list of, 1 – 24

SHOW PARAMETERS command, 1 – 24

TEXT_ENABLE, A – 2 inserts, locating free space, 1 – 9 instance, associating with datablocks, 1 – 9

INSTANCE_NUMBER parameter, 1 – 25

Integers, 3 – 10 short, 3 – 10 iostat tool, 1 – 5

IPC protocol adapter, 4 – 2

L latching, initialization parameters, 1 – 29 ldadef, process structure, 3 – 7 libsqlnet.a, 3 – 2 and driver module, 3 – 2 limits, resource, 1 – 3

Linking

OCI and C programs, 3 – 6 precompilers, 3 – 10

Pro*C V2, 3 – 15 locks, tuning for Parallel Server, 1 – 13 log files, initialization parameters, 1 – 27

LOG_ARCHIVE_BUFFER_SIZE parameter,

1 – 25

LOG_ARCHIVE_BUFFERS parameter, 1 – 25

LOG_ARCHIVE_DEST parameter, 1 – 25,

1 – 27

LOG_ARCHIVE_FORMAT parameter, 1 – 25

LOG_BUFFER parameter, 1 – 25, 1 – 28

Index – 2

LOG_CHECKPOINT_INTERVAL parameter,

1 – 25, 1 – 27

LOG_CHECKPOINT_TIMEOUT parameter,

1 – 27

LOG_FILES parameter, 1 – 28

LOG_SIMULTANEOUS_COPIES parameter,

1 – 29

LOG_SMALL_ENTRY_MAX_SIZE parameter,

1 – 25 logical reads, 1 – 17 logical volumes backing up, 1 – 22 setting up, 1 – 20 using, 1 – 19 logical_unit_name, Oracle APPC/LU6.2

specification, 4 – 4

M

Makefiles, Pro*C, 3 – 6

MAX_COMMIT_PROPAGATION_DELAY parameter, 1 – 30

MAXDATAFILES parameter, 5 – 7

MAXEXTENTS parameter, 1 – 9

MAXINSTANCES parameter, 5 – 7

MAXLOGFILES parameter, 1 – 28, 5 – 7

MAXLOGHISTORY parameter, 5 – 7

MAXLOGMEMBERS parameter, 5 – 7 memory estimating usage, 1 – 2 shared, 1 – 3 virtual, 1 – 2

MINEXTENTS parameter, 1 – 9

Missing parameters, 3 – 9 monitor latch display, 1 – 30 monitoring performance, tools, 1 – 5

MTS_MAX_DISPATCHERS parameter, 1 – 25

MTS_MAX_SERVERS parameter, 1 – 25, 1 – 31

MTS_SERVERS parameter, 1 – 31 multi–threaded server, initialization parameters, 1 – 31

N

NEXT parameter, 5 – 8

NLS_LANGUAGE parameter, 1 – 25

NLS_TERRITORY parameter, 1 – 25 ntcontab.c, 3 – 2 ntcontab.o, 3 – 2

O

OCI, 3 – 6 customized makefile for C, 3 – 6 data structures, 3 – 8 linking C programs, 3 – 6 process structures, 3 – 7 sample C program, 3 – 7 supported languages, 3 – 6

OCI–C, sample linking, 3 – 6

OPEN_CURSORS parameter, 1 – 25 operating system interference, 3 – 11

OPTIMAL parameter, 5 – 8

Oracle, memory usage, 1 – 3

Oracle APPC/LU6.2 Protocol Adapter address parameters, 4 – 4 specifying address, 4 – 3 updates, 4 – 3

Oracle Call Interface. See OCI

Oracle ConText Option, A – 1

ORACLE environment variables,

ALSYCOM_DIR, 3 – 12

Oracle Names Server configuration files, 4 – 11 updates, 4 – 11

Oracle SPX/IPX Protocol Adapter, updates,

4 – 11

Oracle Worldwide Technical Support, v how to contact in Europe, v how to contact in U.S.A., v

Oracle*XA support, 5 – 4

Oracle7 Server, tuning, 1 – 8

OS_AUTHENT_PREFIX parameter, 1 – 25

Index – 3

osncui, 3 – 4 template, 3 – 5 osnsui, 3 – 4 template, 3 – 5 osntab.c, 3 – 2 out–of–band breaks, protocol adapters, 4 – 2

P

Parallel Server contention for resources, 1 – 11 initialization parameters, 1 – 30 parameters, optional, 3 – 9

PCTINCREASE parameter, 5 – 8 performance monitoring, 1 – 5 monitoring tools, 1 – 5

Parallel Server, 1 – 11 partitioned data, 1 – 9 table striping, 1 – 10

PL/SQL, 2 – 2 pointer, Oracle APPC/LU6.2 specification,

4 – 4

PRE_PAGE_SGA parameter, 1 – 31

Precompiler, requirements, 3 – 11

Precompilers demonstration error messages, 3 – 11 fetching nulls, 3 – 10 linking, 3 – 10 selecting nulls, 3 – 10 precompilers, list of, 3 – 1

Pro*Ada requirements, 3 – 11 updates, 3 – 12

Pro*C, sample programs, 3 – 14

Pro*C R1.6, linking instructions, 3 – 14

Pro*C V2 and SQL*Net driver libraries, 3 – 15 error 1043, 3 – 15 extending defines, 3 – 15 linking, 3 – 15 linking problems, 3 – 15 missing parameters, 3 – 16

OCI support, 3 – 15 optional parameters, 3 – 16

Index – 4

ROWID data type, 3 – 15 updates, 3 – 14

Pro*C V2.2, requirements, 3 – 11

Pro*C++, not supported on HP 9000, 3 – 11

Pro*COBOL

COBDIR environment variable, 3 – 16

FORMAT option, 3 – 18 requirements, 3 – 11 rtsora, 3 – 17 sample program, 3 – 16

SQL*NET Protocol Adapters, 3 – 18 updates, 3 – 16

Pro*FORTRAN linking, 3 – 18 requirements, 3 – 11 system libraries, 3 – 18 updates, 3 – 18

Process structure csrdef, 3 – 7 ldadef, 3 – 7

PROCESSES parameter, 1 – 25

PRODUCT_USER_PROFILE table, 2 – 2 programmatic interfaces network products, 3 – 2 optional parameters, 3 – 9 signals, 3 – 3 system libraries, 3 – 3 protocol, Oracle APPC/LU6.2 specification,

4 – 3 protocol adapters, list, 4 – 1 ps tool, 1 – 5

R ratio, cache hit, 1 – 17

README file, 5 – 5 redo log archive file, specifying, 1 – 27

Requirements, precompilers, 3 – 11 requirements

Pro*Ada, 3 – 11

Pro*C V2.2, 3 – 11

Pro*COBOL, 3 – 11

Pro*FORTRAN, 3 – 11

SQL*Module for C, 3 – 11 resource limits, 1 – 3

rtsora, 3 – 18

S sar command, 1 – 5, 1 – 17

Server Manager monitor, 1 – 5

SHOW PARAMETERS, 1 – 24

SGA, initialization parameters, 1 – 31 shared memory, 1 – 3 operations. See SGA, size

SGA, 1 – 3

SHARED mode, tuning locks for Parallel

Server, 1 – 13

SHARED_POOL_SIZE parameter, 1 – 25

Short integers, 3 – 10

SIGINT, catching, 3 – 4

Signals, 3 – 3

SORT_AREA_SIZE parameter, 1 – 25

SORT_SPACEMAP_SIZE parameter, 1 – 25 space, allocating extents, 1 – 9

SPIN_COUNT parameter, 1 – 30

SQL*DBA monitor, 1 – 5

SHOW PARAMETERS, 1 – 24

SQL*Module for C demo, 3 – 20 linking, 3 – 19 requirements, 3 – 11 updates, 3 – 19

SQL*Net list of products, 4 – 1 updates, 4 – 2 use with Pro*C, 3 – 2

SQL*Net drivers, programmatic interfaces.

See precompilers

SQL*Net products, and network libraries, 3 – 2

SQL*Plus, 2 – 2 release 3.1, 2 – 3

SQLPATH variable, 2 – 2

START command, SQL*Plus, 2 – 2

STORAGE parameters, setting values, 5 – 8

System Global Area (SGA), requirements, 1 – 3

T tables allocating extents, 1 – 10 locating free space, 1 – 9 storing data in separate files, 1 – 10 striping, 1 – 10

TEMPORARY_TABLE_LOCKS parameter,

1 – 25

TEXT_ENABLE parameter, A – 2

TIMEOUTS parameter, 1 – 30

TNS listener, SQL*Net V2 files and utilities,

4 – 2 top command, 1 – 5 transaction, locating free space, 1 – 9 transaction_program_name, Oracle

APPC/LU6.2 specification, 4 – 3

TRANSACTIONS_PER_ROLLBACK_SEGME

NT parameter, 1 – 25 tuning

Oracle7 Server, 1 – 8

Parallel Server, 1 – 11 table striping, 1 – 10 two–task signals, 3 – 3

SIGCONT, 3 – 3

SIGINT, 3 – 3

SIGPIPE, 3 – 3

SIGTERM, 3 – 3

U updates, locating free space, 1 – 9

USE_ASYNC_IO parameter, 1 – 26

USE_READV parameter, 1 – 29 user interrupts, Pro*C applications, 3 – 4

USER_DUMP_DEST parameter, 1 – 26

V

V$XATRANS$ view, 5 – 5

Index – 5

X

XA Library

README file, 5 – 5

XAVIEW.SQL location, 5 – 5

XA library, 5 – 4

Index – 6

Customer Support and Documentation Information

Oracle7 Reference Addendum for HP 9000 Series 700/800

Release 7.3, Part No. A53259–01

Customer Support Information

Oracle Worldwide Customer Support Services can be reached 24 hours a day. If you need assistance, please call:

In the USA:

Customer Technical Support Services: 1.415.506.1500

In Europe:

Customer Technical Support Services, Response Centre: +44 1344 860160

Supplying Technical Information

Be prepared to supply the following information:

• your CSI number (this helps Oracle Corporation track questions recorded for each customer)

• the release numbers of the Oracle7 Server and associated products

• the operating system name and version number

• details of error numbers and descriptions (write down the exact errors––it helps

Oracle Worldwide Customer Support Services in quickly providing resolution)

• a full description of the issue

• a description of the changes made to the system

For installation-related problems please supply:

• printouts of the $ORACLE_HOME and $STAGE_HOME directories

• directory path names of your installation staging area

$ORACLE_HOME directory

This helps Oracle WorldWide Customer Support Services validate the information written to the

install.log file.

Documentation Information

Documentation Sales and Client Relations

In the USA:

To order hard copy documentation, please call Documentation Sales at: 1.800.252.0303

For shipping inquiries, product exchanges or returns, please call Client Relations at: 1.415.506.1500

In Europe:

For all enquiries, please call Customer Technical Support Services, Response Centre: +44 1344 860160

Documentation Comments

Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of our documentation. 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 suggestions for improvement, please send your comments to:

Oracle for HP Documentation Manager

Oracle Corporation

500 Oracle Parkway

Box 659104

Redwood Shores, California 94065

Phone: 1.415.506.2834 FAX: 1.415.506.7357

E-mail: dochp@us.oracle.com

If you would like a reply, please be sure to include the following:

• the document title and topic heading of the sections you recommend for improvement, AND

• your name, address, and telephone number, OR

• your name and E-mail address.

Thank you for your attention.

A53259–01