| Oracle9i Messaging Gateway Supplement Release 1 (9.0.1) Part Number A90837-01 |
|
This chapter describes the steps for installing Messaging Gateway and some related troubleshooting notes.
The following topics are discussed in this chapter:
In the init<sid>.ora file, where <sid> is the Oracle system ID of the database instance used for Messaging Gateway, the following parameters must be specified:
8.1.0.0 or later:
compatible = 8.1.0.0
JOB_QUEUE_PROCESSES = <num_of_processes>
AQ_TM_PROCESSES = <num_of_processes>
Install the non-Oracle messaging system before installing Messaging Gateway. Messaging Gateway uses the shared libraries and Java class files of the non-Oracle system.
Run the Oracle Universal Installer to install Messaging Gateway. The installer copies the files to the $ORACLE_HOME directory. You can run the installer when the database is running or not running.
To start the Installer, do the following:
oracle.
cd <cdrom_mount_point_directory>/solaris.
./runInstaller.
After running the Oracle Universal Installer, verify that the following contents are present in the $ORACLE_HOME/mgw directory:
$ORACLE_HOME/mgw/admin
$ORACLE_HOME/mgw/classes
$ORACLE_HOME/mgw/doc
$ORACLE_HOME/mgw/lib
$ORACLE_HOME/mgw/log
$ORACLE_HOME/mgw/samples
$ORACLE_HOME/mgw/lib/libmgwagent.so
$ORACLE_HOME/mgw/classes/mgw.jar
$ORACLE_HOME/mgw/admin/catmgw.sql
$ORACLE_HOME/mgw/admin/catnomgw.sql
$ORACLE_HOME/mgw/admin/dbmsmgw.sql
$ORACLE_HOME/mgw/admin/*.plb
Before Messaging Gateway can run, you must modify the following system files:
You must modify listener.ora and tnsnames.ora so that the PL/SQL package can call the external procedure. You must modify mgw.ora so that it contains the correct parameters and environment variables for the external procedure to start the gateway agent. You also need to change tnsnames.ora so that it contains a database connect string that the gateway agent uses to connect back to the database.
You must do the following postinstallation procedures before Messaging Gateway can run:
Using SQL*Plus, run catmgw.sql, located in the $ORACLE_HOME/mgw/admin directory. Run as user: SYS as SYSDBA.
The SQL script catmgw.sql loads the necessary database objects for Messaging Gateway, including roles, tables, views, object types, and the PL/SQL packages. It creates public synonyms for Messaging Gateway PL/SQL packages and types. It creates two roles, MGW_ADMINISTRATOR_ROLE and MGW_AGENT_ROLE, with certain privileges granted. It also creates a library alias for the agent's external procedure. All objects are owned by SYS.
LISTENER = (ADDRESS_LIST= (ADDRESS= (PROTOCOL=IPC) (KEY=EXTPROC)) . . .
listener.ora, add static service information for the listener in step 1. This involves setting a SID_DESC for the listener. Within the SID_DESC, the following parameters are important to Messaging Gateway and must be specified according to your own situation.
SID_NAME: provide the SID specified in the net service name in tnsnames.ora, for example, "mgwextproc".
ORACLE_HOME: provide your ORACLE_HOME directory.
PROGRAM: provide the name of the external procedure agent, which is "extproc".
ENVS: set up the LD_LIBRARY_PATH environment needed for the external procedure to run.
The LD_LIBRARY_PATH must contain the following paths:
[JDK_HOME]/jre/lib/[PLATFORM_TYPE]
[ORACLE_HOME]/lib
Replace the bracketed item with the appropriate, spelled-out value (using $ORACLE_HOME does not work, for example). PLATFORM_TYPE is your platform type, for example, sparc.
# Add a SID_DESC SID_LIST_LISTENER= (SID_LIST= (SID_DESC = (SID_NAME= mgwextproc) (ENVS="LD_LIBRARY_PATH=/private/oracle/orcl9i/Apache/jdk/jre/lib/ sparc:/private/oracle/orcl9i/lib") (ORACLE_HOME=/private/oracle/orcl9i) (PROGRAM = extproc)) . . .
For the external procedure, configure a net service name MGW_AGENT in tnsnames.ora whose connect descriptor matches the information configured in listener.ora. The net service name must be MGW_AGENT (this value is fixed). The KEY value must match the KEY value specified for the IPC protocol in listener.ora. The SID value must match the value specified for SID_NAME of the SID_DESC entry in listener.ora.
MGW_AGENT = (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=IPC)(KEY=EXTPROC))) (CONNECT_DATA= (SID=mgwextproc) (PRESENTATION=RO)))
The Messaging Gateway configuration file $ORACLE_HOME/mgw/admin/mgw.ora is a TEXT file that the gateway external procedure uses to get further configuration information. Copy $ORACLE_HOME/mgw/admin/sample_mgw.ora to mgw.ora and modify it according to your situation.
The following procedure sets environment variables and other parameters:
The ENVS parameter in listener.ora sets only enough environment to run the external procedure. The environment needed to start the gateway agent is set in mgw.ora.
Set the following environment variables:
LD_LIBRARY_PATH must contain at least the following paths.
[JDK_HOME]/jre/lib/[PLATFORM_TYPE]
[ORACLE_HOME]/rdbms/lib
[ORACLE_HOME]/oracle/lib
[ORACLE_HOME]/mgw/lib
LD_LIBRARY_PATH.
Replace the brackets with appropriate, spelled-out values (using $ORACLE_HOME does not work, for example). PLATFORM_TYPE is your platform type, for example, sparc.
CLASSPATH must contain at least the following:
[ORACLE_HOME]/mgw/classes/mgw.jar
[JDK_HOME]/jre/lib/i18n.jar
[JDK_HOME]/jre/lib/rt.jar
[ORACLE_HOME]/jdbc/lib/classes12.zip
[ORACLE_HOME]/jdbc/lib/nls_charset12.zip
[ORACLE_HOME]/sqlj/lib/translator.zip
[ORACLE_HOME]/sqlj/lib/runtime.zip
Replace the brackets with appropriate, spelled-out values (using $ORACLE_HOME does not work, for example).
log_directory and log_level parameters.
Setting these parameters is not required. They influence the logging of Messaging Gateway. If they are not set, the default values are used. For log_directory, the default value is $ORACLE_HOME/mgw/log. For log_level, the default value is 0 for basic logging.
#an example of mgw.ora file log_directory=/private/mgwlog log_level=2 set CLASSPATH=<proper value> set LD_LIBRARY_PATH=<proper value>
Configure a net service name in tnsnames.ora for the gateway agent to connect back to the database. Use this service name for the procedure in "Configuring Messaging Gateway Connection Information".
AGENT_SERVICE = (ADDRESS_LIST= (ADDRESS= (PROTOCOL=IPC)(KEY=EXTPROC)) (CONNECT_DATA= (SID=mgwsid)))
To perform gateway administration work, a database user with MGW_ADMINISTRATOR_ROLE privileges must be created.
CREATE USER <admin_user> IDENTIFED BY <admin_password>; GRANT CONNECT, RESOURCE to <admin_user>; GRANT MGW_ADMINISTRATOR_ROLE to <admin_user>;
To establish the gateway agent's connection back to the database, a database user with MGW_AGENT_ROLE privileges must be created.
CREATE USER <agent_user> IDENTIFED BY <agent_password>; GRANT CONNECT, RESOURCE to <agent_user>; GRANT MGW_AGENT_ROLE to <agent_user>;
After the agent user is created, the administration user uses DBMS_MGWADM.DB_CONNECT_INFO to configure Messaging Gateway with the user name, password, and database connect string used by the gateway agent to connect back to database. Refer to "Modifying tnsnames.ora for the Gateway Agent's Connection to the Database".
connect <admin_user>/<admin_password> exec dbms_mgwadm.db_connect_info('<agent_user>','<agent_password>', '<agent_ database>');
The following procedure verifies the installation and includes a simple startup and shutdown of the Messaging Gateway agent.
Start the listener for the external procedure and other listeners for the regular database connection.
Run sqlplus <agent_user>/<agent_password>@<agent_database>.
If successful, the gateway agent is able to connect to the database.
Before uninstalling Messaging Gateway, do the following:
MGW_BASIC_MSG_T).
The following procedure uninstalls Messaging Gateway:
SYS as SYSDBA, run catnomgw.sql, located in the $ORACLE_HOME/mgw/admin directory.
This drops the database objects used by Messaging Gateway, including the roles, tables, views, packages, object types, and synonyms.
This removes the Messaging Gateway files.
listener.ora and tnsnames.ora back to the original state.
The following problems and solutions may help you during installation troubleshooting.
Messaging Gateway has been started but the MGW_GATEWAY view always shows an AGENT_STATUS value of START_SCHEDULED.
Messaging Gateway uses job queues in the Oracle database to start the agent process. SNP background processes execute jobs in job queues. At least one SNP process must be configured to execute queued jobs in the background. The gateway job is scheduled to execute immediately, but will not do so until an SNP process is available. If the gateway status remains START_SCHEDULED for an extended period of time, it may indicate that the database instance has been started with no or too few SNP background processes.
Verify that the database instances have been started, with one SNP process for Messaging Gateway.
init.ora parameters:
JOB_QUEUE_PROCESSES specifies the number of job queue processes per instance.
JOB_QUEUE_INTERVAL specifies the interval between wake-ups for SNP processes.
Dynamic parameters: ALTER SYSTEM SET JOB_QUEUE_PROCESSES = <number>;
Messaging Gateway has been started but the MGW_GATEWAY view shows an AGENT_STATUS value of NOT_STARTED, and LAST_ERROR_MSG has no value.
This may indicate that the gateway agent process encountered a fatal error and has terminated. Whenever the agent process terminates, the agent status is set to NOT_STARTED and the queued job used to start the gateway agent ends.
Normally, the agent status will progress through the following values when the gateway is started:
Check the Messaging Gateway log file for errors. By default, the log file is in the $ORACLE_HOME/mgw/log directory.
Messaging Gateway has been started but the MGW_GATEWAY view shows a nonnull error message for LAST_ERROR_MSG.
The MGW_GATEWAY view provides status information about the gateway agent. A nonnull value for LAST_ERROR_MSG indicates that the listener was unable to start the gateway agent process or that some other error occurred when attempting to call the external procedure that starts the gateway agent.
tnsnames.ora and listener.ora are correct.
Incorrect or mismatched values will prevent the listener from starting the gateway agent process.
For example, if LAST_ERROR_MSG is:
ORA-28575: unable to open RPC connection to external procedure agent
Then check the following:
tnsnames.ora must have a net service name entry named MGW_AGENT.
CONNECT_DATA of the MGW_AGENT net service name in tnsnames.ora must match the SID_NAME value of the SID_DESC entry in listener.ora.
MGW_AGENT net service name is set up for an IPC connection, the KEY values for ADDRESS in tnsnames.ora and listener.ora must match.
tnsnames.ora or listener.ora may be incorrect or not match.
|
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|