Oracle9i Messaging Gateway Supplement
Release 1 (9.0.1)

Part Number A90837-01
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

5
DBMS_MGWADM

DBMS_MGWADM defines the Messaging Gateway administrative interface. The package and object types are owned by SYS.

The following topics are discussed in this chapter:


Summary of DBMS_MGWADM Object Types and Methods

Table 5-1 DBMS_MGWADM Object Types
Object Type  Description 

MGW_PROPERTY Type 

Specifies a named property. 

MGW_PROPERTY.CONSTRUCT Method 

Constructs a new MGW_PROPERTY instance. 

MGW_PROPERTY.CONSTRUCT Method 

Constructs a new MGW_PROPERTY instance initialized using parameters. 

MGW_PROPERTIES Type 

Specifies an array of properties. 

MGW_MQSERIES_PROPERTIES Type 

Specifies basic properties for an MQSeries messaging system link. 

MGW_MQSERIES_PROPERTIES.CONSTRUCT Method 

Constructs a new MGW_MQSERIES_PROPERTIES instance. 

MGW_MQSERIES_PROPERTIES.ALTER_CONSTRUCT Method 

Constructs a new MGW_MQSERIES_PROPERTIES instance for altering the properties of an existing messaging link. 


MGW_PROPERTY Type

This type specifies a named property. MGW_PROPERTY is used to specify optional properties for messaging links and foreign queues.

Syntax

TYPE SYS.MGW_PROPERTY IS OBJECT(
   name VARCHAR2(100),
   value VARCHAR2(1000));

Attributes

Table 5-2 MGW_PROPERTY Attributes
Attribute  Description 

name 

Property name 

value  

Property value 


MGW_PROPERTY.CONSTRUCT Method

This method constructs a new MGW_PROPERTY instance. All attributes are assigned a value of NULL.

Syntax

STATIC FUNCTION CONSTRUCT
RETURN SYS.MGW_PROPERTY;

MGW_PROPERTY.CONSTRUCT Method

This method constructs a new MGW_PROPERTY instance initialized using the given parameters.

Syntax

STATIC FUNCTION CONSTRUCT(
   p_name   IN VARCHAR2,
   p_value  IN VARCHAR2)
RETURN SYS.MGW_PROPERTY;

Parameters

Table 5-3 MGW_PROPERTY.CONSTRUCT Parameters
Parameter  Description 

p_name 

Property name 

p_value  

Property value 


MGW_PROPERTIES Type

This type specifies an array of properties.

Syntax

TYPE SYS.MGW_PROPERTIES AS VARRAY (100) OF SYS.MGW_PROPERTY;

Usage Notes

Unless noted otherwise, Messaging Gateway uses named properties as follows:

The alter list is processed in order, from the first element to the last element. Thus the order in which the elements appear in the alter list is meaningful, especially when the alter list is used to remove properties from an existing list.

The property name and value are used to determine how that element affects the original list. The following rules apply:

If a property of the given name already exists, the current value is replaced with the new value; otherwise the new property is added to the end of the list.

No action is taken if the property name does not exist in the original list.

The DBMS_MGWADM package defines constants to represent the reserved property names. Refer to the MGWPROP_< > constants.


MGW_MQSERIES_PROPERTIES Type

This type specifies basic properties for an MQSeries messaging system link.

Syntax

TYPE SYS.MGW_MQSERIES_PROPERTIES  IS OBJECT (
   queue_manager       VARCHAR2(64),
   hostname            VARCHAR2(64),
   port                INTEGER,
   channel             VARCHAR2(64),
   interface_type      INTEGER,
   max_connections     INTEGER,
   username            VARCHAR2(64),
   password            VARCHAR2(64),
   inbound_log_queue   VARCHAR2(64),
   outbound_log_queue  VARCHAR2(64));

Attributes

Table 5-4 MGW_MQSERIES_PROPERTIES Attributes
Attribute  Description 

queue_manager 

The name of the MQSeries queue manager. 

hostname 

The host on which the MQSeries messaging system resides. If hostname is NULL, an MQSeries bindings connection is used. If nonnull, a client connection is used and requires that a port and channel be specified. 

port 

The port number. This is used only for client connections; that is, when hostname is NULL. 

channel 

The channel used when establishing a connection to the queue manager. This is used only for client connections; that is, when hostname is NULL. 

interface_type 

The type of messaging interface to use.

Valid values: DBMS_MGWADM.MQSERIES_BASE_JAVA_INTERFACE for the MQSeries Base Java interface. 

max_connections 

The maximum number of messaging connections to the MQSeries messaging system. 

username 

The user name used for authentication to the MQSeries messaging system. 

password 

The password used for authentication to the MQSeries messaging system. 

inbound_log_queue 

The message provider (native) name of the MQSeries queue used for propagation recovery purposes when the messaging link is used for inbound propagation; that is, when queues associated with this link serve as a propagation source.

The queue must be created using MQSeries administration tools. 

outbound_log_queue 

The message provider (native) name of the MQSeries queue used for propagation recovery purposes when the messaging link is used for outbound propagation; that is, when queues associated with this link serve as a propagation destination.

The queue must be created using MQSeries administration tools. 


MGW_MQSERIES_PROPERTIES.CONSTRUCT Method

This method constructs a new MGW_MQSERIES_PROPERTIES instance. All attributes are assigned a value of NULL.

Syntax

STATIC FUNCTION CONSTRUCT
RETURN SYS.MGW_MQSERIES_PROPERTIES ;

MGW_MQSERIES_PROPERTIES.ALTER_CONSTRUCT Method

This method constructs a new MGW_MQSERIES_PROPERTIES instance for altering the properties of an existing messaging link. All attributes having a VARCHAR2 data type are assigned a value of DBMS_MGWADM.NO_CHANGE. Attributes of other data types are assigned a value of NULL.

Syntax

STATIC FUNCTION ALTER_CONSTRUCT
RETURN SYS.MGW_MQSERIES_PROPERTIES ;

DBMS_MGWADM Constants

Table 5-5 DBMS_MGWADM Constants
Name  Type  Description 
Propagation Types 

OUTBOUND_PROPAGATION 

CONSTANT BINARY_INTEGER; 

Represents the propagation type for AQ to non-Oracle propagation. The propagation source is a local AQ queue and the destination is a queue in a foreign (non-Oracle) messaging system. 

INBOUND_PROPAGATION 

CONSTANT BINARY_INTEGER; 

Represents the propagation type for non-Oracle to AQ propagation. The propagation source is a queue in a foreign (non-Oracle) messaging system and the destination is a local AQ queue. 

Queue Domain Types 

DOMAIN_QUEUE 

CONSTANT BINARY_INTEGER; 

Represents a queue destination. A JMS queue (point-to-point model) is classified as a queue. 

DOMAIN_TOPIC  

CONSTANT BINARY_INTEGER; 

Represents a topic destination. A JMS topic (publish-subscribe model) is classified as a topic. 

Force Values 

NO_FORCE 

CONSTANT BINARY_INTEGER; 

Represents a normal, nonforced action. 

FORCE 

CONSTANT BINARY_INTEGER; 

Represents a forced action. 

Shutdown Modes 

SHUTDOWN_NORMAL 

CONSTANT BINARY_INTEGER; 

Represents the normal shutdown mode. 

SHUTDOWN_IMMEDIATE  

CONSTANT BINARY_INTEGER; 

Represents the immediate shutdown mode. 

Cleanup Actions 

CLEAN_STARTUP_STATE 

CONSTANT BINARY_INTEGER; 

Represents the cleanup action for gateway startup state recovery. 

Logging Levels 

BASIC_LOGGING 

CONSTANT BINARY_INTEGER; 

Represents the detail of logging information written to the log file. The logging level ranges from BASIC_LOGGING for standard (the least) information to TRACE_DEBUG_LOGGING for the greatest information. 

TRACE_LITE_LOGGING 

CONSTANT BINARY_INTEGER; 

TRACE_HIGH_LOGGING 

CONSTANT BINARY_INTEGER; 

TRACE_DEBUG_LOGGING 

CONSTANT BINARY_INTEGER; 

MQSeries Interface Types 

MQSERIES_BASE_JAVA_INTERFACE 

CONSTANT BINARY_INTEGER; 

Represents the Base Java interface for the MQSeries messaging system. 

MQSERIES_JMS_INTERFACE 

CONSTANT BINARY_INTEGER; 

Represents the JMS interface for the MQSeries messaging system. 

Named Property Constants 

MGWPROP_PREFIX 

CONSTANT VARCHAR2; 

A constant (MGWPROP$_) for the reserved property name prefix. 

MGWPROP_REMOVE 

CONSTANT VARCHAR2; 

A constant (MGWPROP$_REMOVE) for the reserved property name used to remove an existing property. 

MGWPROP_REMOVE_ALL 

CONSTANT VARCHAR2; 

A constant (MGWPROP$_REMOVE_ALL) for the reserved property name used to remove all properties. 

Other Constants 

NO_CHANGE 

CONSTANT VARCHAR2; 

Indicates that an existing value should be preserved (not changed). This is used for certain APIs where the desire is to change one or more parameters but leave others unchanged. 


MQSeries System Properties

The following sections discuss properties of MQSeries related to links and queues. Refer to IBM MQSeries documentation for more information.


Basic Link Properties (MGW_MQSERIES_PROPERTIES)

Table 5-6 summarizes the basic configuration properties for an MQSeries messaging link. (Refer to "Notes on Table 5-6" for an explanation of the numbers in parentheses.) The table indicates which properties are optional (NULL allowed), which can be altered, and if alterable, which values can be dynamically changed.

Table 5-6 MQSeries Link Properties
Attribute  NULL Allowed?  Alter Value?  Dynamic? 

queue_manager 

no 

no 

-- 

hostname 

yes (1) 

no 

-- 

port 

yes (1) 

no 

-- 

channel 

yes (1) 

no 

-- 

interface_type 

yes (2) 

no 

-- 

max_connections 

yes (3) 

yes 

yes 

username 

yes 

yes 

yes 

password 

yes 

yes 

yes 

inbound_log_queue 

yes (4) 

yes(4) 

yes 

outbound_log_queue 

yes (5) 

yes(5) 

yes 

Notes on Table 5-6

  1. If the hostname is NULL, the port and channel must be NULL. If the hostname is nonnull, the port and channel must be nonnull. If the hostname is NULL, an MQSeries bindings connection is used; otherwise a client connection is used.

  2. If NULL, a default value of DBMS_MGWADM.MQSERIES_BASE_JAVA_INTERFACE is used.

  3. If NULL, a default value of 1 is used.

  4. The inbound log queue can be NULL if the link is not used for inbound propagation. The log queue can be altered only when no inbound propagation subscriber references the link.

  5. The outbound log queue can be NULL if the link is not used for outbound propagation. The log queue can be altered only when no outbound propagation subscriber references the link.


Optional Link Properties

This section describes optional configuration properties supported for an MQSeries messaging link. These properties are specified by using the options parameter of DBMS_MGWADM.CREATE_MSGSYSTEM_LINK and DBMS_MGWADM.ALTER_MSGSYSTEM_LINK.

MQ_ccsid

This property specifies the character set identifier to be used. This should be the character set's integer value (for example, 819) rather than a descriptive string. If not set, the MQSeries default character set 819 is used.

Default: 819

Alterable: yes

Dynamic: no

MQ_ReceiveExit

This property specifies the fully qualified Java classname of a class implementing the MQReceiveExit interface. If not set, no default is used. This class must be in the CLASSPATH of the Messaging Gateway agent.

Default: none

Alterable: yes

Dynamic: no

MQ_SendExit

This property specifies the fully qualified Java classname of a class implementing the MQSendExit interface. If not set, no default is used. This class must be in the CLASSPATH of the Messaging Gateway agent.

Default: none

Alterable: yes

Dynamic: no

MQ_SecurityExit

This property specifies the fully qualified Java classname of a class implementing the MQSecurityExit interface. If not set, no default is used. This class must be in the CLASSPATH of the Messaging Gateway agent.

Default: none

Alterable: yes

Dynamic: no


Optional Queue Properties

This section describes optional configuration properties supported for a registered queue of an MQSeries messaging link. These properties are specified by using the options parameter of DBMS_MGWADM.REGISTER_FOREIGN_QUEUE.

MQ_openOptions

This property specifies the value used for the openOptions argument of the MQSeries Base Java MQQueueManager.accessQueue method. No value is required but if one is given, the Messaging Gateway agent adds MQOO_OUTPUT to the specified value for an enqueue (put) operation. MQOO_INPUT_SHARED is added for a dequeue (get) operation.

Default: MQOO_OUTPUT for an enqueue/put operation; MQOO_INPUT_SHARED for a dequeue/get operation

Alterable: no

Dynamic: no


Summary of DBMS_MGWADM Subprograms

Table 5-7 DBMS_MGWADM Subprograms
Subprogram  Description 

ALTER_AGENT Procedure 

Alters Messaging Gateway agent parameters. 

DB_CONNECT_INFO Procedure 

Configures connection information used by the Messaging Gateway agent for connections to the Oracle database. 

STARTUP Procedure 

Starts Messaging Gateway. 

SHUTDOWN Procedure 

Shuts down Messaging Gateway. 

CLEANUP_GATEWAY Procedure 

Cleans up Messaging Gateway.  

SET_LOG_LEVEL Procedure 

Dynamically alters the Messaging Gateway agent logging level. 

CREATE_MSGSYSTEM_LINK Procedure 

Creates a messaging system link to an MQSeries messaging system. 

ALTER_MSGSYSTEM_LINK Procedure 

Alters the properties of an MQSeries messaging system link. 

REMOVE_MSGSYSTEM_LINK Procedure 

Removes a messaging system link for a non-Oracle messaging system. 

REGISTER_FOREIGN_QUEUE Procedure 

Registers a non-Oracle queue entity in Messaging Gateway. 

UNREGISTER_FOREIGN_QUEUE Procedure 

Removes a non-Oracle queue entity in Messaging Gateway. 

ADD_SUBSCRIBER Procedure 

Adds a subscriber used to consume messages from a source queue for propagation to a destination. 

ALTER_SUBSCRIBER Procedure 

Alters the parameters of a subscriber used to consume messages from a source queue for propagation to a destination. 

REMOVE_SUBSCRIBER Procedure 

Removes a subscriber used to consume messages from a source queue for propagation to a destination. 

RESET_SUBSCRIBER Procedure 

Resets the propagation error state for a subscriber. 

SCHEDULE_PROPAGATION Procedure 

Schedules message propagation from a source to a destination. 

UNSCHEDULE_PROPAGATION Procedure 

Removes a propagation schedule. 

ALTER_PROPAGATION_SCHEDULE Procedure 

Alters a propagation schedule. 

ENABLE_PROPAGATION_SCHEDULE Procedure 

Enables a propagation schedule. 

DISABLE_PROPAGATION_SCHEDULE Procedure 

Disables a propagation schedule. 


ALTER_AGENT Procedure

This procedure alters Messaging Gateway agent parameters.

Syntax

DBMS_MGWADM.ALTER_AGENT (
   max_connections  IN BINARY_INTEGER  DEFAULT NULL,
   max_memory       IN BINARY_INTEGER  DEFAULT NULL);

Parameters

Table 5-8 ALTER_AGENT Procedure Parameters
Parameter  Description 

max_connections 

The maximum number of messaging connections to the Oracle database used by the gateway agent. If NULL, the current value is unchanged. 

max_memory 

The maximum heap size, in MB, used by the gateway agent. If NULL, the current value is unchanged. 

Usage Notes

The default values for configuration parameters are set when Messaging Gateway is installed.

The max_memory parameter changes take effect the next time the gateway agent is active. If the agent is currently active, the gateway must be shut down and started for the changes to take effect.

The max_connections parameter specifies the maximum number of JDBC messaging connections created and used by the AQ driver. This parameter is dynamically changed for a larger value only. In release 9.0.1, the gateway agent must be shut down and restarted before a smaller value takes effect.


DB_CONNECT_INFO Procedure

This procedure configures connection information used by the Messaging Gateway agent for connections to the Oracle database.

Syntax

DBMS_MGWADM.DB_CONNECT_INFO (
   username      IN VARCHAR2,
   password      IN VARCHAR2,
   database      IN VARCHAR2 );

Parameters

Table 5-9 DB_CONNECT_INFO Procedure Parameters
Parameter  Description 

username 

The user name used for connections to the Oracle database. NULL value is not allowed. 

password 

The password used for connections to the Oracle database. NULL value is not allowed. 

database 

The database connect string used by the gateway agent. NULL indicates that a local connection should be used. 

Usage Notes

The gateway agent connects to the Oracle database as the user configured by this API. An Oracle administrator should create the user, grant it the role MGW_AGENT_ROLE, and then call this procedure to configure Messaging Gateway. The MGW_AGENT_ROLE is used to grant this user special privileges needed to access gateway configuration information stored in the database, enqueue or dequeue messages to and from Oracle queues, and perform certain AQ administration tasks.


STARTUP Procedure

This procedure starts Messaging Gateway. It must be called before any propagation activity can take place.

Syntax

DBMS_MGWADM.STARTUP

Usage Notes

Messaging Gateway cannot be started until an agent user has been configured using DB_CONNECT_INFO.


SHUTDOWN Procedure

This procedure shuts down Messaging Gateway. No propagation activity occurs until the gateway is started.

Syntax

DBMS_MGWADM.SHUTDOWN (
   sdmode  IN BINARY_INTEGER
              DEFAULT DBMS_MGWADM.SHUTDOWN_NORMAL);

Parameters

Table 5-10 SHUTDOWN Procedure Parameters
Parameter  Description 

sdmode 

The shutdown mode.

Valid values:

SHUTDOWN_NORMAL for normal shutdown. The gateway agent may attempt to complete any propagation work currently in progress.

SHUTDOWN_IMMEDIATE for immediate shutdown. The gateway terminates any propagation work currently in progress and shuts down immediately. 

Usage Notes

In release 9.0.1, the sdmode parameter is ignored and all shutdown modes behave the same way.


CLEANUP_GATEWAY Procedure

This procedure cleans up Messaging Gateway. The procedure performs cleanup or recovery actions that may be needed when the gateway is left in some abnormal or unexpected condition. The MGW_GATEWAY view lists gateway status and configuration information that pertains to the cleanup actions.

Syntax

DBMS_MGWADM.CLEANUP_GATEWAY(
   action  IN BINARY_INTEGER);

Parameters

Table 5-11 CLEANUP_GATWAY Procedure Parameters
Parameter  Description 

action 

The cleanup action to be performed. Valid values:

CLEAN_STARTUP_STATE for gateway startup state recovery. 

Usage Notes

The CLEAN_STARTUP_STATE action involves recovery tasks that set the gateway to a known state when the gateway agent has crashed or some other abnormal event occurs so that the gateway cannot be started. This should only be done when the gateway agent has been started but appears to have crashed or has been nonresponsive for an extended period of time.

Conditions or indications where this action may be needed:

The cleanup tasks include:

The following considerations apply:


SET_LOG_LEVEL Procedure

This procedure dynamically alters the Messaging Gateway agent logging level. Messaging Gateway must be running.

Syntax

DBMS_MGWADM.SET_LOG_LEVEL (
   log_level  IN BINARY_INTEGER);

Parameters

Table 5-12 SET_LOG_LEVEL Procedure Parameters
Parameter  Description 

log_level 

Level at which the Messaging Gateway agent logs information; refer to the DBMS_MGWADM.<>_LOGGING constants. BASIC_LOGGING generates the least information while TRACE_DEBUG_LOGGING generates the most information. 


CREATE_MSGSYSTEM_LINK Procedure

This procedure creates a messaging system link to an MQSeries messaging system.

Syntax

DBMS_MGWADM.CREATE_MSGSYSTEM_LINK(
   linkname    IN VARCHAR2,
   properties  IN sys.mgw_mqseries_properties,
   options     IN sys.mgw_properties DEFAULT NULL,
   comment     IN VARCHAR2 DEFAULT NULL);

Parameters

Table 5-13 CREATE_MSGSYSTEM_LINK Procedure Parameters
Parameter  Description 

linkname 

A user-defined name to identify the message system link. 

properties 

Basic properties of an MQSeries messaging system link. 

options 

Optional link properties. NULL if there are none. These are less frequently used configuration properties supported by the messaging system. 

comment 

A user-specified description. NULL if one is not desired.  

Usage Notes

Refer to "Basic Link Properties (MGW_MQSERIES_PROPERTIES)" for more information about messaging link properties.


ALTER_MSGSYSTEM_LINK Procedure

This procedure alters the properties of an MQSeries messaging system link.

Syntax

DBMS_MGWADM.ALTER_MSGSYSTEM_LINK (
   linkname   IN  VARCHAR2,
   properties IN  SYS.MGW_MQSERIES_PROPERTIES,
   options    IN  SYS.MGW_PROPERTIES DEFAULT NULL,
   comment    IN  VARCHAR2 DEFAULT DBMS_MGWADM.NO_CHANGE);

Parameters

Table 5-14 ALTER_MSGSYSTEM_LINK Procedure Parameters
Parameters  Description 

linkname 

The messaging system link name. 

properties 

Basic properties for an MQSeries messaging system link. If NULL, no link properties are changed. 

options 

Optional link properties. NULL if no options are changed. If nonnull, the properties specified in this list are combined with the current options properties to form a new set of link options. 

comment 

An optional description or NULL if not desired. If DBMS_MGWADM.NO_CHANGE is specified, the current value is not changed. 

Usage Notes

In release 9.0.1, the MGW_MQSERIES_PROPERTIES.MAX_CONNECTIONS parameter specifies the maximum number of messaging connections created and used for that messaging link. This parameter is dynamically changed for a larger value only. The gateway agent must be shut down and restarted before a smaller value takes effect.

To retain an existing value for a messaging link property with a VARCHAR2 data type, specify DBMS_MGWADM.NO_CHANGE for that particular property. To preserve an existing value for a property of another data type, specify NULL for that property.

The options parameter specifies a set of properties used to alter the current option properties. Each property affects the current property list in a particular manner; add a new property, replace an existing property, remove an existing property, or remove all properties.

Some properties cannot be modified and this procedure will fail if you try. Other properties can be modified only under certain conditions, depending on the current configuration; for example, when there are no propagation subscribers or schedules that have a source or destination associated with the link.

For properties that can be changed, a few are dynamic, while others require Messaging Gateway to be shut down and restarted before they take effect.

Refer to "Basic Link Properties (MGW_MQSERIES_PROPERTIES)" for more information on messaging link properties.


REMOVE_MSGSYSTEM_LINK Procedure

This procedure removes a messaging system link for a non-Oracle messaging system.

Syntax

DBMS_MGWADM.REMOVE_MSGSYSTEM_LINK(
   linkname  IN VARCHAR2);

Parameters

Table 5-15 REMOVE_MSGSYSTEM_LINK Procedure Parameters
Parameters  Description 

linkname 

The messaging system link name. 

Usage Notes

All registered queues associated with this link must be removed before the messaging system link can be removed. This fails if there is a registered foreign (non-Oracle) queue that references this link.


REGISTER_FOREIGN_QUEUE Procedure

This procedure registers a non-Oracle queue entity in Messaging Gateway.

Syntax

DBMS_MGWADM.REGISTER_FOREIGN_QUEUE(
   name            IN VARCHAR2,
   linkname        IN VARCHAR2,
   provider_queue  IN VARCHAR2 DEFAULT NULL,
   domain          IN INTEGER DEFAULT NULL,
   options         IN sys.mgw_properties DEFAULT NULL,
   comment         IN VARCHAR2  DEFAULT NULL);

Parameters

Table 5-16 REGISTER_FOREIGN_QUEUE Procedure Parameters
Parameters  Description 

name 

The registered queue name. This name identifies the foreign queue within Messaging Gateway and need not match the name of the queue in the foreign messaging system. 

linkname 

The link name for the messaging system on which this queue exists. 

provider_queue 

The message provider (native) queue name. If NULL, the value provided for the name parameter is used as the provider queue name. 

domain 

The domain type of the queue. Valid values are:

  • NULL if the domain type is automatically determined based on the messaging system of the queue

  • DOMAIN_QUEUE for a queue (point-to-point model)

  • DOMAIN_TOPIC for a topic (publish-subscribe model)

 

options 

Optional queue properties. 

comment 

A user-specified description. Can be NULL

Usage Notes

This procedure does not create the physical queue in the non-Oracle messaging system. The non-Oracle queue must be created using the administration tools for that messaging system.

In release 9.0.1, domain is not used and must be NULL because the domain type can be automatically determined for the messaging systems currently supported.

Refer to "Basic Link Properties (MGW_MQSERIES_PROPERTIES)" for more information on messaging link properties.


UNREGISTER_FOREIGN_QUEUE Procedure

This procedure removes a non-Oracle queue entity in Messaging Gateway.

Syntax

DBMS_MGWADM.UNREGISTER_FOREIGN_QUEUE(
   name         IN VARCHAR2,
   linkname     IN VARCHAR2);

Parameters

Table 5-17 UNREGISTER_FOREIGN_QUEUE Procedure Parameters
Parameter  Description 

name  

The queue name. 

linkname 

The link name for the messaging system on which the queue exists. 

Usage Notes

This procedure does not remove the physical queue in the non-Oracle messaging system.

All subscribers and schedules referencing this queue must be removed before it can be unregistered. This fails if a subscriber or propagation schedule references the non-Oracle queue.


ADD_SUBSCRIBER Procedure

This procedure adds a subscriber used to consume messages from a source queue for propagation to a destination.

Syntax

DBMS_MGWADM.ADD_SUBSCRIBER(
   subscriber_id     IN VARCHAR2,
   propagation_type  IN BINARY_INTEGER,
   queue_name        IN VARCHAR2,
   destination       IN VARCHAR2,
   rule              IN VARCHAR2 DEFAULT NULL,
   transformation    IN VARCHAR2 DEFAULT NULL,
   exception_queue   IN VARCHAR2 DEFAULT NULL);

Parameters

Table 5-18 ADD_SUBSCRIBER Procedure Parameters
Parameter  Description 

subscriber_id 

Specifies a user-defined name that identifies this subscriber.  

propagation_type 

Specifies the type of message propagation.

Valid values are:

  • DBMS_MGWADM.OUTBOUND_PROPAGATION for AQ to non-Oracle propagation

  • DBMS_MGWADM.INBOUND_PROPAGATION for non-Oracle to AQ propagation

 

queue_name 

Specifies the source queue to which this subscriber is being added. The syntax and interpretation of this parameter depend on the value specified for propagation_type. 

destination 

Specifies the destination queue to which messages consumed by this subscriber are propagated. The syntax and interpretation of this parameter depend on the value specified for propagation_type. 

rule 

Specifies an optional subscription rule used by the subscriber to dequeue messages from the source queue. This is NULL if no rule is needed. The syntax and interpretation of this parameter depend on the value specified for propagation_type. 

transformation 

Specifies the transformation needed to convert between the AQ payload and a gateway-defined ADT. The type of transformation needed depends on the value specified for propagation_type.

If no transformation is provided (a NULL value is specified), the gateway makes a best effort to propagate messages based on the AQ payload type and the capabilities of the non-Oracle messaging system. For example, the gateway automatically propagates messages for an AQ queue having a RAW payload and non-Oracle messaging systems that support a `bytes' message body. 

exception_queue 

Specifies a queue used for exception message logging purposes. This queue must be on the same messaging system as the propagation source. If NULL, an exception queue is not used and propagation stops if a problem occurs. The syntax and interpretation of this parameter depend on the value specified for propagation_type.

The source queue and exception queue cannot be the same queue.  

Usage Notes

For OUTBOUND_PROPAGATION, parameters are interpreted as follows:

For INBOUND_PROPAGATION, parameters are interpreted as follows:

For OUTBOUND_PROPAGATION, a local subscriber is added to the AQ queue. The subscriber is of the form aq$_agent(`MGW_<subscriber_id>',NULL,NULL).

For INBOUND_PROPAGATION, whether or not a subscriber is needed depends on the requirements of the non-Oracle messaging system.

For OUTBOUND_PROPAGATION, the exception queue has the following considerations:

For INBOUND_PROPAGATION, the exception queue has the following considerations:


ALTER_SUBSCRIBER Procedure

This procedure alters the parameters of a subscriber used to consume messages from a source queue for propagation to a destination.

Syntax

DBMS_MGWADM.ALTER_SUBSCRIBER (
   subscriber_id    IN VARCHAR2,
   rule             IN VARCHAR2 DEFAULT DBMS_MGWADM.NO_CHANGE,
   transformation   IN VARCHAR2 DEFAULT DBMS_MGWADM.NO_CHANGE,
   exception_queue  IN VARCHAR2 DEFAULT DBMS_MGWADM.NO_CHANGE );

Parameters

Table 5-19 ALTER_SUBSCRIBER Procedure Parameters
Parameter  Description 

subscriber_id 

Identifies the subscriber to be altered. 

rule 

Specifies an optional subscription rule used by the subscriber to dequeue messages from the source queue. The syntax and interpretation of this parameter depend on the subscriber's propagation type.

A NULL value indicates that no subscription rule is needed. If DBMS_MGWADM.NO_CHANGE, the current value is unchanged. 

transformation 

Specifies the transformation needed to convert between the AQ payload and a gateway-defined ADT. The type of transformation needed depends on the subscriber's propagation type.

A NULL value indicates that no transformation is needed. If DBMS_MGWADM.NO_CHANGE, the current value is unchanged. 

exception_queue 

Specifies a queue used for exception message logging purposes. This queue must be on the same messaging system as the propagation source. If no exception queue is associated with the subscriber, propagation stops if a problem occurs. The syntax and interpretation of this parameter depend on the subscriber's propagation type.

A NULL value indicates that no exception queue is used. If DBMS_MGWADM.NO_CHANGE, the current value is unchanged.

The source queue and exception queue cannot be the same queue. 

Usage Notes

For a subscriber having a propagation type of OUTBOUND_PROPAGATION, parameters are interpreted as follows:

For a subscriber having a propagation type of INBOUND_PROPAGATION, parameters are interpreted as follows:

For OUTBOUND_PROPAGATION, the exception queue has the following considerations:

For INBOUND_PROPAGATION, the exception queue has the following considerations:


REMOVE_SUBSCRIBER Procedure

This procedure removes a subscriber used to consume messages from a source queue for propagation to a destination.

Syntax

DBMS_MGWADM.REMOVE_SUBSCRIBER (
   subscriber_id  IN VARCHAR2,
   force          IN BINARY_INTEGER DEFAULT DBMS_MGWADM.NO_FORCE );

Parameters

Table 5-20 REMOVE_SUBSCRIBER Procedure Parameters
Parameter  Description 

subscriber_id 

Identifies the subscriber to be removed. 

force 

Specifies whether this procedure should succeed even if the gateway is not able to perform all cleanup actions pertaining to this subscriber.

Valid values:

  • NO_FORCE (0) if this should fail if unable to cleanup successfully.

  • FORCE (1) if this should succeed even though all cleanup actions may not be done.

The gateway agent uses various resources of the Oracle database and non-Oracle messaging system for its propagation work; for example, it enqueues messages to log queues, creates subscribers, and so on. These resources are typically associated with each subscriber and need to be released when the subscriber is no longer needed. Typically, this procedure should only be called when the gateway agent is running and able to access the non-Oracle messaging system associated with this subscriber. 

Usage Notes

For outbound propagation, a local subscriber is removed from the AQ queue.


RESET_SUBSCRIBER Procedure

This procedure resets the propagation error state for a subscriber.

Syntax

DBMS_MGWADM.RESET_SUBSCRIBER (
   subscriber_id  IN VARCHAR2 );

Parameters

Table 5-21 RESET_SUBSCRIBER Procedure Parameters
Parameter  Description 

subscriber_id 

Identifies the subscriber. 


SCHEDULE_PROPAGATION Procedure

This procedure schedules message propagation from a source to a destination. The schedule must be enabled and the gateway started in order for messages to be propagated.

Syntax

DBMS_MGWADM.SCHEDULE_PROPAGATION (
   schedule_id       IN VARCHAR2,
   propagation_type  IN BINARY_INTEGER,
   source            IN VARCHAR2,
   destination       IN VARCHAR2,
   start_time        IN DATE DEFAULT SYSDATE,
   duration          IN NUMBER DEFAULT NULL,
   next_time         IN VARCHAR2 DEFAULT NULL,
   latency           IN NUMBER DEFAULT 60 );

Parameters

Table 5-22 SCHEDULE_PROPAGATION Procedure Parameters
Parameter  Description 

schedule_id  

Specifies a user-defined name that identifies the schedule.  

propagation_type 

Specifies the type of message propagation.

Valid values:

  • DBMS_MGWADM.OUTBOUND_PROPAGATION for AQ to non-Oracle propagation

  • DBMS_MGWADM.INBOUND_PROPAGATION for non-Oracle to AQ propagation.

 

source 

Specifies the source queue whose messages are to be propagated. The syntax and interpretation of this parameter depend on the value specified for propagation_type. 

destination 

Specifies the destination queue to which messages are propagated. The syntax and interpretation of this parameter depend on the value specified for propagation_type. 

start_time 

Specifies the initial start time for the propagation window for messages from the source queue to the destination. 

duration 

Specifies the duration of the propagation window, in seconds. A NULL value means that the propagation window is forever, or until the propagation is unscheduled. 

next_time 

Specifies the date function to compute the start of the next propagation window from the end of the current window. A NULL value means that the propagation is stopped at the end of the current window.  

latency 

Specifies the maximum wait, in seconds, in the propagation window for a message to be propagated after it is enqueued. However, if for example, the latency is 60 seconds, and if no messages are waiting to be propagated, then during the propagation window, no messages are propagated from the source to the destination for at least 60 more seconds.

If the latency is 0, then a message is propagated as soon as it is enqueued. 

Usage Notes

In release 9.0.1, all window parameters are ignored.

For OUTBOUND_PROPAGATION, parameters are as follows:

For INBOUND_PROPAGATION, parameters are interpreted as follows:

The schedule is set to an enabled state when it is created.


UNSCHEDULE_PROPAGATION Procedure

This procedure removes a propagation schedule.

Syntax

DBMS_MGWADM.UNSCHEDULE_PROPAGATION (
   schedule_id   IN VARCHAR2 );

Parameters

Table 5-23 UNSCHEDULE_PROPAGATION Procedure Parameters
Parameter  Description 

schedule_id 

Identifies the propagation schedule to be removed. 


ALTER_PROPAGATION_SCHEDULE Procedure

This procedure alters a propagation schedule.

Syntax

DBMS_MGWADM.ALTER_PROPAGATION_SCHEDULE (
   schedule_id  IN VARCHAR2,
   duration     IN NUMBER DEFAULT NULL,
   next_time    IN VARCHAR2 DEFAULT NULL,
   latency      IN NUMBER DEFAULT 60 );

Parameters

Table 5-24 ALTER_PROPAGATION_SCHEDULE Procedure Parameters
Parameter  Description 

schedule_id 

Identifies the propagation schedule to be altered. 

duration 

Specifies the duration of the propagation window, in seconds. A NULL value means that the propagation window is forever, or until the propagation is unscheduled. 

next_time 

Specifies the date function to compute the start of the next propagation window from the end of the current window. A NULL value means that the propagation is stopped at the end of the current window.  

latency 

Specifies the maximum wait, in seconds, in the propagation window for a message to be propagated after it is enqueued. However, if for example, the latency is 60 seconds, and if no messages are waiting to be propagated, then during the propagation window, no messages are propagated from the source to the destination for at least 60 additional seconds.

If the latency is 0, then a message is propagated as soon as it is enqueued. 

Usage Notes

In release 9.0.1, propagation window parameters are ignored.


CAUTION:

This procedure always overwrites the existing value for each parameter. If a given parameter is not specified, the existing values are overwritten with the default value. 



ENABLE_PROPAGATION_SCHEDULE Procedure

This procedure enables a propagation schedule.

Syntax

DBMS_MGWADM.ENABLE_PROPAGATION_SCHEDULE (
   schedule_id  IN VARCHAR2 );

Parameters

Table 5-25 ENABLE_PROPAGATION_SCHEDULE Procedure Parameters
Parameter  Description 

schedule_id 

Identifies the propagation schedule to be enabled. 


DISABLE_PROPAGATION_SCHEDULE Procedure

This procedure disables a propagation schedule.

Syntax

DBMS_MGWADM.DISABLE_PROPAGATION_SCHEDULE (
   schedule_id  IN VARCHAR2 );

Parameters

Table 5-26 DISABLE_PROPAGATION_SCHEDULE Procedure Parameters
Parameter  Description 

schedule_id 

Identifies the propagation schedule to be disabled. 


Summary of Database Views

The views listed in Table 5-27 provide Messaging Gateway configuration, status, and statistical information. Unless otherwise indicated, the SELECT privilege is granted to MGW_ADMINISTRATOR_ROLE so that only Messaging Gateway administrators have access to the views. All views are owned by SYS.

Table 5-27 Database Views
Name  Description 

MGW_GATEWAY View 

Lists configuration and status information for Messaging Gateway 

MGW_LINKS View 

Lists the name and types of messaging system links currently created. 

MGW_MQSERIES_LINKS View 

Lists messaging system properties for MQSeries links. 

MGW_FOREIGN_QUEUES View 

Lists the queue properties of registered queues. 

MGW_SUBSCRIBERS View 

Lists subscriber properties, status, and statistical information. 

MGW_SCHEDULES View 

Lists schedule properties status. 


MGW_GATEWAY View

This view lists configuration and status information for Messaging Gateway, as shown in Table 5-28.

Table 5-28 MGW_GATEWAY Properties
Name  Type  Description 

AGENT_STATUS 

VARCHAR2 

Status of the gateway agent. Values:

  • NOT_STARTED if gateway has not been started.

  • START_SCHEDULED if gateway agent has been scheduled to start; this indicates the gateway has been started using DBMS_MGWADM.STARTUP but the queued job used to start the gateway agent has not been executed.

  • STARTING if gateway agent is starting; this indicates the queued job has been executed and the gateway agent is starting up.

  • INITIALIZING if gateway agent has started and is initializing.

  • RUNNING if gateway agent is running.

  • SHUTTING_DOWN if gateway agent is shutting down.

 

AGENT_PING 

VARCHAR2 

Gateway agent ping status. Values:

  • NULL if no ping attempt was made.

  • REACHABLE if ping attempt was successful.

  • UNREACHABLE if ping attempt failed.

AGENT_PING attempts to contact the gateway agent. There is a short delay (up to 5 seconds) if the ping attempt fails. No ping is attempted if the AGENT_STATUS is NOT_STARTED or START_SCHEDULED

AGENT_JOB 

NUMBER 

Job number of the queued job used to start the Messaging Gateway agent process. The job number is set when the Messaging Gateway is started and cleared when it shuts down. 

AGENT_USER 

VARCHAR2 

Database user name used by the gateway agent to connect to the database. 

AGENT_DATABASE 

VARCHAR2 

The database connect string used by the gateway agent. NULL indicates that a local connection is used. 

LAST_ERROR_DATE 

DATE 

Date of last Messaging Gateway agent error. The last error information is cleared when Messaging Gateway is started. It is set if the Messaging Gateway agent fails to start or terminates due to an abnormal condition. 

LAST_ERROR_TIME 

VARCHAR2 

Time of last Messaging Gateway agent error. 

LAST_ERROR_MSG 

VARCHAR2 

Message for last Messaging Gateway agent error. 

MAX_CONNECTIONS 

NUMBER 

Maximum number of messaging connections to the Oracle database. 

MAX_MEMORY 

NUMBER 

Maximum heap size used by gateway agent (in MB). 


MGW_LINKS View

This view lists the names and types of messaging system links currently defined.

Table 5-29 MGW_LINKS Properties
Name  Type  Description 

LINK_NAME 

VARCHAR2 

Name of the messaging system link. 

LINK_TYPE 

VARCHAR2 

Type of messaging system link. Values: MQSERIES 

LINK_COMMENT 

VARCHAR2 

User comment for the link. 


MGW_MQSERIES_LINKS View

This view lists information for the MQSeries messaging system links. The view includes most of the messaging system properties specified when the link is created.

Table 5-30 MGW_MQSERIES_LINKS Properties
Name  Type  Description 

LINK_NAME 

VARCHAR2 

Name of the messaging system link 

QUEUE_MANAGER 

VARCHAR2 

Name of the MQSeries queue manager 

HOSTNAME 

VARCHAR2 

Name of the MQSeries host 

PORT 

NUMBER 

Port number 

CHANNEL 

VARCHAR2 

Connection channel 

INTERFACE_TYPE 

VARCHAR2 

Messaging interface type. Values: BASE_JAVA for the MQSeries Base Java interface 

MAX_CONNECTIONS 

NUMBER 

Maximum number of messaging connections 

INBOUND_LOG_QUEUE 

VARCHAR2 

Inbound propagation log queue 

OUTBOUND_LOG_QUEUE 

VARCHAR2 

Outbound propagation log queue 

OPTIONS 

SYS.MGW.PROPERTIES 

Link options 

LINK_COMMENT 

VARCHAR2 

User comment for the link 


MGW_FOREIGN_QUEUES View

This view lists information for foreign queues. The view includes most of the queue properties specified when the queue is registered.

Table 5-31 MGW_FOREIGN_QUEUES Properties
Name  Type  Description 

NAME 

VARCHAR2 

Name of the registered queue 

LINK_NAME 

VARCHAR2 

Name of the messaging system link 

PROVIDER_QUEUE 

VARCHAR2 

Message provider (native) queue name 

DOMAIN 

VARCHAR2 

Queue domain type 

OPTIONS 

SYS.MGW.PROPERTIES 

Values:

  • NULL if automatically determined by messaging system

  • QUEUE for a queue (point-to-point) model

  • TOPIC for a topic (publish-subscribe) model

 

QUEUE_COMMENT 

VARCHAR2 

User comment for the foreign queue 


MGW_SUBSCRIBERS View

This view lists configuration and status information for Messaging Gateway subscribers. The view includes most of the subscriber properties specified when the subscriber is added, as well as other status and statistical information.

Table 5-32 MGW_SUBSCRIBERS Properties
Name  Type  Description 

SUBSCRIBER_ID 

VARCHAR2 

Propagation subscriber identifier 

PROPAGATION_TYPE 

VARCHAR2 

Propagation type. Values:

  • OUTBOUND for AQ to non-Oracle propagation

  • INBOUND for non-Oracle to AQ propagation

 

QUEUE_NAME 

VARCHAR2 

Subscriber source queue 

DESTINATION 

VARCHAR2 

Destination queue to which messages are propagated 

RULE 

VARCHAR2 

Subscription rule 

TRANSFORMATION 

VARCHAR2 

Transformation used for message conversion 

EXCEPTION_QUEUE 

VARCHAR2 

Exception queue used for logging purposes 

STATUS 

VARCHAR2 

Subscriber status. Values:

  • ENABLED if the subscriber is enabled

  • DELETE_PENDING if subscriber removal is pending; typically the case when DBMS_MGWADM.REMOVE_SUBSCRIBER has been called but certain cleanup tasks pertaining to this subscriber are still outstanding.

 

FAILURES 

NUMBER 

Number of propagation failures 

LAST_ERROR_DATE 

DATE 

Date of last propagation error 

LAST_ERROR_TIME 

VARCHAR2 

Time of last propagation error 

LAST_ERROR_MSG 

VARCHAR2 

Message for last propagation error 

PROPAGATED_MSGS  

NUMBER 

Number of messages propagated to the destination queue since the last time the agent was started. 

EXCEPTIONQ_MSGS 

NUMBER 

Number of messages moved to the propagation exception queue since the last time the agent was started. 


MGW_SCHEDULES View

This view lists configuration and status information for Messaging Gateway schedules. The view includes most of the schedule properties specified when the schedule is created, as well as other status information.

Table 5-33 MGW_SCHEDULES Properties
Name  Type  Description 

SCHEDULE_ID 

VARCHAR2 

Propagation schedule identifier 

PROPAGATION_TYPE 

VARCHAR2 

Propagation type. Values:

  • OUTBOUND for AQ to non-Oracle propagation

  • INBOUND for non-Oracle to AQ propagation

 

SOURCE 

VARCHAR2 

Propagation source 

DESTINATION 

VARCHAR2 

Propagation destination 

START_DATE 

DATE 

Schedule start date 

START_TIME 

VARCHAR2 

Schedule start time 

PROPAGATION_WINDOW 

NUMBER 

Duration of the propagation window (in seconds) 

NEXT_TIME 

VARCHAR2 

Date function used to compute the start of the next propagation window 

LATENCY 

NUMBER 

Propagation window latency (in seconds) 

SCHEDULE_DISABLED 

VARCHAR2 

Indicates whether the schedule is disabled. Values:

  • Y if schedule is disabled

  • N if schedule is enabled

 


Go to previous page Go to next page
Oracle
Copyright © 2001 Oracle Corporation.

All Rights Reserved.
Go To Table Of Contents
Contents
Go To Index
Index