This chapter provides the BS2000/OSD-specific information that you must use with Oracle Database 11g Release 2 (11.2) for Fujitsu BS2000/OSD.
This chapter contains the following sections:
Every Oracle Database utility and product under BS2000/OSD uses an Oracle Database environment-definition file, named ORAENV
.
The ORAENV
file is a text file that has the format of a BS2000 command procedure. The command procedure calls itself using the /SET-FILE-LINK ORAENV
, filename
command. Each line contains an Oracle Database environment variable and its assigned value. When reading this file, Oracle Database ignores all lines that have a slash symbol (/) or asterisk symbol (*) in column one.
You must generate this file before you use the Oracle Database programs as it contains several Oracle Database environment variables. These Oracle Database environment variables describe the operating environment for the Oracle Database and utilities. The section "Generating the Environment-Definition File" explains how to create the file.
If you do not generate the ORAENV
file, then the default values are used for all environment variables. In some cases, there are no default values for environment variables, such as for ORASID
. If you start an Oracle Database program or utility without first generating the ORAENV
file, then you will not be able to connect to the Oracle Database.
To generate an ORAENV
file before using Oracle Database for the first time, perform the following steps:
Call the INSTALL.P.USER
procedure by entering the following command:
/CALL-PROCEDURE $ORAC1120.INSTALL.P.USER
where $ORAC1120
is the name of Oracle Database 11g Release 2 (11.2) installation user ID.
You are prompted to enter the database system identifier known as the SID
.
Enter the SID
. If you do not know the SID
, then contact the database administrator.
To call the ORAENV
file (sid
.P.ORAENV
) for the database DEMO
, enter the following CALL-PROCEDURE
command on the ORAENV
file:
/CALL-PROCEDURE DEMO.P.ORAENV
To specify the environment variables, call the ORAENV
file containing the environment variables for the database you want to use.
The following content for the ORAENV
file is available with Oracle Database:
/SET-PROC-OPT DATA-ESCAPE=*STD /DECL-PAR (SYSCMD(INI-VAL='DEMO.P.ORAENV')) / REMARK * SYSCMD must be name of this file / WRITE-TEXT ' ' / WRITE-TEXT ' +----------------------------------------+ ' / WRITE-TEXT ' I Oracle Database 11g Release 2 (11.2) I ' / WRITE-TEXT ' I environment setup I ' / WRITE-TEXT ' +----------------------------------------+ ' / WRITE-TEXT ' ' / SET-FILE-LINK ORAENV,&SYSCMD / SET-FILE-LINK ORALOAD,$ORAC1120.ORALOAD.LIB / SET-FILE-LINK ORAMESG,$ORAC1120.ORAMESG.LIB /&* MOD-SDF $ORAC1120.SYSSDF.ORACLE.USER /&* *** if SYSOUT protocol is desired set BGJOUT='KEEP' *** /&* SET-VAR BGJOUT='DEL' / EXIT-PROCEDURE ** parameters for users: * ORAUID=/BS2/$ORAC1120 ORASID=DEMO NLS_LANG=German_Germany.D8BS2000 * PRINTPAR= /END-PROCEDURE
If you want, you can change Oracle Database 11g Release 2 (11.2) working environment by editing the user variables in the ORAENV
file. The Appendix B, "Oracle Environment Variables" contains a list of the variables you can specify in the ORAENV
file.
Note:
The values that you assign to user variables are specific to your task and the database with which you work. The database administrator can also set other variables that may affect the whole database instance. If you try to set values for the DBA-specific variables in theORAENV
file, then they are ignored.The ORALOAD
library ($ORAC1120.ORALOAD.LIB
by default) is required for starting Oracle Database 11g Release 2 (11.2) programs. Oracle Database uses this library to dynamically load executables when required. The ORALOAD
library must be identified by the link name ORALOAD
before calling Oracle Database programs. If the link name is missing, then a BLS (BS2000 loader) error message appears. The ORALOAD
link name is set when the ORAENV
procedure is called.
Another library, the ORAMESG
library ($ORAC1120.ORAMESG.LIB
by default) is required for Oracle messages. This library is assigned the link name ORAMESG
in the ORAENV
procedure.
Before you start Oracle Database programs, you must call the environment-definition file. See Section 1.1.2, "Calling the Environment-Definition File" for more information.
To start the Oracle Database programs and utilities, enter a START-PROGRAM
command with the program name at the BS2000 command prompt (/). Specify the options and operands as the first data-input line when the data prompt (*) is displayed, as shown in the following example:
/START-PROGRAM $ORAC1120.program_name CCM0001 enter options: * [option_switch] [arguments]
where:
program_name
is the name of the program or utility to be started
option_switch
is one or more of the program-dependent optional switches. If this is used, then the switch is preceded by a dash (-).
arguments
are one or more operands of the program (or utility), or the username and password combination, or both.
To start SQL*Plus, enter the following command:
/START-PROGRAM $ORAC1120.SQLPLUS
* /NOLOG
SQL> CONNECT SYS / AS SYSDBA
Enter password: password
As soon as the program is loaded, the CCM0001
prompt is displayed to let you enter the command line options. As shown in the preceding examples, you can enter the option_switch
or arguments
for the program. The prompt of the program is then displayed. If the program is SQL*Plus, then the prompt is SQL>
. You can now enter one of the commands of the program. See the generic documentation for the product for a description of the valid commands.
Alternatively you can start the Oracle Database utilities with the following BS2000 SDF command:
/START-EXECUTABLE ($ORAC1120.ORALOAD.LIB,program_name)
For example, to start SQL*Plus, then enter the following command:
/START-EXECUTABLE ($ORAC1120.ORALOAD.LIB,SQLPLUS)
To start the utilities in UNIX-Style, enter the following commands:
/START-ORACLE-CMMIGR or /CMMIGR /START-ORACLE-EXPORT or /OEXP /START-ORACLE-EXPDP or /EXPDP /START-ORACLE-IMPORT or /OIMP /START-ORACLE-IMPDP or /IMPDP /START-ORACLE-LISTENER-CONTROL or /LSNRCTL /START-ORACLE-MKWALLET or /MKWALLET /START-ORACLE-SQLLOADER or /SQLLDR /START-ORACLE-SQLPLUS or /SQLPLUS /START-ORACLE-TNSPING or /TNSPING /START-ORACLE-RMAN or /RMAN
Parameters can be specified after the start command (in quotation marks, if the parameters contains equal to (=) or blanks). Before you start the utility, activate the MOD-SDF
command in the ORAENV
file, and call the ORAENV
file, as follows:
/sqlplus /lsnrctl stop /oimp 'system/manager file=iea buffer=210000 ignore=y grants=y rows=y full=y commit=y'
With Oracle Database 11g Release 2 (11.2) on Fujitsu BS2000/OSD, you can run utilities like SQL*Plus not only in the normal BS2000 environment, but also in the POSIX environment.
During the installation of the Oracle Database software, the utilities are installed within the POSIX file system in the directory oracle_home_path
/bin
.
To start Oracle utilities in the POSIX shell, you must set the environment variable ORACLE_HOME
, and extend the environment variable PATH
by the path name of the Oracle directory oracle_home_path
/bin
, as follows:
$ ORACLE_HOME=/u01/app/orac1120/product/dbhome $ export ORACLE_HOME $ PATH=$ORACLE_HOME/bin:$PATH $ export PATH
Alternatively, you can execute the profile oracle_home_path
/.profile.oracle
, created during the installation of the Oracle Database software under POSIX. This profile sets and expands the most important variables like ORACLE_HOME
and PATH
.
To execute the profile, enter the following command:
$ . /u01/app/orac1120/product/dbhome/.profile.oracle
Set the variable ORACLE_SID
to start an Oracle utility for a specific Oracle instance. Additional instance-specific parameters that are defined in the related BS2000 ORAENV
file, may be set in the POSIX environment or by accessing the BS2000 ORAENV
file.
Utilities running in the POSIX shell provide the opportunity to read instance-specific variables from the ORAENV
file in the BS2000 file system. To provide access to the BS2000 ORAENV
file, you must create a file named oraenvsid
in the oracle_home_path
/dbs
directory. This file contains the qualified BS2000 file name of the BS2000 ORAENV
file. It acts like a link to the ORAENV
file in the BS2000 file system.
For example, to access the ORAENV
file $ORADATA.ORCL.P.ORAENV
, then you must create an oraenvORCL
file in the oracle_home_path
/dbs
directory, as follows:
$ ORACLE_HOME=/u01/app/orac1120/product/dbhome $ export ORACLE_HOME $ echo '$ORADATA.ORCL.P.ORAENV' > $ORACLE_HOME/dbs/oraenvORCL $ chmod 664 $ORACLE_HOME/dbs/oraenvORCL
Note:
Utilities running in the POSIX shell handle the variables of the BS2000 ORAENV
file as subordinated variables. Environment variables in the POSIX shell take precedence over settings in the BS2000 ORAENV
file.
The SID
in the file name oraenv
sid
is case sensitive and must match the SID
specified in ORACLE_SID
.
You must grant access to the user using the BS2000 ORAENV
file, if the POSIX user that runs the Oracle utility in the POSIX shell is different from the BS2000 user ID where the ORAENV
file is located.
If an Oracle utility uses the BEQ protocol to connect to a database, then Oracle Net Services gets the job parameters to start a dedicated server in the BS2000 environment from the BGJPAR
variable. If this variable is not specified, then Oracle Net Services will use default values.
Note:
TheBGJPAR
variable is not set after the oracle_home_path
/.profile.oracle
profile is run.While using the BEQ protocol, it is recommended that particular BS2000 job parameters are defined for BS2000 jobs, started by Oracle Net Services. The BGJPAR
variable provides the option to define these parameters. You can define this variable either in the related BS2000 ORAENV
file or by explicitly setting it in the POSIX environment to the appropriate value.
For example, if a bequeathed server task should be assigned to a special JOB-CLASS
, then set the BGJPAR
variable in the POSIX environment, as follows:
$ ORACLE_SID=orcl $ export ORACLE_SID $ BGJPAR='START=SOON,CPU-LIMIT=NO,JOB-CLASS=JCBORA,LOGGING=*NO' $ export BGJPAR
You can start the utilities in the same way as on other UNIX systems, such as for SQL*Plus, using the following commands:
$ sqlplus /nolog $ SQL> connect / as sysdba
To connect to an Oracle instance, perform one of the following methods:
Using Oracle Net Services with the Bequeath adapter. See the "Oracle Net Services" chapter in Oracle Database Installation and Administration Guide for Fujitsu BS2000/OSD.
Using Oracle Net Services over TCP/IP or IPC.
Check with the database administrator if you can connect to the Oracle database using the listed methods, as the possibilities available are dependent on how the system has been configured. Usually, you specify the way you connect to an Oracle instance as part of the logon string appended to the userid/password, and separated from it by an at sign (@), as described in the following sections:
If you do not specify a connection string, then the environment variable DEFAULT_CONNECTION
, if set, is used to establish the Oracle database connection. See Appendix B, "Oracle Environment Variables" for more information about the ORAENV
file and the DEFAULT_CONNECTION
environment variable.
Access to a local or remote instance is done through Oracle Net Services. Use the Oracle Net Services logon string to identify the following for accessing a local or remote database:
Protocol to be used.
Database you want to access.
Type of server (whether dedicated or shared) you want to use.
The Oracle Net Services logon string has the following structure:
/START-PROGRAM $ORAC1120.SQLPLUS * userid/password@service_name
where:
service_name
specifies a service name entered in the TNSNAMES.ORA
file that identifies the TNS connect descriptor for the desired database. If you are not sure of what you should enter, then contact the database administrator.
The following example shows a logon string to connect to a database defined in the TNSNAMES.ORA
file as SERVERX
:
HR/HR@SERVERX
For information about connecting to an Oracle Database using the Bequeath adapter, see the "Oracle Net Services" chapter in Oracle Database Installation and Administration Guide for Fujitsu BS2000/OSD.
In most cases, Oracle Database for BS2000/OSD programs use the functions of the C-BS2000 run-time system to access their input and output files. Oracle Database programs can read and write SAM
, ISAM
, and PAM
files.
Textual data is usually stored in SAM
or ISAM
files. Each record is taken to be one text line. For example, the SQL script files used by SQL*Plus and spool output files.
SQL*Loader input data is provided as SAM
or ISAM
files. These files may also contain non-printable data, such as packed decimal or binary integer values. For ISAM
files, the key at the beginning of the record is generally ignored.
Under BS2000/OSD, the Oracle Database utilities add default extensions to file names only when the last component of the specified file name is longer than three characters, or when only one component is specified, as shown in the following table:
Original File Name | Extended File Name | |
---|---|---|
1. | TEST.TEST |
TEST.TEST.EXT |
2. | TST |
TST.EXT |
3. | T.T |
T.T |
4. | TEST.TST |
TEST.TST |
This is similar to the file naming conventions used with Oracle Database on a UNIX system.
Instead of specifying a file name, in special cases, you can also specify the link name of a previously issued BS2000 /SET-FILE-LINK
command by using the syntax link=
linkname
in places where a file name is requested. In this way, you can override default file attributes, preallocate file space, and so on. There are a few exceptions where the link=
linkname
notation cannot be used.
Note:
When using thelink=
linkname
notation, default file name extensions do not work. As a result, file name defaults derived from such notation are not valid, and you must provide explicit names in such cases.
For example, when working with SQL*Loader, if you specify link=
linkname
for the SQL*Loader control file, then you must provide explicit names for the BAD
, LOG
, and DISCARD
file names.
Some programs may report a syntax error when the link=
linkname
notation is used on the command (options) line. In such cases, omit the parameter on the command line and specify it instead, when you are prompted for the missing parameter.
Oracle Database 11g Release 2 (11.2) for BS2000/OSD uses fixed link names for specific files.
The most important of these are as follows:
Type | Meaning/Usage |
---|---|
ORAENV | The link name of the Oracle Database environment-definition file. |
ORALOAD | The link name is mandatory and is used to specify the load library from which the Oracle Database modules are loaded during processing. |
ORAMESG | The link name is mandatory and is used to specify the message library from which Oracle message modules are loaded during execution. |
Typically, you can set these link names by running the ORAENV
procedure.