|
Oracle® Transparent Gateway for RMS Administrator's Guide
10g Release 1 (10.1) for HP OpenVMS Part No. B10538-01 |
|
![]() Previous |
![]() Next |
After installing the gateway, perform the following tasks to configure the gateway for RMS:
Perform the following tasks to configure the Oracle Transparent Gateway for RMS.
The gateway system identifier (SID) is an alphanumeric character string that identifies a gateway instance. You need one gateway instance, and therefore one gateway SID, for each different set of gateway metadata (ADD) definitions, where each set is stored in a different directory. The SID is used as part of the file name for the initialization parameter file. The default SID is tg4rms.
You can define a gateway SID, but using the default of tg4rms is easier because you do not need to change the initialization parameter file name. However, if you want to access RMS data using different sets of gateway ADD metadata, you need two gateway SIDs, one for each instance of the gateway. If you have one set of gateway ADD metadata and want to access it sometimes with one set of gateway parameter settings, and other times with different gateway parameter settings, you can do that by having multiple gateway SIDs.
The gateway startup script initializes certain logical names and starts the gateway. The script is started by the Oracle Net Services listener after an incoming connect request for the gateway is received. The following default startup script, oracle_home:[tg4rms.admin]tg4rms.com, is created as part of the installation (oracle_home is the device under which the gateway is installed):
$! TG4RMS.COM - created by ORA_TG4RMS_BLD.COM $ sid = "TG4RMS" $! $! $!------------DO NOT EDIT BELOW THIS LINE-------------- $! $ @oracle_home:[util]orauser $! $ define/job/nolog oracle_sid 'sid' $ define/job/nolog ora_sid 'sid' $! $ TG4RMS "(LOCAL=NO)" $!
To customize the startup script, modify the line which sets the value for sid.
The initialization parameter file must be available when the gateway is started. During installation, the following default initialization parameter file is created:
oracle_home:[tg4rms.admin]inittg4rms.ora
where oracle_home is the device under which the gateway is installed.
If you are not using tg4rms as the gateway SID, you must rename the initialization parameter file using the SID you chose in Task 1. This default initialization parameter file is sufficient for starting the gateway, verifying a successful installation, and running the demonstration scripts.
In the initialization parameter file, specify the RMS connection as follows:
HS_FDS_CONNECT_INFO=data_dictionary_directory
where data_dictionary_directory is the directory where the data dictionary files are located. The default value in the initialization parameter file is set as follows:
ora_tg4rms_dd
which is an OpenVMS logical that points to oracle_home:[tg4rms.data_dictionary].
A number of initialization parameters can be used to modify gateway behavior. You might want to change the initialization parameter file later to meet system requirements.
|
See Also: Appendix D, "Heterogeneous Services Initialization Parameters" and the Oracle Database Heterogeneous Connectivity Administrator's Guide for more information about customizing the initialization parameter file. |
The gateway includes a data dictionary, called ADD (Advanced Data Dictionary), which enables SQL access to RMS. This gateway data dictionary consists of a set of RMS record definitions used by the gateway in the same way that normal data dictionary tables are used by an Oracle database server. Each RMS data file is represented by a separate ADD file.
To a client application, the gateway data dictionary appears to be an Oracle data dictionary for the data source. However, the gateway data dictionary and an Oracle data dictionary are not the same.
You need an ADD definition for each RMS record definition. The ADD definition for every RMS record definition is stored in a file called gw_sid.nos on the machine where the data resides.
gw_sid is the name of the database link that points to the correct instance of the TG4RMS and its default value is 'tg4rms'.
The procedure for creating ADD metadata is as follows:
For each RMS data file, create a text file, with a suffix of .adl, that describes the location and record layout of the data file. Use the ADD language (ADDL) to describe the location and record layout of the data file.
|
See Also: Appendix E, "Oracle Transparent Gateway for RMS Metadata Syntax" for details of the ADD language, used to specify the metadata. |
Use the PL/SQL procedure DBMS_TG4RMS.ADDL_TO_ADD() to update the .nos file, which includes a binary representation of the .adl file and must be put in a specific directory which will be used by the gateway as the data dictionary for the RMS files as described in "Task 3: Customize the Initialization Parameter File" on page 2-2.
Repeat this procedure for every RMS data file.
The Oracle Transparent Gateway for RMS comes with a PL/SQL package called DBMS_TG4RMS. This is an administrative package that consists of the following procedures:
| Procedure | Definition |
|---|---|
| addl_to_add() | generates a binary version of the metadata of the RMS file based on the textual description. |
| add_to_addl() | generates a textual version of the metadata of RMS file based on the binary version. |
| update_statistics() | updates the metadata statistics the gateway keeps for a specific RMS file. |
This package is not pre-installed in any of the Oracle databases. A DBA must create these packages in every Oracle database from which these procedures will be called. The package is represented by the following three files: catrms.sql, dbmsrms.sql, and prvtrms.plb. These files can be found in oracle_home:[tg4rms.admin].
To create this package:
Copy the three files to the ORACLE_HOME of the database in which you want to create this package (the scripts are platform independent).
Connect to the Oracle database as SYS using SQLPlus.
Issue the following statement from SQLPlus:
SQL> @catrms
The gateway data dictionary can be populated in one of the following ways:
ADD metadata is created using a special language: the ADD language (ADDL). Use a text editor to create ADD metadata for RMS, using ADDL. Save the file as a text file with an extension of ADL.
The following is an example ADDL file for an RMS record containing information about countries for a mail order application:
DEFINE RECORD NATION
FILENAME IS "DKA300:[USER.RMS_DEMO]nation.INX"
ORGANIZATION IS INDEX
N_ROWS IS 25
RECORD_FORMAT IS FIXED.
FIELDS.
N_NATIONKEY
DATATYPE IS LONGWORD.
N_NAME
DATATYPE IS STRING
SIZE IS 25 CHARACTERS.
N_REGIONKEY
DATATYPE IS LONGWORD.
N_COMMENT
DATATYPE IS STRING
SIZE IS 152 CHARACTERS.
END FIELDS.
INDEXES.
NINDEX.
N_NATIONKEY.
END NINDEX.
END INDEXES.
END RECORD.
This sample file describes the NATION file, including its location (the FILENAME attribute clause), the approximate number of entries (the N_ROWS attribute clause) and the fields and index. If an offset is not specified as part of the field definition, the order and size of the field definitions are used to determine the relevant data in the RMS data file.
|
See Also: Appendix E, "Oracle Transparent Gateway for RMS Metadata Syntax" for details of the ADD language, used to specify the metadata. |
The ADDL file must be compiled as an ADD definition file by executing the following PL/SQL procedure:
begin
dbms_tg4rms.addl_to_add('addl_file', 'dblink');
end;
/
where:
| Variable | Definition |
|---|---|
| addl_file | is the name of the source file including the file name extension that contains ADDL statements. Do not include a directory path, the gateway will look for the ADDL file in data dictionary directory defined for the HS_FDS_CONNECT_INFO initialization parameter.This is a required argument. |
| dblink | is the name of the database link that points to the correct instance of the TG4RMS. This is an optional argument and its default value is 'tg4rms'.
|
|
Note: The gateway caches most of the metadata information. When the procedure addl_to_add() is invoked this cache is not updated. Therefore, you are strongly recommended to start up a new gateway session if you want to select from a RMS file after you've generated a new ADD file. |
|
See Also: Appendix E, "Oracle Transparent Gateway for RMS Metadata Syntax" for more information about gateway metadata. |
You can extend existing ADD metadata by converting the ADD file for the specific RMS record to a text file and then use a text editor to extend this metadata, using the syntax of the Advanced Data Dictionary Language (ADDL). After extending the metadata definition, you compile the text file to an ADD file as described earlier.
Convert the ADD file for an RMS to a text file by executing the following PL/SQL block:
begin
dbms_tg4rms.add_to_addl('rms_record', 'addl_file', 'dblink');
end;
/
where:
| Variable | Definition |
|---|---|
| rms_record | is the name of the RMS record for which you want to generate the ADDL description. The gateway will look for the file gw_sid.nos in the directory identified by the gateway initialization parameter HS_FDS_CONNECT_INFO whose recommended value is oracle_home:[tg4rms.data_dictionary].
gw_sid is the name of the database link that points to the correct instance of the This is a required parameter and must not contain a directory path or a filename extension. |
| addl_file | is the name of the to be generated ADDL file. This is a required parameter and must include a filename extension, but not a directory path. The file will be created in oracle_home:[tg4rms.data_dictionary].
|
| dblink | is the name of the database link that points to the correct instance of the TG4RMS. This is an optional argument and its default value is 'tg4rms'.
|
The gateway requires Oracle Net Services to provide transparent data access. After configuring the gateway, configure Oracle Net Services to work with the gateway.
Oracle Net Services uses the TNS listener to receive incoming connections from a Oracle Net Services client. The TNS listener and the gateway must reside on the same machine.
The TNS listener listens for incoming requests from the Oracle database server. For the TNS listener to listen for the gateway, information about the gateway must be added to the TNS listener configuration file, listener.ora. This file is located in oracle_home:[network.admin], where oracle_home is the device under which the gateway is installed.
|
Note: If Oracle Net Services is reinstalled, the originallistener.ora file is renamed and a new listener.ora file is put into the oracle_home:[network.admin] device.
|
The following entries must be added to the listener.ora file:
A list of Oracle Net Services addresses on which the TNS listener listens
The gateway that the TNS listener starts in response to incoming connection requests
The Oracle database server accesses the gateway using Oracle Net Services and the TCP/IP protocol adapter. The following is the syntax of the connect descriptor entry in the listener.ora file:
LISTENER=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=host_name)
(PORT=port_number))
where:
| Variable | Definition |
|---|---|
| host_name | is the name of the machine on which the gateway is installed. |
| port_number | specifies the port number used by the TNS listener. If you have other listeners running on host_name, the value of port_number must be different from the other listeners' port numbers. |
To direct the TNS listener to start the gateway in response to incoming connection requests, add an entry to the listener.ora file with the following syntax:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=gateway_sid)
(PROGRAM=oracle_home:[tg4rms.admin]tg4rms.com)
)
)
where:
| Variable | Definition |
|---|---|
gateway_sid
|
specifies the SID of the gateway and matches the gateway SID specified in the connect descriptor entry in the tnsnames.ora file.
|
oracle_home: [tg4rms.admin]tg4rms.com
|
specifies the name and location of the startup script used by the listener to spawn the gateway, where oracle_home is the device under which the gateway is installed. |
If you are already running a TNS listener that listens on multiple database SIDs, add only the following syntax to SID_LIST in the existing listener.ora file:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=.
.
)
(SID_DESC=.
.
)
(SID_DESC=
(SID_NAME=gateway_sid)
(PROGRAM=oracle_home:[tg4rms.admin]tg4rms.com)
)
)
|
See Also: Oracle Net Services Administrator's Guide for information about changing thelistener.ora file.
|
The TNS listener must be started to initiate the new settings, as follows:
Set the HP OpenVMS logicals and symbols required to start and stop the gateway listener by executing the orauser.com script located in the utility directory, as follows:
$ @oracle_home:[util]orauser.com
Where oracle_home is the device where the gateway is installed.
If the listener is already running, use the lsnrctl command to stop the listener and then start it with the new settings, as follows:
$ lsnrctl stop $ lsnrctl start
Check the status of the listener with the new settings, as follows:
$ lsnrctl status
The following is an example of output from a lsnrctl status check:
LSNRCTL for VMS: Version 10.1.0.2.0 - Production on 07-DEC-2004 12:26:42 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=204.179.99.15)(PORT=1551)) STATUS of the LISTENER ---------------------- Alias LISTENER Version TNSLSNR for VMS: Version 10.1.0.2.0 - Production Start Date 07-DEC-2004 10:16:17 Uptime 0 days 2 hr. 10 min. 25 sec Trace Level off Security OFF SNMP OFF Listener Parameter File ALPHA$DKA500:[ORA901.NETWORK.ADMIN]listener.ora Listener Log File DISK5:[ORA901.network.log]listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=204.179.99.15)(PORT=1551))) Services Summary... Service "tg4rms" has 1 instance(s). Instance "tg4rms", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully
In this example, tg4rms is the default SID value assigned during installation. You can use any valid ID for the SID, or keep the default.
|
Note: You must use the same SID value in thetnsnames.ora file, the listener.ora file.
|
Any Oracle client connected to the Oracle database server can access RMS data through the gateway. The Oracle client and the Oracle database server can reside on different machines. The gateway accepts connections only from the Oracle database server.
Before you use the gateway to access RMS data you must configure the Oracle database server to enable communication with the gateway over Oracle Net Services.
To configure the server you add connect descriptors to the tnsnames.ora file. You cannot use the Oracle Net Services Assistant or the Oracle Net Services Easy Config tools to configure the tnsnames.ora file. You must edit the file manually.
|
See Also: Oracle Database Administrator's Guide for information about editing thetnsnames.ora file.
|
For the Oracle database server to access the gateway, it needs a service name entry or a connect descriptor name entry in the tnsnames.ora file to tell the Oracle database server where to make connections. By default, this file is in oracle_home: [network.admin], where oracle_home is the device under which the gateway is installed. The tnsnames.ora file is required by the Oracle database server accessing the gateway, but not by the gateway.
Edit the tnsnames.ora file to add a connect descriptor for the gateway. The following is an example of the Oracle Net Services entries using TCP/IP protocol needed for the Oracle database server to access the gateway:
connect_descriptor= (DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (HOST=host_name) (PORT=port_number) ) (CONNECT_DATA= (SID=gateway_sid)) (HS=OK))
where:
| Variable | Definition |
|---|---|
| connect_descriptor | is the description of the object to connect to as specified when creating the database link, such as tg4rms.
Check the
Note: If the Oracle database server is on HP OpenVMS, the file is If the |
TCP
|
is the TCP protocol used for TCP/IP connections. |
| host_name | specifies the machine where the gateway is running. |
| port_number | matches the port number used by the Oracle Net Services TNS listener that is listening for the gateway. The TNS listener's port number can be found in the listener.ora file used by the TNS listener. See "Example of Address to Listen On in listener.ora File".
|
| gateway_sid | specifies the SID of the gateway and matches the SID specified in the listener.ora file of the TNS listener that is listening for the gateway. See "Task 1: Configure Oracle Net Services TNS Listener for the Gateway" for more information.
|
(HS=OK)
|
specifies that this connect descriptor uses the Oracle Heterogeneous Services option. |
Any Oracle client connected to the Oracle database server can access RMS data through the gateway. The Oracle client and the Oracle database server can reside on different machines. The gateway accepts connections only from the Oracle database server.
A connection to the gateway is established through a database link when it is first used in an Oracle session. In this context, a connection refers to the connection between the Oracle database server and the gateway. The connection remains established until the Oracle session ends. Another session or user can access the same database link and get a distinct connection to the gateway and RMS data.
Database links are active for the duration of a gateway session. If you want to close a database link during a session, you can do so with the ALTER SESSION statement. The database and application administrators of a distributed database system are responsible for managing the necessary database links that define paths to the RMS data.
|
See Also: Oracle Database Administrator's Guide and Oracle Database Heterogeneous Connectivity Administrator's Guide for more information about using database links. |
The tasks for configuring the gateway to access RMS data using multiple data dictionaries are similar to the tasks for configuring the gateway for a single data dictionary. The configuration example assumes the following:
The gateway is installed and configured with the default SID of tg4rms
The gateway is configured for one data dictionary named db1
Two data dictionaries named db2 and db3 on a server named rms_alpha are being added
Configuring the gateway for additional data dictionaries involves the following:
Configuring the gateway startup and initialization files
Configuring Oracle Net Services for the gateway and the Oracle database server
Choose Two System IDs for Each RMS Data Dictionary
A separate instance of the gateway accesses the different data dictionaries. Each instance needs its own gateway System ID (SID). For this example, the gateway SIDs are chosen for the instances that access the data dictionaries:
tg4rms2 for the gateway accessing data dictionary db2
tg4rms3 for the gateway accessing data dictionary db3
Create Two Gateway Startup Files
Create a startup file for each gateway sid; tg4rms2.com for gateway sid tg4rms2 and tg4rms3.com for gateway sid tg4rms3, by copying the default startup file that was created during install (tg4rms).
Change the value of the SID in these files tg4rms2 and tg4rms3 respectively.
Create Two Initialization Parameter Files
Create an initialization parameter file for each instance of the gateway by copying the original initialization parameter file, oracle_home:[tg4rms.admin]inittg4rms.ora, twice, naming one with the gateway SID for db2 and the other with the gateway SID for db3:
$ cd oracle_home:[tg4rms.admin] $ copy inittg4rms.ora inittg4rms2.ora $ copy inittg4rms.ora inittg4rms2.ora
Change the value of the HS_FDS_CONNECT_INFO parameter in the new files.
For inittg4rms2.ora, enter the following:
HS_FDS_CONNECT_INFO=data_dictionary_directory2
For inittg4rms3.ora, enter the following:
HS_FDS_CONNECT_INFO=data_dictionary_directory3
where data_dictionary_directory2 and data_dictionary_directory3 are the different directories where the gateway metadata is stored.
|
Note: If you have multiple gateway SIDs for the same RMS database because you want to use different gateway parameter settings at different times, follow the same procedure. You create several initialization parameter files, each with different SIDs and different parameter settings. |
Add two new entries to the TNS listener configuration file, listener.ora. You must have an entry for each gateway instance, even when multiple gateway instances access the same data dictionary.
The following example shows the entry for the original installed gateway first, followed by the new entries:
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=tg4rms)
(PROGRAM=oracle_home:[tg4rms.admin]tg4rms.com)
)
(SID_DESC=
(SID_NAME=tg4rms2)
(PROGRAM=oracle_home:[tg4rms.admin]tg4rms2.com)
)
(SID_DESC=
(SID_NAME=tg4rms3)
(PROGRAM=oracle_home:[tg4rms.admin]tg4rms3.com)
)
)
Set the HP OpenVMS logicals required to start the gateway listener by executing the orauser.com script located in the utility directory, as follows:
$ @oracle_home:[util]orauser.com
where oracle_home is the device under which the gateway is installed.
If the listener is already running, use the lsnrctl command to stop the listener and then start it with the new settings, as follows:
$ lsnrctl stop $ lsnrctl start
Configure Oracle Net Services on the Oracle Database Server for Multiple Gateway Instances
Add two connect descriptor entries to the tnsnames.ora file. You must have an entry for each gateway instance, even if the gateway instances access the same data dictionary.
The following RMS example shows the entry for the original installed gateway first, followed by the two entries for the new gateway instances:
old_db_using=(DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (PORT=1541) (HOST=gtwhost)) (CONNECT_DATA= (SID=tg4rms)) (HS=OK)) new_db2_using=(DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (PORT=1541) (HOST=gtwhost)) (CONNECT_DATA= (SID=tg4rms2)) (HS=OK)) new_db3_using=(DESCRIPTION= (ADDRESS= (PROTOCOL=TCP) (PORT=1541) (HOST=gtwhost)) (CONNECT_DATA= (SID=tg4rms3)) (HS=OK))
The value for PORT is the TCP/IP port number of the TNS listener that is listening for the gateway. The number can be found in the listener.ora file used by the TNS listener. The value for HOST is the name of the machine on which the gateway is running. The name also can be found in the listener.ora file used by the TNS listener.
Enter the following to create a database link for the tg4rms2 gateway:
SQL> CREATE PUBLIC DATABASE LINK RMS2 USING 'new_db2_using';
Enter the following to create a database link for the tg4rms3 gateway:
SQL> CREATE PUBLIC DATABASE LINK RMS3 USING 'new_db3_using';
After the database links are established you can query the RMS data, as in the following:
SQL> SELECT * FROM ALL_USERS@RMS2;
or
SQL> SELECT * FROM ALL_USERS@RMS3;