Skip Headers

Oracle9i Enterprise Edition User's Guide
Release 2 (9.2.0.1.0) for OS/390
Part No. A97312-01
Go To Table Of Contents
Contents
Go To Index
Index

Previous Next

2
Using the OS/390 Database Instance

The Oracle9i database server is implemented as a database service under OSDI.  It can monitor events relevant to its operation, such as TSO logoff, abnormal terminations, and operator console commands.

This chapter describes basic information on installation, utilities, and utilities needed for using the Oracle9i for OS/390 server and contains the following sections:

Oracle Database Instance Overview

The Oracle database instance on OS/390 is implemented as a service under a given Oracle subsystem. This chapter discusses considerations for connecting local (TSO, batch, CICS, IMS) Oracle utilities or applications to database instances running on the OS/390 system.  Connecting from UNIX System Services is discussed in Chapter 4, " Accessing Oracle9i Under USS".

Oracle9i database server users on OS/390 communicate with the local Oracle database instance using OS/390 cross memory services.  This facility allows both data and program operation to cross address space boundaries in a secure and controlled manner.

Connecting to an Oracle Instance

Each TSO or batch user of an Oracle9i for OS/390 instance runs as a separate and autonomous address space.  You can only access an Oracle instance after a valid connection is established between the user address space and the Oracle instance.  A valid connection occurs when the Oracle instance accepts the logon user id and possibly a password provided by the user.

This section discusses considerations for connecting local TSO or batch Oracle utilities or applications to Oracle database instances running on the same OS/390 system.  Such connections use OS/390 cross-memory facilities and do not involve the Oracle Net.  However, since the Oracle database server logically views all client connections as network connections, Oracle network terminology and some of the mechanisms of Oracle Net play a role in local connections.

Enabling OS/390 Local Client Access

Oracle database server clients use a cross-memory protocol for connecting to database instances.  The protocol is based on Oracle Net architecture.

Since Oracle's cross-memory protocol is based on Oracle Net, the formal mechanism for specifying a local target Oracle instance is to supply a name that is looked up in the client's tnsnames file (which is identified by the TNSNAMES DD statement).  Applications supply the name by appending an "@" character followed by the name to the userid and password that are passed during an Oracle connect request.  The entry in the tnsnames file contains an Oracle Net address string with PROTOCOL=XM and additional parameters identifying the target database service.  The complete format of the PROTOCOL=XM Oracle Net address is described under "Cross-Memory Protocol Address".  Usually the target service is identified by its SID.  Every service must have a SID that is unique throughout the OS/390 image.  Even services that are defined in different Oracle subsystems cannot have the same SID if they are on the same OS/390 image.

It also is possible to append the complete Oracle Net address string directly to the userid and password to avoid using the tnsnames file.  Oracle does not recommend this technique, however.

Cross-Memory Protocol Address

The formal Oracle Net address string for Oracle's cross-memory protocol can be specified using either of two methods:

  • One method identifies the database instance by its SID:

    (ADDRESS=(PROTOCOL=XM)(SID=sid))
    

    where sid is the SID associated with the database instance.

  • The other method uses the Oracle subystem and service names:

    (ADDRESS=(PROTOCOL=XM)(SUBSYS=ssn)(SERVICE=srvn))
    

    where ssn is the Oracle subsystem name, and srvn is the database service name.

    Oracle recommends using the SID form of address because it is simpler and because it avoids application dependence on the subsystem name.

Specifying Connections

There are four ways, including hardcoding an Oracle Net address on the connect string as described in the previous section, to specify a target instance.  In descending order of precedence, the four ways are:

  1. Specifying a tnsname entry which refers to the Oracle Net cross-memory protocol on the connect string.

  2. Providing a DD statement (or equivalent TSO allocation) of the form:

    //ORA@sid  DD  DUMMY

    where sid matches the SID of the target service.  Normally this is used only in batch or TSO applications.

  3. A TWO_TASK environment variable that is set to an Oracle Net tnsnames-style name or to an explicit Oracle Net address string.  If a name is specified, then the TNSNAMES DD in the client address space is opened and read to resolve the name to an Oracle Net address.  If the Oracle Net address specifies PROTOCOL=XM, then the client is connected to the indicated OSDI service.  (The Oracle Net address could also specify PROTOCOL=TCP, in which case the client would connect to a remote Oracle instance via Oracle Net as discussed in "Oracle Net Connect Descriptors for OS/390" in Chapter 10.)  In terms of precedence, clients look for TWO_TASK after determining that no ORA@sid DD is allocated in the address space.

  4. An ORACLE_SID environment variable is set to the SID of a database instance; the client is connected to that instance.  Clients look for ORACLE_SID last, after determining that no TWO_TASK environment variable is set.

Installation Information

Installation-specific information is required to use the Oracle9i database server effectively.  This information is available from your Oracle DBA.

Oracle9i Server and Library Names

The installation process creates several load and source module libraries you might need to access.  For example, you might need information about the following:

  • CMDLOAD library name

    All utilities, programs, and dynamically loaded modules for Oracle utilities are located in the CMDLOAD library.  The person who installs the Oracle9i database server at your site determines this data set name.

    The examples presented in this guide assume the CMDLOAD library has the data set name oran.orav.CMDLOAD.

  • MESG library name

    This library contains NLS data objects and all Oracle message modules.

  • SQLLIB library name

    The SQLLIB library contains modules used in linking programs developed in high-level languages and IBM Assembler.  It contains modules used by both Oracle Precompiler applications and OCI applications.

  • SRCLIB library name 

    The SRCLIB library contains sample JCL, program code, and scripts for Oracle tools, Programmatic Interfaces and Access Manager.

  • OBJLIB library name

    The OBJLIB library contains the object module ()RASTBS) for liking Oracle call Interface programs that do not use the LONGNAME compiler option.

Refer to the Oracle9i Enterprise Edition Installation Guide for OS/390 for more information on load and source module libraries.

Tool Syntax and Batch Procedures

Contact your Oracle DBA for the following information you need to use the Oracle utilities:

  • Name and location of the Oracle cataloged procedures

The following factors influence the syntax used to run the Oracle utilities:

  • Allocation of the Oracle CMDLOAD library to the STEPLIB DD statement in the TSO LOGON procedure

  • Installation of TSO/E

  • Allocation of the ORA$ENV DD statement

  • Allocation of the ORA$LIB DD statement

  • Allocation of the TNSNAMES DD statement

  • Inclusion of Oracle CMDLOAD library in the system LINKLIST

  • Installation of reentrant Oracle modules in the system link pack area (EPLPA and PLPA)

OS/390 Features

Use of Oracle utilities is subject to the normal conventions and features of the OS/390 operating system.  The syntax of TSO commands, CLISTs, and batch JCL must be followed.

Using Oracle Utilities

You can invoke the Oracle utilities from TSO or you can use JCL procedures to submit a batch job.

Invoking Oracle Utilities from TSO

How you invoke Oracle utilities from TSO at your site might differ slightly from what is described in this guide because access standards and requirements differ among installations.  Your DBA can provide you with the command syntax standards specific to your installation.

Call the Oracle utilities from TSO using one of the following:

  • Running as a command processor

  • Using the TSO CALL command

You control tool operation with CLISTs and the Interactive System Productivity Facility (ISPF) regardless of which technique you use.  The technique used is largely determined by decisions made at your site during installation.  The technique can also be affected by the number of active Oracle instances and the release levels of the instances.  Contact your DBA if you have any questions about which technique to use.


Note:

You must allocate the MESG data set as ORA$LIB DD before invoking any utilities:

alloc file(ORA$LIB) da('orav.oran.MESG') shr reuse


Oracle Utilities as Command Processors

When the Oracle CMDLOAD library is concatenated to your STEPLIB or when its contents are placed in a linklist library, the Oracle utilities are accessible as command processors according to standard TSO conventions.  The standard syntax is:

command [parm1][parm2]...[parmn][userid[/password[@tnsname]]] [options]

Oracle Utilities as CALL Programs

All the Oracle utilities are accessible through the TSO CALL command.  Use the CALL command to specify operation of a program from a specific library.  In the CALL command, specify the module to be run and any needed parameters.  The CALL command syntax is:

CALL 'oran.orav.CMDLOAD(command)' '[parm1] [parm2]...[parmn] —

   [userid[/password[@tnsname]]] [options]' 

Provide the CMDLOAD library name, the invocation command, one or more positional parameters followed by the user id and password, an optional connect string, and one or more options.  The number of positional parameters and the options available are tool-specific.  The single quotes are part of the command syntax and must be included as shown in the example.

The CALL command and other TSO commands can be continued from one line to the next using the normal TSO continuation syntax (a dash,  –, to indicate continuation to the next line) and without regard for line formatting.

Oracle Utilities Accessed Through CLISTs

You may also access Oracle utilities using CLISTs.  The CLIST can access the utilities as command processors or as called programs.  The developer of a CLIST can perform preliminary allocations of files, check for error conditions, and generally ensure that access to the Oracle server proceeds according to installation standards.

If you have any questions about the approved method of calling any Oracle tool at your site, then contact your DBA.

Submitting a Batch Job

The Oracle installation process optionally creates batch JCL procedures you can use to call the Oracle utilities.  The procedures at your installation might have different names than those in the following list if a procedure name suffix is selected during the installation.  Check with your system administrator before attempting to use the following procedures.

Table 2-1 Batch JCL Procedures for OS/390

Procedure Name Procedure Function
ORAC calls the Pro*C Precompiler.
ORACB2 calls the Pro*COBOL Precompiler version 9.
ORACOB calls the Pro*COBOL Precompiler version 1.
ORADBV calls the DBVerify utility.
ORAEXP calls the Export utility.
ORAFOR calls the Pro*FORTRAN Precompiler.
ORAIMP calls the Import utility.
ORALDR calls SQL*Loader.
ORAOTT calls the Object Type Translator.
ORAPLI calls the Pro*PL1 precompiler.
ORARMN calls the Oracle9i Recovery Manager utility.
ORASQL calls SQL*Plus.

Sample Cataloged Procedure

The following example shows the ORASQL JCL procedure, which runs SQL*Plus:

//ORASQL   PROC  INDEX=oran,

//               LIBV=orav, 

//               SYSOUT='SYSOUT=*' 

//ORASQL   EXEC  PGM=SQLPLUS,REGION=4M 

//STEPLIB  DD    DSN=&INDEX..&LIBV..CMDLOAD,DISP=SHR

//ORA$LIB  DD    DSN=&INDEX..&LIBV..MESG,DISP=SHR

//SYSOUT   DD    &SYSOUT,DCB=(LRECL=132,BLKSIZE=1320,RECFM=VB) 

//SYSERR   DD    SYSOUT=*,DCB=(LRECL=132,BLKSIZE=1320,RECFM=VB) 

//ORAPRINT DD SYSOUT=* 

//* REQUIRES //SYSIN DD* STATEMENT 

//* REQUIRES //ORA@sid DD DUMMY STATEMENT (ORACLE INSTANCE NAME)

The INDEX and LIBV symbolic parameters are used to form the STEPLIB and ORA$LIB data set namesThe actual values for these parameters are established by the person who installed the Oracle9i database server.  The cataloged procedures ensure the default values of these symbolic parameters conform to the actual names selected for the Oracle data sets at your installation.

In the example, the installed Oracle INDEX and LIBV parameters are oran and orav, respectively.  These values result in the following data set name for the STEPLIB DD statement:

oran.orav.CMDLOAD

The SYSOUT DD statement contains a symbolic reference to &SYSOUT.  This symbolic reference defaults to the string SYSOUT=*, which sets the SYSOUT class of this DD statement to the same class as MSGCLASS in the JCL JOB statement.

The procedure requires additional JCL to point to the correct Oracle instance.  See earlier section 'Specifying Connections' for details.  Some examples are:

Example 2-1 Example #1

//ORA@ORA1 DD DUMMY

Example 2-2 Example #2

//ORA$ENV     DD *

TWO_TASK=ORANAME

//TNSNAMES  DD *

ORANAME=(DESCRIPTION=

    (ADDRESS=(PROTOCOL=XM)(SID=ORA1))

)

Example 2-3 Example #3

 //ORA$ENV     DD *

 ORACLE_SID=ORA1

All three of the above examples illustrate accessing a local instance whose SID is ORA1.

Alternatively, the connection can also be specified using a tnsname alias on a userid and password supplied in the SYSIN file, or in the PARM field of the EXEC statement.

This procedure requires a SYSIN DD statement.  The SYSIN DD statement can contain instream SQL and SQL*Plus statements, or it can point to a file containing such statements.

Each JCL procedure provided with the Oracle9i database server conforms to the basic structure illustrated by the ORASQL procedure.

Sample Batch Job

The following example JCL runs the ORASQL cataloged procedure.  You must provide an appropriate JOB card at the beginning of the sample job.  The example assumes the Oracle instance you are connecting to has ORA1 as its SID.

// ...     JOB   ... 

//SQL EXEC ORASQL,

//    PARM='SCOTT/TIGER' 

//ORA@ORA1 DD DUMMY  

//SYSIN    DD DSN=SCOTT.ORACLE.SQL(SQLSTUFF),DISP=SHR 

  • User id SCOTT is used to connect to the Oracle instance.

  • The ORA@ORA1 DD statement names the target instance, ORA1.

  • The contents of member SQLSTUFF in data set SCOTT.ORACLE.SQL is run.  This file must contain valid SQL and SQL*Plus statements.

Ask your DBA or systems programming staff for the location of these JCL procedures and the correct symbolic parameters that must be provided to the utilities.  These procedures are installed in a library that is automatically searched by the JES2 or JES3 job entry subsystem.  If you experience problems in running these procedures, then contact your Oracle DBA.

Using the Batch TMP

Run Oracle utilities in batch using TSO notation and conventions by running the TSO batch terminal monitor program (TMP) facility.

Exiting Utilities and Utilities in TSO

In response to an input prompt, a forward slash followed by an asterisk (/*) is used to exit any line mode Oracle9i for OS/390 tool or utility.

Attention Processing

For TSO applications, the Oracle subsystem establishes an attention processing subtask through the OS/390 STAX macro instruction.  When the [Attn] or [PA1] key is pressed, the interrupted status is passed to the connected Oracle address space.  The corresponding main task then performs the interrupt processing and returns to the application address space.  The attention processing is removed when the disconnect function is called and the attention processing subtask is detached.

For both Oracle tools and customer-written applications running in TSO/E, the Oracle program interface code will attempt to establish an attention-processing subtask that uses the TSO/E STAX service.

This mechanism allows the user to interrupt an operation in the Oracle server by pressing the terminal [Attn] or [PA1] key.  For this to work, the ORASTAX module must be loadable from JOBLIB/STEPLIB, a linklist library, or LPA.  If ORASTAX cannot be loaded, attention processing is suppressed; no messages are issued to indicate this condition.

In addition to the above, certain Oracle tools or utilities recognize and process TSO/E attention if it occurs while the utility is active (that is; not during a server request).  These are discussed in the relevant tool or utility sections.

Attention interrupt processing is specific to each tool.  Chapter 9, " SQL*Plus" discusses the effect of attention processing.

OS/390 Environment Variables

Environment variables enable you to set certain options for each user.  Specify environment variables in a sequential file or in a PDS member pointed to by the ORA$ENV DD statement.

Environment variables have the following syntax:

user_env_name = 'env_value'  *** comment ****

where:

user_env_name is the environment variable name.  This name can be expressed in uppercase, lowercase, or mixed case.
env_value is the environment variable value you specify.  If the value is enclosed by single quotes, then it is saved exactly as you specify it.  If the value is not enclosed in single quotes, then the value is translated to uppercase and saved in uppercase.
comments is an optional comment.  If comment is used, then 'env_value' must be enclosed by quotes.  If the first nonblank character is '*', '/', or '#', then the whole line is treated as a line comment.

The following environment variables are supported:

ORACLE_SID, TWO_TASK, and the OS/390 environment variables are described in the following list.

CRTL_SPFENQ enables or disables the PDS enqueuing mechanism for Oracle utilities.  For example:

CRTL_SPFENQ = 'yes|no'

The default is yes.

The enqueue mechanism used by Oracle utilities for performing simultaneous updates to a shared PDS is compatible with the method used by the ISPF editor.  This enqueue mechanism affects PDS members opened with /DD/ or /DSN/.

CRTL_PDSWAIT alters the behavior of the PDS enqueue mechanism.  When the enqueue is not immediately available, a yes places the user in a wait state.  When the enqueue is not immediately available a no returns an error to the user.  The default is no. Following is the correct syntax:

CRTL_PDSWAIT = 'yes|no'

NLS_LANG specifies the national language in which Oracle utilities issue messages, format and display dates and numbers, sort text, and process character data at computers.  The syntax is:

NLS_LANG='language_territory.charset'

The default setting is:

NLS_LANG='AMERICAN_AMERICA.WE8EBCDIC1047'

Customers who have built their databases with releases earlier than 7.3.2 and who have 'WE8EBCDIC37C' as their character set can specify the following to eliminate unnecessary conversion:

NLS_LANG='AMERICAN_AMERICA.WE8EBCDIC37C'

Consult with your Oracle DBA for information about which languages, character sets, and territories are supported at your site.

ORACLE_HOME specifies the OS/390 USS directory path of the location where the USS components of Oracle9i for OS/390 are installed.
ORACLE_SID specifies the SID of a local Oracle for OS/390 database instance that is used to connect a local Oracle for OS/390 client to a local Oracle database instance.
TWO_TASK specifies the Oracle Net tnsnames-style name or the explicit Oracle Net address string that is used to connect a local Oracle for OS/390 client to a local or remote Oracle database instance.
TZ specifies the time zone that is used within the Oracle JServer.  If TZ is not defined, a default of GMT is used.  The TZ specified should match one of the entries from the $ORACLE_HOME/javavm/lib/tzmappings file.


Previous Next
Oracle Logo
Copyright © 2002 Oracle Corporation

All rights reserved
Go To Table Of Contents
Contents
Go To Index
Index