9 Configuring the Gateway Using SNA Communication Protocol
The following topics describe how to configure the Oracle database for a gateway using the SNA protocol on your UNIX based platform. It also shows you how to configure commit-confirm, should you choose to implement it.
The topics provide the steps necessary to verify installation and configuration of the gateway components, including optional commit-confirm.
-
Oracle Database Configuration: First-Time Gateway Installations
-
Upgrading or Migrating the Oracle Database from Previous Gateways
Configuring the Oracle Database Gateway for APPC using SNA involves working with the following components:
-
Oracle database
-
UNIX system
-
Network
-
OLTP
Before You Begin
Gateway configuration using SNA communication protocol requires you to input parameters unique to your system to properly configure the gateway and SNA communications interface.
Refer to Configuration Worksheet for a worksheet listing the installation parameters that you need to know before you can complete the configuration process. Ask your network administrator to provide you with these unique parameter names before you begin.
Preparing to Configure a Gateway Installation/Upgrade
There are three ways to establish the gateway-Oracle database relationship when you are installing or upgrading or migrating the gateway:
-
When Oracle Database and the Gateway Are Installed in the Same ORACLE_HOME
-
When Oracle Database and the Gateway Are Installed on Separate Systems
-
When Oracle Database and the Gateway Are on the Same System but in Different Directories
Depending on the location of the gateway and the Oracle database, you might need to transfer some of the gateway administrative files to the location where Oracle database is installed.
Follow the instructions corresponding to your combination of the gateway-Oracle database locations listed below.
When Oracle Database and the Gateway Are Installed in the Same ORACLE_HOME
You do not need to transfer files. Proceed to Oracle Database Configuration: First-Time Gateway Installations.
When Oracle Database and the Gateway Are Installed on Separate Systems
You need to perform the following tasks if Oracle database and the gateway are installed on separate systems:
-
Locate the gateway administrative files in the gateway
$ORACLE_HOME/dg4appc/admin
directory. All files in this directory that have the.sql
,.pkh
, or.pkb
suffixes must be copied into a similarly-named directory in the Oracle database Oracle home directory. -
Now locate the gateway demo files and subdirectories in the
$ORACLE_HOME/dg4appc/demo
directory of the gateway. Copy thepgavsn.sql
andpgaecho.sql
files into a similarly named directory in Oracle database. -
Copy the other subdirectories and files related to your installed OLTP on your remote host. For example, if you have CICS as your only OLTP, then copy the
$ORACLE_HOME/dg4appc/demo/CICS
gateway files into a similarly named directory in the Oracle database.Note:
Before transferring the files from the
$ORACLE_HOME/dg4appc/demo
directory, ensure that you have generated your required TIPs. You need to transfer the TIPs as well.Refer to the Oracle Database Gateway for APPC User's Guide for information about generating TIPs using Procedural Gateway Administrative Utility (PGAU).
When Oracle Database and the Gateway Are on the Same System but in Different Directories
You must change your gateway Oracle home to the Oracle home directory of Oracle database.
If this is a first-time installation, proceed with Oracle Database Configuration: First-Time Gateway Installations.
If this is an upgrade, proceed with Upgrading or Migrating the Oracle Database from Previous Gateways.
Following those steps, you might want to perform the Optional Configuration Steps to Permit Multiple Users.
Oracle Database Configuration: First-Time Gateway Installations
Follow these steps to configure your Oracle database if you have installed Oracle Database Gateway for APPC for the first time:
-
Ensure that the
UTL_RAW
PL/SQL package has been installed on your Oracle database. All PGAU-generated TIP specifications useUTL_RAW
, which provides routines for manipulating raw data.-
Use SQL*Plus to connect to the Oracle database as the
SYS
user. -
From SQL*Plus, enter the following command:
SQL> DESCRIBE UTL_RAW
The
DESCRIBE
statement produces output on your screen. If you browse through the output, you should see some functions, including a compare function. If you do not see this output, then continue theUTL_RAW
installation by performing Step 1.d below.If the
DESCRIBE
statement indicates success, then your Oracle database hasUTL_RAW
installed and you can proceed to Step 2. -
Use SQL*Plus to connect to the Oracle database as the SYS user.
-
From SQL*Plus, run the
utlraw.sql
andprvtrawb.plb
scripts in the Oracle database$ORACLE_HOME/rdbms/admin
directory, in the following order:SQL> @$ORACLE_HOME/rdbms/admin/utlraw.sql SQL> @$ORACLE_HOME/rdbms/admin/prvtrawb.plb
-
-
Ensure that the DBMS_OUTPUT standard PL/SQL package is enabled on Oracle database. The sample programs and installation verification programs on the distribution media use this standard package.
-
If necessary, use SQL*Plus to connect to the Oracle database as the
SYS
user. -
From SQL*Plus, enter the following command:
SQL> DESCRIBE DBMS_OUTPUT
The
DESCRIBE
statement produces output on your screen. If you browse through that output, you should see some functions, including aput_line
function.If you do not see this output, then you must create the
DBMS_OUTPUT
package. Refer to the Oracle Database PL/SQL Packages and Types Reference for more information about theDBMS_OUTPUT
package. After successful installation of theDBMS_OUTPUT
package, issue theDESCRIBE
statement.If the
DESCRIBE
statement indicates success, then your Oracle database hasDBMS_OUTPUT
created, and you can proceed to Step 3. -
-
Install the
UTL_PG
PL/SQL package. All PGAU-generated TIP specifications useUTL_PG
, which provides routines for performing numeric conversions to and from raw data.-
If necessary, use SQL*Plus to connect to the Oracle database as the
SYS
user. -
From SQL*Plus, run the
utlpg.sql
andprvtpgb.plb
scripts in the Oracle database$ORACLE_HOME/rdbms/admin
directory, in the following order:SQL> @$ORACLE_HOME/rdbms/admin/utlpg.sql SQL> @$ORACLE_HOME/rdbms/admin/prvtpgb.plb
-
-
Install the Heterogeneous Services (HS) catalogs.
-
If necessary, use SQL*Plus to connect to the Oracle database as the
SYS
user. -
Enter the following command:
SQL> DESCRIBE HS_FDS_CLASS
The
DESCRIBE
statement produces output on your screen. If theDESCRIBE
statement indicates success, then heterogeneous services catalogs have been created on your Oracle database and you can proceed to Step 5, otherwise follow the next step only if theDESCRIBE
statement does not indicate success. Step c creates the Heterogeneous Services catalog. -
If it is necessary to create the Heterogeneous Services catalog, enter the following command:
SQL> $ORACLE_HOME/rdbms/admin/caths.sql
-
-
Create a public database link to access Oracle Database Gateway for APPC:
Use SQL*Plus to connect to the Oracle database as the
SYSTEM
user. You can use the following SQL*Plus sample whether the Oracle database and the gateway are on the same system or on different systems. In the following sample,pgasrv
is thetns_name_entry
that will be assigned to the gateway when you modify thetnsnames.ora
file later.SQL> CREATE PUBLIC DATABASE LINK PGA USING 'PGASRV'
-
Create the gateway administrator user
PGAADMIN
and install the PG DD.-
Use SQL*Plus to connect to the Oracle database as the
SYSTEM
user. -
From SQL*Plus, run the
pgacr8au.sql
script in the$ORACLE_HOME/dg4appc/admin
directory. This script creates thePGAADMIN
user ID.The initial password defined for
PGAADMIN
isPGAADMIN
. Use theALTER USER
command to change the password. For more information about password issues, refer to the Oracle Database SQL Language Reference.SQL> @$ORACLE_HOME/dg4appc/admin/pgacr8au.sql
-
Use SQL*Plus to connect to the Oracle database as user
PGAADMIN
. -
From SQL*Plus, run the
pgddcr8.sql
script in the$ORACLE_HOME/dg4appc/admin
directory. This script installs the PG DD.SQL> @$ORACLE_HOME/dg4appc/admin/pgddcr8.sql
-
From SQL*Plus, connect to the Oracle database as the
SYS
user. -
Grant execution privileges on
DBMS_PIPE
toPGAADMIN
:SQL> GRANT EXECUTE ON DBMS_PIPE TO PGAADMIN
-
-
Install the TIP trace access PL/SQL routines. These routines require that the DBMS_PIPES standard PL/SQL package is installed and that
PGAADMIN
has execute privileges on it. For more information onDBMS_PIPES
, refer to the Oracle Database PL/SQL Packages and Types Reference.-
If necessary, use SQL*Plus to connect to the Oracle database as user
PGAADMIN
. -
From SQL*Plus, run the
pgatiptr.sql
script in the$ORACLE_HOME/dg4appc/admin
directory. This script creates PL/SQL routines that can be called to read and purge trace information created by PGAU-generated TIP specifications. It also creates public synonyms for these routines. The script prompts you for the necessary user IDs and passwords.SQL> @$ORACLE_HOME/dg4appc/admin/pgatiptr.sql
-
-
Install the
GPGLOCAL
package. This package is required for compilation and execution of all PGAU-generated TIP specifications. TIP developers should be granted execute privileges onGPGLOCAL
(refer to Step 3of "Optional Configuration Steps to Permit Multiple Users").-
Use SQL*Plus to connect to the Oracle database as user
PGAADMIN
. -
From SQL*Plus, run the
gpglocal.pkh
script in the$ORACLE_HOME/dg4appc/admin
directory. This script compiles theGPGLOCAL
package specification.SQL> @$ORACLE_HOME/dg4appc/admin/gpglocal.pkh
-
From SQL*Plus, run the
gpglocal.pkb
script in the$ORACLE_HOME/dg4appc/admin
directory. This script compiles theGPGLOCAL
package body.SQL> @$ORACLE_HOME/dg4appc/admin/gpglocal.pkb
-
Upgrading or Migrating the Oracle Database from Previous Gateways
Follow these instructions only if you have a previous version of the Oracle Database Gateway for APPC installed on your system and need to configure it for 12c Release 2 (12.2) of the gateway.
Upgrade your Oracle Database Gateway for APPC to current version levels as follows:
If You Must Reinstall Package Specifications
If the UTL_RAW
or UTL_PG
package has been invalidated or deinstalled, the prvtrawb.plb
and prvtpgb.plb
scripts might not complete successfully and you might have to reinstall the package specifications.
If you do reinstall the package specifications, any dependent objects (such as existing user TIPs and client applications) are invalidated and will subsequently need to be recompiled. The impact of this is a one-time performance delay while recompilation of the TIPs and dependent client applications proceeds.
Note:
Before proceeding with reinstallation of the package scripts, make sure that you are in the $ORACLE_HOME/dg4appc/admin
directory.
TIPs were split into separate specification and body files in release 3.3 to avoid cascaded recompilations in later releases.
- Step 1 Run the Following Scripts before Proceeding with the PGAU Upgrade
-
From SQL*Plus, run the
utlraw.sql
script:-
If necessary, use SQL*Plus to connect to the Oracle database as the
SYS
user. -
From SQL*Plus, run the
utlraw.sql
andutlpg.sql
scripts in Oracle database$ORACLE_HOME/rdbms/admin
directory, in the following order, to upgrade their respective package specifications:SQL> @$ORACLE_HOME/rdbms/admin/utlraw.sql SQL> @$ORACLE_HOME/rdbms/admin/utlpg.sql
-
- Step 2 Repeat Installation of UTL_RAW and UTL_PG Package Body
-
After the scripts have run, repeat Steps 2 and 3 in Upgrading or Migrating the Oracle Database from Previous Gateways. Then proceed to the section titled "Upgrading PGAU From Previous Gateway Releases".
Note:
TIPs and dependent client applications must be recompiled after reinstallation of the package specifications. Refer to the "Compiling a TIP" section in Chapter 3 of the Oracle Database Gateway for APPC User's Guide for information about compiling TIPs.
Configuring the Oracle Database for Gateways to Coexist
You might have an older version of the gateway already installed. Be aware that although a version 10 gateway can communicate with a version 9 data dictionary (PGDD), a version 9 gateway cannot communicate with a version 10 data dictionary. Thus, if you upgrade your data dictionary to a version 10, no gateways which were configured with a version 9 data dictionary will be able to communicate with it.
Optional Configuration Steps to Permit Multiple Users
The following configuration steps are optional. Perform these steps if you want to allow users other than PGAADMIN
to perform PG DD operations using PGAU.
-
Create public synonyms for the PG DD to allow other users to access the tables:
-
Create roles for accessing the PG DD, performing definitions of transactions, and generating TIP specifications. The
PGAADMIN
user can grant these roles to other users as necessary.-
Use SQL*Plus to connect to the Oracle database as user
PGAADMIN
. -
From SQL*Plus, run the
pgddcr8r.sql
script in the$ORACLE_HOME/dg4appc/admin
directory. This script creates two roles,PGDDDEF
andPGDDGEN
. ThePGDDDEF
role providesSELECT
,INSERT
,UPDATE
, andDELETE
privileges against some of the PG DD tables, andSELECT
privileges against others, and allows execution of the PGAUDEFINE
,GENERATE
,REDEFINE
,REPORT
, andUNDEFINE
statements. ThePGDDGEN
role provides select privileges against the PG DD tables, and allows execution of the PGAUGENERATE
andREPORT
statements only.SQL> @$ORACLE_HOME/dg4appc/admin/pgddcr8r.sql
-
-
Grant access to PGA required packages.
TIP developers require access to the following PL/SQL packages, which are shipped with the Oracle database:
Explicit grants to execute these packages must be made to TIP developers.
These grants can be private as in the following example:
$ sqlplus SYS/pw@database_specification_string SQL> GRANT EXECUTE ON UTL_RAW TO tip_developer; SQL> GRANT EXECUTE ON UTL_PG TO tip_developer; SQL> GRANT EXECUTE ON DBMS_PIPE TO tip_developer; SQL> CONNECT PGAADMIN/pw@database_specification_string SQL> GRANT EXECUTE ON PGAADMIN.PURGE_TRACE TO tip_developer; SQL> GRANT EXECUTE ON PGAADMIN.READ_TRACE TO tip_developer; SQL> GRANT EXECUTE ON PGAADMIN.GPGLOCAL TO tip_developer; SQL> exit
Alternatively, these grants can be public as in the following example:
$ sqlplus SYS/pw@database_specification_string SQL> GRANT EXECUTE ON UTL_RAW TO PUBLIC; SQL> GRANT EXECUTE ON UTL_PG TO PUBLIC; SQL> GRANT EXECUTE ON DBMS_PIPE to PUBLIC; SQL> CONNECT PGAADMIN/pw@database_specification_string SQL> GRANT EXECUTE ON PGAADMIN.PURGE_TRACE TO PUBLIC; SQL> GRANT EXECUTE ON PGAADMIN.READ_TRACE TO PUBLIC; SQL> GRANT EXECUTE ON PGAADMIN.GPGLOCAL TO PUBLIC; SQL> EXIT
You can use either private or public grants. Both are sufficient for using PGA. Public grants are easier and can be performed now. If you use private grants, then they must be issued each time a new TIP developer user ID is created.
SQL scripts for performing these grants are provided in the
$ORACLE_HOME/dg4appc/admin
directory. Thepgddapub.sql
script performs these grants for public access to the packages. Thepgddadev.sql
script performs the grants for private access to the packages by a single TIP developer. If you are going to use private grants, then you must run thepgddadev.sql
script once for each TIP developer user ID:-
Use SQL*Plus to connect to the Oracle database as user
PGAADMIN
. -
From SQL*Plus, run the appropriate script (
pgddapub.sql
orpgddadev.sql
) from the$ORACLE_HOME/dg4appc/admin
directory. The script performs the necessary grants as described earlier. You are prompted for the required user IDs, passwords, and database specification strings.If you are using private grants, then repeat this step for each user ID requiring access to the packages.
SQL> @$ORACLE_HOME/dg4appc/admin/pgddapub.sql SQL> @$ORACLE_HOME/dg4appc/admin/pgddadev.sql
-
If you are upgrading from a previous release of the gateway, and if you want to upgrade your existing TIPs with new function and maintenance, then regenerate existing TIP specifications using the PGAU
GENERATE
statement.Note:
The PGAU has been enhanced to automatically upgrade existing PG DD entries with a new attribute when a PGAU
GENERATE
command is executed. To support this enhancement, add a new privilege to thePGDDGEN
role. To do this, as thePGAADMIN
user, use SQL*Plus to connect to the Oracle database where the PG DD is stored. Then issue the following SQL command:SQL> GRANT INSERT ON PGA_DATA_VALUES TO PGDDGEN
-
Invoke PGAU in the directory path where the PGAU control files are generated and where TIPs are stored:
$ pgau PGAU> CONNECT PGAADMIN/pgaadmin@database_specification_string PGAU> GENERATE tranname PGAU> EXIT
For more information about the
GENERATE
command, refer to the PGAUGENERATE
command section in Chapter 2, of the Oracle Database Gateway for APPC User's Guide.Note that it is not necessary to define the PG DD entries again.
-
-
Invoke SQL*Plus in the same directory path where the newly-generated TIP specifications are stored.
$ sqlplus tip_owner/pw@database_specification_string SQL> @tipname.pkh SQL> @tipname.pkb SQL> exit
PGAU
GENERATE
produces the TIP in two output files: a specification and a body. You must compile both, first the specification and then the body.For more information about the
GENERATE
command, refer to the PGAUGENERATE
command section in Chapter 2, of the Oracle Database Gateway for APPC User's Guide.
Configuring Commit-Confirm
Note:
If you are planning to implement commit-confirm, read the detailed explanation of commit-confirm's capabilities in Chapter 5 of the Oracle Database Gateway for APPC User's Guide, "Implementing Commit-Confirm (SNA Only) before proceeding.
Follow these steps to configure the commit-confirm components. The steps for configuring commit-confirm include:
Configuring the Oracle Database for Commit-Confirm
The Oracle database installation where the gateway server will store its transaction log information should ideally be on the same system where the gateway runs. The configuration of the server consists of creating the gateway DBA user, creating the commit-confirm log tables and creating the PL/SQL stored procedure used by the gateway server for logging transactions.
The pgaccau.sql
script from the $ORACLE_HOME/dg4appc/admin
directory creates the gateway DBA user ID. The default user ID is PGADBA
with the initial password set to PGADBA
. If you want to change the user ID or initial password, you must modify the script.
- Use SQL*Plus to connect to the Oracle database as the
SYSTEM
user. - From SQL*Plus, run the
pgaccau.sql
script from the$ORACLE_HOME/dg4appc/admin
directory. This script creates the gateway DBA user ID. If you want to change the password at any time after running this script, you can use theALTER USER
command to change the password. For further information, refer to the Oracle Database SQL Language Reference. - Use SQL*Plus to connect to Oracle database as the
PGADBA
user. - From SQL*Plus, run the
pgaccpnd.sql
script from the$ORACLE_HOME/dg4appc/admin
directory. This script creates thePGA_CC_PENDING
table used by the gateway server for its commit-confirm transaction log. - From SQL*Plus, run the
pgacclog.sql
script from the$ORACLE_HOME/dg4appc/admin
directory. This script creates thePGA_CC_LOG
PL/SQL stored procedure used by the gateway server for updating thePGA_CC_PENDING
table. - Disconnect from Oracle database.
Configuring Gateway Initialization Parameters for Commit-Confirm
The gateway initialization parameters are described in Gateway Initialization Parameters for SNA Protocol. The parameters necessary for commit-confirm support in the gateway are:
Configuring the OLTP for Commit-Confirm
-
Commit-confirm transaction log database
-
Commit-confirm forget or recovery transaction
-
Sample commit-confirm applications provided with the gateway
Note:
A restart of the OLTP may be necessary to implement the changes required for commit-confirm support. You should plan for this with your OLTP system administrator.
Detailed instructions for configuring the Transaction Server for z/OS and IMS/TM are provided in the $ORACLE_HOME/dg4appc/demo/CICS/README.doc
and $ORACLE_HOME/dg4appc/demo/IMS/README.doc
files, respectively.
Refer to Chapter 5, "Implementing Commit-Confirm (SNA Only)" in the Oracle Database Gateway for APPC User's Guide for detailed information about commit-confirm. You will take steps to verify configuration of commit-confirm later in "Verifying OLTP Configuration for Commit-Confirm".
Verifying the Gateway Installation and OLTP Configuration
To verify the gateway installation and the OLTP configuration, perform the following procedures after installing Oracle Database Gateway for APPC. In addition, if you chose to configure commit-confirm, follow the steps to verify the OLTP configuration for commit-confirm.
Note:
If your database link name is not PGA
, modify the demonstration .sql
files to give them the particular database link name that you created in Step 5 of "Oracle Database Configuration: First-Time Gateway Installations". You must modify the following .sql
files:
Verifying the OLTP Configuration
The procedure for verifying your OLTP configuration varies, depending on which OLTP you are using and depending upon which platform the OLTP is running on. CICS Transaction Server for z/OS, IMS/TM, APPC/MVS, and z/OS are the currently supported OLTPs. Follow the instructions in the following sections for verifying installation:
Note:
If you have not completed the file transfers detailed in "Preparing to Configure a Gateway Installation/Upgrade", complete them now, before proceeding to the next step.
Verifying OLTP Configuration for Commit-Confirm
If you chose to configure commit-confirm in Configuring Commit-Confirm, the following section will assist you in verifying the configuration.
Note:
Refer to Chapter 5, "Implementing Commit-Confirm" in the Oracle Database Gateway for APPC User's Guide for background information on the components and capabilities of commit-confirm.
Samples are provided with the gateway for Transaction Server for z/OS and IMS/TM for implementing commit-confirm support. They are in the following directories, respectively: $ORACLE_HOME/dg4appc/demo/CICS
and $ORACLE_HOME/dg4appc/demo/IMS
. A README.doc
file in each directory provides detailed information about installing and using the samples. JCL files for compiling and linking the sample programs are provided as well. The samples included with the gateway assist you with the following:
-
Creating and initializing the commit-confirm transaction log databases and defining those databases to the OLTP
For Transaction Server for z/OS, the sample uses a VSAM file for the log database. For IMS/TM, a SHISAM/VSAM database is used.
-
Using subroutines for receiving the Oracle Global Transaction ID from the gateway and logging it into the commit-confirm transaction log database
These subroutines are provided in the
pgacclg.asm
files. They can be used in your applications to reduce the complexity of the code changes to your programs. For Transaction Server for z/OS, the subroutine provided is called using the EXEC CICS LINK interface. For IMS/TM, the subroutine provided is called using the standardCALL
statement or its equivalent in the application programming language. Both of these subroutines are written in 370 assembler to eliminate any interlanguage interface complexities and compiler dependencies. -
Forget and recovery transactions
These are provided in the
pgareco.asm
files. Forget and recovery transactions must be installed into your OLTP and accessible through APPC so that the gateway can invoke them to forget a transaction once it has been successfully committed, and to query transaction state during recovery processing. These transactions delete the entry for a particular Oracle Global Transaction ID from the OLTP commit-confirm transaction log database during forget processing, and query the entry for a particular Oracle Global Transaction ID from the OLTP commit-confirm transaction log database during recovery processing. For both Transaction Server for z/OS and IMS/TM, these transactions are written in 370 assembler. -
Using the sample commit-confirm transaction log databases and subroutines
For Transaction Server for z/OS, a sample DB2 update transaction,
DB2C
, is provided in thepgadb2c.cob
file. This is a COBOL example that updates the DB2 sampleEMP
table. For IMS/TM, a sample DLI update transaction,PGAIMSU
, is provided in thepgaimsu.cob
file. This is a COBOL example that updates the DLI samplePARTS
database.
Performing Postinstallation Procedures
The following are optional steps that you can perform as necessary. Installation of the sample applications for your OLTP is recommended to help you to fully understand how the gateway works and how it interfaces with your OLTP.
Installing Sample Applications
Oracle Database Gateway for APPC package contains the following sample PL/SQL procedures and OLTP transaction programs that demonstrate the capabilities of the gateway.
APPC/MVS
-
z/OS data set information
CICS Transaction Server for z/OS
-
DB2 inquiry
-
DB2 multi-row inquiry
-
DB2 update
-
VSAM inquiry
-
VSAM update
-
DLI inquiry
-
FEPI DB2 inquiry
-
FEPI VSAM inquiry
IMS/TM
-
IMS inquiry using IVTNO and IVTNV sample transactions
-
IMS PARTS update (CPI-C)
Additional samples are added to the distribution media in later releases of the product. Wherever possible, sample applications use the sample databases provided with the database products.
For this release, full documentation on installing and using the sample applications is available in the following directories and files:
-
$ORACLE_HOME/dg4appc/CICS/sample_CICS_applications.txt
-
$ORACLE_HOME/dg4appc/IMS/sample_IMS_applications.txt
-
$ORACLE_HOME/dg4appc/MVS/sample_MVS_applications.txt