Oracle mgw что это
The following topics describe Oracle Messaging Gateway (MGW) prerequisites and how to load, set up, and unload Messaging Gateway. They also describe how to set up and modify the mgw.ora initialization file.
18.2 Loading and Setting Up Oracle Messaging Gateway
Perform the following procedures before running Messaging Gateway:
These setup instructions are specific to 32-bit versions of the Windows and Linux x86 operating systems. The tasks apply to both Windows and Linux operating systems, except where "Windows Operating System Only" or "Linux Operating System Only" is indicated. For other operating systems, see Oracle Database Installation Guide 10 g Release 2 (10.2) for UNIX Systems: AIX-Based Systems, HP Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel and Sun Solaris .
18.2.7 Configuring Oracle Messaging Gateway Connection Information
For this release, always specify a not NULL value for the database connect string parameter when calling DBMS_MGWADM.DB_CONNECT_INFO .
Loading Database Objects into the Database
Using SQL*Plus, run ORACLE_HOME /mgw/admin/catmgw.sql as user SYS as SYSDBA . This script loads the database objects necessary for Messaging Gateway, including roles, tables, views, object types, and PL/SQL packages. It creates public synonyms for Messaging Gateway PL/SQL packages. It creates two roles, MGW_ADMINISTRATOR_ROLE and MGW_AGENT_ROLE, with certain privileges granted. All objects are owned by SYS .
In a CDB environment, run ORACLE_HOME /mgw/admin/catmgw.sql as PDB root.
18.2.1 Loading Database Objects into the Database
Using SQL*Plus, run ORACLE_HOME /mgw/admin/catmgw.sql as user SYS as SYSDBA . This script loads the database objects necessary for Messaging Gateway, including roles, tables, views, object types, and PL/SQL packages. It creates public synonyms for Messaging Gateway PL/SQL packages. It creates two roles, MGW_ADMINISTRATOR_ROLE and MGW_AGENT_ROLE, with certain privileges granted. All objects are owned by SYS .
Setting Up an mgw.ora Initialization File
The Messaging Gateway default initialization file ORACLE_HOME /mgw/admin/mgw.ora is a text file. The Messaging Gateway external procedure uses it to get initialization parameters to start the Messaging Gateway agent. 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 required for all applications of Messaging Gateway:
Windows Operating System Only: Set the MGW_PRE_PATH variable. Its value is the path to the jvm.dll library:
This variable is prepended to the path inherited by the Messaging Gateway agent process.
Set CLASSPATH to include at least the following:
JRE runtime classes:
Oracle JDBC classes:
Oracle internationalization classes:
Oracle JMS implementation classes
Any additional classes needed for Messaging Gateway to access non-Oracle messaging systems
Replace ORACLE_HOME with the appropriate, spelled-out value. Using $ORACLE_HOME , for example, does not work.
Users of the Windows operating system must set CLASSPATH using the Windows operating system path syntax.
18.1 Oracle Messaging Gateway Prerequisites
Messaging Gateway uses one Oracle Scheduler job for each Messaging Gateway agent. If the value of the JOB_QUEUE_PROCESSES database initialization parameter is zero, then no Oracle Scheduler jobs will run. If the value is non-zero, it effectively becomes the maximum number of Scheduler jobs and job queue jobs that can run concurrently.
Verify that a non-zero value is set, and that it is large enough to accommodate a Scheduler job for each Messaging Gateway agent to be started.
mgw.ora Initialization Parameters
The initialization parameters are typically specified by lines having a " name = value " format where name represents the parameter name, value represents its value and represents a new line.
log_directory
Usage:
Specifies the directory where the Messaging Gateway log/trace file is created.
Format:
Default:
Example:
log_level
Usage:
Specifies the level of logging detail recorded by the Messaging Gateway agent. The logging level can be dynamically changed by the dbms_mgwadm.set_log_level API while the Messaging Gateway agent is running. Oracle recommends that log level 0 (the default value) be used at all times.
Format:
Values:
0 for basic logging; equivalent to dbms_mgwadm.BASIC_LOGGING
1 for light tracing; equivalent to dbms_mgwadm.TRACE_LITE_LOGGING
2 for high tracing; equivalent to dbms_mgwadm.TRACE_HIGH_LOGGING
3 for debug tracing; equivalent to dbms_mgwadm.TRACE_DEBUG_LOGGING
Example:
Configuring Oracle Messaging Gateway in an Oracle RAC Environment
This section contains these topics:
Configuring Connection Information for the MGW Agent Connections
You must make all database connections made by the Messaging Gateway agent to the instance on which the Messaging Gateway agent process is running. This ensures correct failover behavior in an Oracle RAC environment. You can configure connections this way by having the instances use slightly different tnsnames.ora files. Each file contains an entry with the same net service name, but the connect data refers to only the instance associated with that tnsnames.ora file. The common net service name would then be used for the database parameter when DBMS_MGWADM.ALTER_AGENT is used to configure the Messaging Gateway agent database connection information.
For example, in a two-instance Oracle RAC environment with instances OraDB1 and OraDB2 , where the net service name AGENT_DB is to be used, the tnsnames.ora for instance OraDB1 would look like this:
The tnsnames.ora for OraDB2 would look like this:
You would then configure Messaging Gateway agent user connection information by running the following command:
Setting the Oracle RAC Instance for the Messaging Gateway Agent
Messaging Gateway provides service affinity for the Messaging Gateway agent external process by leveraging the database service support of the Oracle Scheduler. By default, a Messaging Gateway agent will use the default database service that is mapped to all instances. If you want a Messaging Gateway agent to start on a select group of database instances, you must create a database service for those instances and then assign the database service to the Messaging Gateway agent using the SERVICE parameter of the DBMS_MGWADM . CREATE_AGENT or DBMS_MGWADM . ALTER_AGENT procedures. The DBMS_MGWADM . STARTUP procedure submits an Oracle Scheduler job that starts the Messaging Gateway agent external process when the Scheduler job is executed. The Scheduler job will use the database service configured for the Messaging Gateway agent.
The database service specified by the SERVICE parameter is only used for the service affinity of the Oracle Scheduler job and thus the service affinity for the Messaging Gateway external process. It is not used for the database connections made by the Messaging Gateway agent user. Those JDBC client connections are based on the values specified for the DATABASE and CONNTYPE parameters.
This chapter describes Oracle Messaging Gateway (MGW) prerequisites and how to load, set up, and unload Messaging Gateway. It also describes how to set up and modify the mgw.ora initialization file.
This chapter contains these topics:
Setting Up a mgw.ora Initialization File
The Messaging Gateway initialization file ORACLE_HOME /mgw/admin/mgw.ora is a text file. The Messaging Gateway external procedure uses it to get initialization parameters to start the Messaging Gateway agent. 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 required for all applications of Messaging Gateway:
Windows Operating System Only: Set the MGW_PRE_PATH variable. Its value is the path to the jvm.dll library:
This variable is prepended to the path inherited by the Messaging Gateway agent process.
Set CLASSPATH to include at least the following:
Messaging Gateway classes:
JRE runtime classes:
Oracle JDBC classes:
Oracle internationalization classes:
Oracle JMS implementation classes
Any additional classes needed for Messaging Gateway to access non-Oracle messaging systems
See Also:
Note:
Replace ORACLE_HOME with the appropriate, spelled-out value. Using $ORACLE_HOME , for example, does not work.
Users of the Windows operating system must set CLASSPATH using the Windows operating system path syntax.
Setting Up for TIB/Rendezvous
Running as a TIB/Rendezvous Java client application, the Messaging Gateway agent requires TIB/Rendezvous software to be installed on the computer where the Messaging Gateway agent runs. In this section TIBRV_HOME refers to the installed TIB/Rendezvous software location.
Modifying listener.ora
On the Solaris operating system, LD_LIBRARY_PATH in the entry for Messaging Gateway must include TIBRV_HOME /lib for the agent to access TIB/Rendezvous shared library files.
See Also:
On the Windows operating system, you are not required to modify listener.ora . But the system environment variable PATH must include TIBRV_HOME \bin .
Modifying mgw.ora
MGW_PRE_PATH must include the directory that contains the TIB/Rendezvous license ticket file ( tibrv.tkt ), which usually is located in TIBRV_HOME/bin .
CLASSPATH must include the TIB/Rendezvous jar file TIBRV_HOME /lib/tibrvj.jar . If you use your own customized TIB/Rendezvous advisory message callback, then the location of the callback class must also be included.
You can set the following Java properties to change the default setting:
See Also:
Example 19-6 Setting Java Properties
18.1 Oracle Messaging Gateway Prerequisites
Messaging Gateway uses one Oracle Scheduler job for each Messaging Gateway agent. If the value of the JOB_QUEUE_PROCESSES database initialization parameter is zero, then no Oracle Scheduler jobs will run. If the value is non-zero, it effectively becomes the maximum number of Scheduler jobs and job queue jobs that can run concurrently.
Verify that a non-zero value is set, and that it is large enough to accommodate a Scheduler job for each Messaging Gateway agent to be started.
18.1 Oracle Messaging Gateway Prerequisites
Messaging Gateway requires two job queue processes in addition to those used for other purposes. You can set the number of job queue processes in the init sid .ora file, where sid is the Oracle system ID of the database instance used for Messaging Gateway:
Configuring Oracle Messaging Gateway in a RAC Environment
The DBMS_MGWADM.STARTUP procedure submits a job queue job that starts the Messaging Gateway agent external process when the job is executed. You can use the instance and force parameters to control the job and instance affinity. By default the job is set up so that it can be run by any instance.
Oracle Messaging Gateway Architecture
Messaging Gateway has two main components:
Administration Package DBMS_MGWADM
Messaging Gateway Agent
Figure 17-1 shows how these components work together with Oracle Database and non-Oracle messaging systems.
Figure 17-1 Messaging Gateway Architecture
Administration Package DBMS_MGWADM
The Messaging Gateway administration package DBMS_MGWADM provides an interface for creating named Messaging Gateway agents, managing agents, creating messaging system links, registering non-Oracle queues, and setting up propagation jobs.
Users call the procedures in the package to make configuration changes regardless of whether the Messaging Gateway agent is running. If the Messaging Gateway agent is running, then the procedures in the package send notifications for configuration changes to the agent. The agent dynamically alters its configuration for most configuration changes, although some changes require that the agent be shut down and restarted before they take effect. All the procedures in the package are serialized to guarantee that the Messaging Gateway agent receives and processes notifications in the same order as they are made.
Oracle Messaging Gateway Agent
The Messaging Gateway agent runs as an external process of the Oracle Database server and processes propagation jobs. It is started and shut down by calling the STARTUP and SHUTDOWN procedures in DBMS_MGWADM package.
The Messaging Gateway agent contains a multithreaded propagation engine and a set of drivers for messaging systems. The propagation engine fairly schedules propagation jobs and processes propagation jobs concurrently. The polling thread in the agent periodically polls the source queues of enabled propagation jobs and wakes up worker threads to process propagation jobs if messages are available. The drivers for non-Oracle messaging systems run as clients of the messaging systems for all messaging operations.
Oracle Database
As an Oracle Database feature, Messaging Gateway provides a mechanism of message propagation between Oracle Database Advanced Queuing and non-Oracle messaging systems. Oracle Database Advanced Queuing is involved in every propagation job as either propagation source or propagation destination.
Messaging Gateway is managed through the PL/SQL administration package DBMS_MGWADM . All configuration information and execution state information of Messaging Gateway are stored in Oracle Database and can be accessed through database views.
The Messaging Gateway agent runs as an external procedure of the Oracle Database server. Therefore, it runs only when its associated database server is running.
Non-Oracle Messaging Systems
The Messaging Gateway agent connects to non-Oracle messaging systems through messaging system links. Messaging system links are communication channels between the Messaging Gateway agent and non-Oracle messaging systems. Users can use the administration package DBMS_MGWADM to configure multiple links to the same or different non-Oracle messaging systems.
Queues in non-Oracle messaging systems, such as WebSphere MQ queues, TIB/Rendezvous subjects, and WebSphere MQ JMS destinations (queues and topics) can all serve as propagation sources and destinations for Messaging Gateway. They are referred to as foreign queues. All foreign queues involved in message propagation as source queues, destination queues, or exception queues must be registered through the administration package. The registration of a foreign queue does not create the physical queue in a non-Oracle messaging system, but merely records information about the queue, such as the messaging system link to access it, its native name, and its domain (queue or topic). The physical queue must be created through the administration interface of the non-Oracle messaging system.
18.2.4 Setting Up a mgw.ora Initialization File
The Messaging Gateway initialization file ORACLE_HOME /mgw/admin/mgw.ora is a text file. The Messaging Gateway external procedure uses it to get initialization parameters to start the Messaging Gateway agent. 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 required for all applications of Messaging Gateway:
Windows Operating System Only: Set the MGW_PRE_PATH variable. Its value is the path to the jvm.dll library:
This variable is prepended to the path inherited by the Messaging Gateway agent process.
Set CLASSPATH to include at least the following:
JRE runtime classes:
Oracle JDBC classes:
Oracle internationalization classes:
Oracle JMS implementation classes
Any additional classes needed for Messaging Gateway to access non-Oracle messaging systems
Replace ORACLE_HOME with the appropriate, spelled-out value. Using $ORACLE_HOME , for example, does not work.
Users of the Windows operating system must set CLASSPATH using the Windows operating system path syntax.
Loading Database Objects into the Database
Using SQL*Plus, run ORACLE_HOME /mgw/admin/catmgw.sql as user SYS as SYSDBA . This script loads the database objects necessary for Messaging Gateway, including roles, tables, views, object types, and PL/SQL packages. It creates public synonyms for Messaging Gateway PL/SQL packages. It creates two roles, MGW_ADMINISTRATOR_ROLE and MGW_AGENT_ROLE, with certain privileges granted. All objects are owned by SYS .
Verifying the Oracle Messaging Gateway Setup
The following procedure verifies the setup and includes a simple startup and shutdown of the Messaging Gateway agent:
Start the database listeners.
Start the listener for the external procedure and other listeners for the regular database connection.
Test the database connect string for the Messaging Gateway agent user.
Run sqlplus agent_user / agent_password @ agent_database .
If it is successful, then the Messaging Gateway agent is able to connect to the database.
Solaris Operating System Only: Test the net service entry used to call the external procedure.
Run sqlplus agent_user / agent_password @ MGW_AGENT .
This should fail with "ORA-28547: connection to server failed, probable Oracle Net admin error". Any other error indicates that the tnsnames.ora , listener.ora , or both are not correct.
Connect as admin_user and call DBMS_MGWADM.STARTUP to start the Messaging Gateway agent.
Using the MGW_GATEWAY view, wait for AGENT_STATUS to change to RUNNING and AGENT_PING to change to REACHABLE .
Connect as admin_user and call DBMS_MGWADM.SHUTDOWN to shut down the Messaging Gateway agent.
Using the MGW_GATEWAY view, wait for AGENT_STATUS to change to NOT_STARTED .
Creating an Oracle Messaging Gateway Administrator User
Creating an Oracle Messaging Gateway Agent User
To establish the Messaging Gateway agent connection back to the database, a database user with MGW_AGENT_ROLE privileges must be created, as shown in Example 19-4.
Example 19-4 Creating an Messaging Gateway Agent User
Configuring Oracle Messaging Gateway Connection Information
After the Messaging Gateway agent user is created, the administration user uses DBMS_MGWADM.DB_CONNECT_INFO to configure Messaging Gateway with the username, password, and database connect string used by the Messaging Gateway agent to connect back to the database, as shown in Example 19-5. Use the Messaging Gateway username and password that you created in "Creating an Oracle Messaging Gateway Agent User". The database connect string parameter can be set to either a net service name in tnsnames.ora (with IPC protocol for better performance) or NULL . If NULL , then the oracle_sid parameter must be set in mgw.ora .
For Oracle Database release 10.1, always specify a not NULL value for the database connect string parameter when calling DBMS_MGWADM.DB_CONNECT_INFO .
Example 19-5 Configuring Messaging Gateway Connection Information
Oracle Messaging Gateway Prerequisites
Messaging Gateway uses one Oracle Scheduler job for each Messaging Gateway agent. If the value of the JOB_QUEUE_PROCESSES database initialization parameter is zero, then no Oracle Scheduler jobs will run. If the value is non-zero, it effectively becomes the maximum number of Scheduler jobs and job queue jobs that can run concurrently.
Verify that a non-zero value is set, and that it is large enough to accommodate a Scheduler job for each Messaging Gateway agent to be started.
Oracle Messaging Gateway Features
Messaging Gateway provides the following features:
Extends Oracle Database Advanced Queuing message propagation
Messaging Gateway propagates messages between Oracle Database Advanced Queuing and non-Oracle messaging systems. Messages sent by Oracle Database Advanced Queuing applications can be received by non-Oracle messaging system applications. Conversely, messages published by non-Oracle messaging system applications can be consumed by Oracle Database Advanced Queuing applications.
Support for Java Message Service (JMS) messaging systems
Messaging Gateway propagates messages between Oracle Java Message Service (Oracle JMS) and WebSphere MQ Java Message Service (WebSphere MQ JMS).
Native message format support
Messaging Gateway supports the native message formats of messaging systems. Oracle Database Advanced Queuing messages can have RAW or any Oracle object type payload. WebSphere MQ messages can be text or byte messages. TIB/Rendezvous messages can be any TIB/Rendezvous wire format datatype except the nested datatype MSG and those with unsigned integers.
Messaging Gateway facilitates message conversion between Oracle Database Advanced Queuing messages and non-Oracle messaging system messages. Messages are converted through either automatic routines provided by Messaging Gateway or customized message transformation functions that you provide.
Messaging Gateway does not support message propagation between JMS and non-JMS messaging systems.
Oracle Database AQ Sharded Queues are not supported by MGW in 12 c Release 2 (12.2)
Integration with Oracle Database
Messaging Gateway is managed through a PL/SQL interface similar to that of Oracle Database Advanced Queuing. Configuration information is stored in Oracle Database tables. Message propagation is carried out by an external process of the Oracle Database server.
Guaranteed message delivery
If the messaging systems at the propagation source and propagation destination both support transactions, then Messaging Gateway guarantees that persistent messages are propagated exactly once. If messages are not persistent or transactions are not supported by the messaging systems at the propagation source or propagation destination, then at-most-once propagation is guaranteed.
Messaging Gateway supports client authentication of Oracle Database and non-Oracle messaging systems.
Messaging Gateway also allows Secure Socket Layer (SSL) support for IBM WebSphere MQ and WebSphere MQ JMS connections made by the Messaging Gateway agent.
Multiple agent support
Messaging Gateway supports multiple agents for a given database. Users can partition propagation jobs based on functionality, organizations, or workload and assign them to different Messaging Gateway agents. This allows Messaging Gateway to scale in an Oracle RAC environment and enables propagation job grouping and isolation.
18.2.6 Creating an Oracle Messaging Gateway Agent User
Oracle Messaging Gateway Overview
Messaging Gateway enables communication between applications based on non-Oracle messaging systems and Oracle Database Advanced Queuing.
Because Messaging Gateway is integrated with Oracle Database Advanced Queuing and Oracle Database, it offers reliable message delivery. Messaging Gateway guarantees that messages are delivered once and only once between Oracle Database Advanced Queuing and non-Oracle messaging systems that support persistence. The PL/SQL interface provides an easy-to-learn administrative API , especially for developers already proficient in using Oracle Database Advanced Queuing.
This release of Messaging Gateway supports the integration of Oracle Database Advanced Queuing with applications based on WebSphere MQ 9.0 and TIB/Rendezvous 8.2.
Propagation Processing Overview
Propagation jobs must be defined in order for messages to be propagated from one messaging system to another. A propagation job defines the source queue, destination queue, and various other attributes that affect the processing of the propagation job.
If the propagation source is a queue (point-to-point), then the Messaging Gateway agent moves all messages in the queue to the destination. If the propagation source is a topic ( publish/subscribe ), then the Messaging Gateway agent creates a subscription on the propagation source topic. The agent moves all messages that are published to the topic after the subscription is created.
A propagation job is processed when it is enabled. Disabling a propagation job stops propagation processing but does not stop message subscription.
When the Messaging Gateway agent processes a propagation job, it dequeues messages from the source queue and enqueues the messages to the destination queue. As each message is propagated, it is converted from its native format in the source messaging system to its native format in the destination messaging system. Messaging Gateway provides automatic message conversions between simple and commonly used message formats. You can customize message conversions by providing your own message transformation functions.
When the Messaging Gateway agent fails to convert a message from the source format to the destination format, the agent moves the message from the source queue to an exception queue , if the exception queue exists, and continues to process the propagation job.
If the Messaging Gateway agent runs into failures when processing a propagation job, it retries up to sixteen times in an exponential backoff scheme (from two seconds up to thirty minutes) before it stops retrying.
To guarantee reliable message delivery, Messaging Gateway requires logging queues in messaging systems that support transactions and persistent messages. The Messaging Gateway agent uses the logging queues to store the processing states of propagation jobs so that it can restore propagation processing from failures.
Oracle Messaging Gateway Prerequisites
Messaging Gateway requires two job queue processes in addition to those used for other purposes. You can set the number of job queue processes in the init sid .ora file, where sid is the Oracle system ID of the database instance used for Messaging Gateway:
Loading and Setting Up Oracle Messaging Gateway
Perform the following procedures before running Messaging Gateway:
These setup instructions are specific to 32-bit and 64-bit versions of the Windows and 64-bit versions of the Unix-based operating systems. The tasks apply to both Windows and Unix-based operating systems, except where "Windows Operating System Only" or "Linux Operating System Only" is indicated. For other operating systems, see operating-system specific documentation.
18.2 Loading and Setting Up Oracle Messaging Gateway
Perform the following procedures before running Messaging Gateway:
These setup instructions are specific to 32-bit and 64-bit versions of the Windows and 64-bit versions of the Unix-based operating systems. The tasks apply to both Windows and Unix-based operating systems, except where "Windows Operating System Only" or "Linux Operating System Only" is indicated. For other operating systems, see operating-system specific documentation.
18.2.1 Loading Database Objects into the Database
Using SQL*Plus, run ORACLE_HOME /mgw/admin/catmgw.sql as user SYS as SYSDBA . This script loads the database objects necessary for Messaging Gateway, including roles, tables, views, object types, and PL/SQL packages. It creates public synonyms for Messaging Gateway PL/SQL packages. It creates two roles, MGW_ADMINISTRATOR_ROLE and MGW_AGENT_ROLE, with certain privileges granted. All objects are owned by SYS .
In a CDB environment, run ORACLE_HOME /mgw/admin/catmgw.sql as PDB root.
18.2.2 Modifying listener.ora for the External Procedure
This procedure is for Unix-based operating systems only. Static service information for the listener is not necessary on the Windows operating system.
You must modify listener.ora so that the Messaging Gateway PL/SQL packages can call the external procedure.
- Verify that the default Inter-process Communication (IPC) protocol address for the external procedures is set.
The SID that is specified in the net service name in tnsnames.ora . In the following example, the SID_NAME is mgwextproc .
Set up the LD_LIBRARY_PATH environment needed for the external procedure to run. The LD_LIBRARY_PATH must contain the following paths:
It should also contain any additional libraries required by third-party messaging systems. See "Setting Up Non-Oracle Messaging Systems" .
The ENVS value is LD_LIBRARY_PATH_64 for Oracle Solaris on SPARC (64-Bit) and Oracle Solaris on x86-64 (64-Bit), LIBPATH for IBM AIX on POWER Systems, and LD_LIBRARY_PATH for the remaining platforms.
Your Oracle home directory. Using $ORACLE_HOME does not work.
The name of the external procedure agent, which is extproc
JRE_HOME represents the root directory of a JRE installation, just as ORACLE_HOME represents the root directory of an Oracle installation. Oracle recommends that you use the JRE installed with Oracle Database.
18.2.3 Modifying tnsnames.ora for the External Procedure
18.2.4 Setting Up an mgw.ora Initialization File
The Messaging Gateway default initialization file ORACLE_HOME /mgw/admin/mgw.ora is a text file. The Messaging Gateway external procedure uses it to get initialization parameters to start the Messaging Gateway agent. 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 required for all applications of Messaging Gateway:
- Windows Operating System Only: Set the MGW_PRE_PATH variable. Its value is the path to the jvm.dll library:
This variable is prepended to the path inherited by the Messaging Gateway agent process.
JRE runtime classes:
Oracle JDBC classes:
Oracle internationalization classes:
Oracle JMS implementation classes
Any additional classes needed for Messaging Gateway to access non-Oracle messaging systems
Replace ORACLE_HOME with the appropriate, spelled-out value. Using $ORACLE_HOME , for example, does not work.
Users of the Windows operating system must set CLASSPATH using the Windows operating system path syntax.
18.2.5 Creating an Oracle Messaging Gateway Administrator User
18.2.6 Creating an Oracle Messaging Gateway Agent User
18.2.7 Configuring Oracle Messaging Gateway Connection Information
For this release, always specify a not NULL value for the database connect string parameter when calling DBMS_MGWADM.ALTER_AGENT .
18.2.8 Configuring Oracle Messaging Gateway in an Oracle RAC Environment
This section contains these topics:
18.2.8.1 Configuring Connection Information for the MGW Agent Connections
You must make all database connections made by the Messaging Gateway agent to the instance on which the Messaging Gateway agent process is running. This ensures correct failover behavior in an Oracle RAC environment. You can configure connections this way by having the instances use slightly different tnsnames.ora files. Each file contains an entry with the same net service name, but the connect data refers to only the instance associated with that tnsnames.ora file. The common net service name would then be used for the database parameter when DBMS_MGWADM.ALTER_AGENT is used to configure the Messaging Gateway agent database connection information.
For example, in a two-instance Oracle RAC environment with instances OraDB1 and OraDB2 , where the net service name AGENT_DB is to be used, the tnsnames.ora for instance OraDB1 would look like this:
The tnsnames.ora for OraDB2 would look like this:
You would then configure Messaging Gateway agent user connection information by running the following command:
18.2.8.2 Setting the Oracle RAC Instance for the Messaging Gateway Agent
Messaging Gateway provides service affinity for the Messaging Gateway agent external process by leveraging the database service support of the Oracle Scheduler. By default, a Messaging Gateway agent will use the default database service that is mapped to all instances. If you want a Messaging Gateway agent to start on a select group of database instances, you must create a database service for those instances and then assign the database service to the Messaging Gateway agent using the SERVICE parameter of the DBMS_MGWADM . CREATE_AGENT or DBMS_MGWADM . ALTER_AGENT procedures. The DBMS_MGWADM . STARTUP procedure submits an Oracle Scheduler job that starts the Messaging Gateway agent external process when the Scheduler job is executed. The Scheduler job will use the database service configured for the Messaging Gateway agent.
The database service specified by the SERVICE parameter is only used for the service affinity of the Oracle Scheduler job and thus the service affinity for the Messaging Gateway external process. It is not used for the database connections made by the Messaging Gateway agent user. Those JDBC client connections are based on the values specified for the DATABASE and CONNTYPE parameters.
The Messaging Gateway administration package DBMS_MGWADM provides an interface for creating Messaging Gateway agents, managing agents, creating messaging system links, registering non-Oracle queues, and setting up propagation jobs.
Creating an Oracle Messaging Gateway Agent User
18.2.8 Configuring Oracle Messaging Gateway in a RAC Environment
This section contains these topics:
18.2.8.1 Configuring Connection Information for the MGW Agent Connections
Oracle recommends that all database connections made by the Messaging Gateway agent be made to the instance on which the Messaging Gateway agent process is running. This ensures correct failover behavior in a Real Application Clusters (RAC) environment. You can configure connections this way by having the instances use slightly different tnsnames.ora files. Each file contains an entry with the same net service name, but the connect data refers to only the instance associated with that tnsnames.ora file. The common net service name would then be used for the database parameter when DBMS_MGWADM.DB_CONNECT_INFO is used to configure the Messaging Gateway agent database connection information.
For example, in a two-instance RAC environment with instances OraDB1 and OraDB2 , where the net service name AGENT_DB is to be used, the tnsnames.ora for instance OraDB1 would look like this:
The tnsnames.ora for OraDB2 would look like this:
You would then configure Messaging Gateway agent user connection information by running the following command:
18.2.8.2 Setting the RAC Instance for the Messaging Gateway Agent
The DBMS_MGWADM.STARTUP procedure submits a job queue job that starts the Messaging Gateway agent external process when the job is executed. You can use the instance and force parameters to control the job and instance affinity. By default the job is set up so that it can be run by any instance.
Understanding the mgw.ora Initialization File
Messaging Gateway reads initialization information from a text file named mgw.ora when the Messaging Gateway agent starts. The mgw.ora file is located in ORACLE_HOME /mgw/admin .
The Messaging Gateway initialization file mgw.ora contains lines for setting initialization parameters, environment variables, and Java properties. Each entity must be specified on one line. Leading whitespace is trimmed in all cases.
This section contains these topics:
Note:
Setting Up for WebSphere MQ Base Java or JMS
The WebSphere MQ client and WebSphere MQ classes for Java and JMS must be installed on the computer where the Messaging Gateway agent runs. In this section MQ_HOME refers to the location of the installed client. On the Solaris operating system, this location is always /opt/mqm . On the Windows operating system, the installed location can vary.
Modifying listener.ora
No extra modification of listener.ora is necessary for Messaging Gateway to access WebSphere MQ.
Modifying mgw.ora
When using WebSphere MQ Base Java (non-JMS) interface, set CLASSPATH to include at least the following (in addition to those in "Setting Up a mgw.ora Initialization File"):
When using WebSphere MQ JMS interface, set CLASSPATH to include at least the following (in addition to those in "Setting Up a mgw.ora Initialization File"):
Modifying tnsnames.ora for the External Procedure
Unloading Oracle Messaging Gateway
Use this procedure to unload Messaging Gateway:
Shut down Messaging Gateway.
Remove any user-created queues whose payload is an Messaging Gateway canonical type (for example, SYS.MGW_BASIC_MSG_T ).
Using SQL*Plus, run ORACLE_HOME /mgw/admin/catnomgw.sql as user SYS as SYSDBA .
This drops the database objects used by Messaging Gateway, including roles, tables, views, packages, object types, and synonyms.
Remove entries for Messaging Gateway created in listener.ora and tnsnames.ora .
18.2.2 Modifying listener.ora for the External Procedure
This procedure is for Linux 32-bit operating systems only. Static service information for the listener is not necessary on the Windows operating system.
You must modify listener.ora so that the Messaging Gateway PL/SQL packages can call the external procedure.
Verify that the default Inter-process Communication (IPC) protocol address for the external procedures is set.
It should also contain any additional libraries required by third-party messaging systems. See "Setting Up Non-Oracle Messaging Systems".
JRE_HOME represents the root directory of a JRE installation, just as ORACLE_HOME represents the root directory of an Oracle installation. Oracle recommends that you use the JRE installed with Oracle Database.
18.2.3 Modifying tnsnames.ora for the External Procedure
Oracle Database AQ Buffered Messages and Messaging Gateway
Messaging Gateway does not support propagation of buffered messages. In outbound propagation, the Messaging Gateway agent dequeues only persistent messages from AQ queues. In inbound propagation, the Messaging Gateway agent always enqueues persistent messages into AQ queues.
This chapter describes Oracle Messaging Gateway (MGW) prerequisites and how to load, set up, and unload Messaging Gateway. It also describes how to set up and modify the mgw.ora initialization file.
This chapter contains these topics:
Loading and Setting Up Oracle Messaging Gateway
Perform the following procedures before running Messaging Gateway:
Note:
18.2.5 Creating an Oracle Messaging Gateway Administration User
Modifying tnsnames.ora for the External Procedure (Solaris Operating System 32-Bit Only)
For the external procedure, configure a net service name MGW_AGENT in tnsnames.ora whose connect descriptor matches the information configured in listener.ora , as shown in Example 19-2. 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 .
Example 19-2 Configuring MGW_AGENT
Note:
mgw.ora Environment Variables
Because the Messaging Gateway process environment is not under the direct control of the user, certain environment variables should be set using the initialization file. The environment variables currently used by the Messaging Gateway agent are CLASSPATH , MGW_PRE_PATH , and ORACLE_SID .
Environment variables such as CLASSPATH and MGW_PRE_PATH are set so the Messaging Gateway agent can find the required shared objects, Java classes, and so on. Environment variables are specified by lines having a "set env_var = value " or "setenv env_var = value " format where env_var represents the name of the environment variable to set, value represents the value of the environment variable, and represents a new line.
CLASSPATH
Usage:
Used by the Java Virtual Machine to find Java classes needed by the Messaging Gateway agent for propagation between Oracle Streams AQ and non-Oracle messaging systems.
Format:
Example:
MGW_PRE_PATH
Usage:
Appended to the front of the path inherited by the Messaging Gateway process. For the Windows operating system, this variable must be set to indicate where the library jvm.dll is found.
Format:
Example:
ORACLE_SID
Usage:
Can be used when a service name is not specified when configuring Messaging Gateway.
Format:
Example:
Setting Up Non-Oracle Messaging Systems
This section contains these topics:
Configuring Oracle Messaging Gateway Connection Information
For this release, always specify a not NULL value for the database connect string parameter when calling DBMS_MGWADM.ALTER_AGENT .
mgw.ora Comment Lines
This chapter describes Oracle Messaging Gateway (MGW) prerequisites and how to load, set up, and unload Messaging Gateway. It also describes how to set up and modify the mgw.ora initialization file.
This chapter contains these topics:
Modifying listener.ora for the External Procedure (Solaris Operating System 32-Bit Only)
Static service information for the listener is not necessary on the Windows operating system.
You must modify listener.ora so that the Messaging Gateway PL/SQL packages can call the external procedure.
Verify that the default Inter-process Communication (IPC) protocol address for the external procedures is set.
Add static service information for the listener in step 1. This involves setting a SID_DESC for the listener. Within the SID_DESC , the parameters described in Table 19-1 are important to Messaging Gateway and must be specified according to your own situation.
Table 19-1 SID_DESC Parameters
It should also contain any additional libraries required by third-party messaging systems. See "Setting Up Non-Oracle Messaging Systems".
Note:
Example 19-1 adds SID_NAME mgwextproc to a listener.ora file.
Example 19-1 Adding Static Service Information for a Listener
Modifying listener.ora for the External Procedure
This procedure is for Unix-based operating systems only. Static service information for the listener is not necessary on the Windows operating system.
You must modify listener.ora so that the Messaging Gateway PL/SQL packages can call the external procedure.
Verify that the default Inter-process Communication (IPC) protocol address for the external procedures is set.
The SID that is specified in the net service name in tnsnames.ora . In the following example, the SID_NAME is mgwextproc .
Set up the LD_LIBRARY_PATH environment needed for the external procedure to run. The LD_LIBRARY_PATH must contain the following paths:
It should also contain any additional libraries required by third-party messaging systems. See "Setting Up Non-Oracle Messaging Systems".
The ENVS value is LD_LIBRARY_PATH_64 for Oracle Solaris on SPARC (64-Bit) and Oracle Solaris on x86-64 (64-Bit), LIBPATH for IBM AIX on POWER Systems, and LD_LIBRARY_PATH for the remaining platforms.
Your Oracle home directory. Using $ORACLE_HOME does not work.
The name of the external procedure agent, which is extproc
JRE_HOME represents the root directory of a JRE installation, just as ORACLE_HOME represents the root directory of an Oracle installation. Oracle recommends that you use the JRE installed with Oracle Database.
Creating an Oracle Messaging Gateway Administration User
To perform Messaging Gateway administration work, a database user must be created with MGW_ADMINISTRATOR_ROLE privileges, as shown in Example 19-3.
Example 19-3 Creating a Messaging Gateway Administrator User
mgw.ora Java Properties
You must specify Java system properties for the Messaging Gateway JVM when working with TIB/Rendezvous subjects. You can use the setJavaProp parameter of the Messaging Gateway initialization file for this. Java properties are specified by lines having a "setJavaProp prop_name = value " format, where prop_name represents the name of the Java property to set, value represents the value of the Java property, and represents a new line character.
oracle.mgw.batch_size
Usage:
This Java property represents the maximum number of messages propagated in one transaction. It serves as a default value if the Messaging Gateway subscriber option, MsgBatchSize , is not specified. If altered from the default, then consideration should be given to the expected message size and the Messaging Gateway agent memory (see max_memory parameter of DBMS_MGWADM.alter_agent ). The minimum value of this Java property is 1, the maximum is 100, and the default is 30.
See Also:
Syntax:
Example:
oracle.mgw.polling_interval
Usage:
This parameter specifies the time (in milliseconds) that must elapse between polls for available messages of a propagation source queue. The default polling interval used by Messaging Gateway is 5000 milliseconds (5 seconds).
Syntax:
Example:
oracle.mgw.tibrv.encoding
Usage:
This parameter specifies the character encoding to be used by the TIB/Rendezvous messaging system links. Only one character set for all configured TIB/Rendezvous links is allowed due to TIB/Rendezvous restrictions. The default is ISO 8859-1 or the character set specified by the Java system property file.encoding .
Syntax:
Example:
oracle.mgw.tibrv.intraProcAdvSubjects
Usage
Used for all TIB/Rendezvous messaging system links, this parameter specifies the names of system advisory subjects that present on the intraprocess transport.
Syntax
Example:
oracle.mgw.tibrv.advMsgCallback
Usage:
Used for all TIB/Rendezvous messaging system links, this parameter specifies the name of the Java class that implements the TibrvMsgCallback interface to handle system advisory messages. If it is not specified, then the default system advisory message handler provided by Messaging Gateway is used, which writes system advisory messages into Messaging Gateway log files. If it is specified, then the directory where the class file is stored must be included in the CLASSPATH in mgw.ora .
Syntax:
Example:
Читайте также: