Oracle® Database PL/SQL Packages and Types Reference 10g Release 2 (10.2) Part Number B14258-02 |
|
|
View PDF |
DBMS_MGWADM
defines the Messaging Gateway administrative interface. The package and object types are owned by SYS
.
Note:
You must run thecatmgw.sql
script to load the Messaging Gateway packages and types into the database.See Also:
Oracle Streams Advanced Queuing User's Guide and Reference contains information on loading database objects and usingDBMS_MGWADM
This chapter contains the following topics:
Constants
Views
Table 58-1 DBMS_MGWADM Constants—Cleanup Actions
Name | Type | Description |
---|---|---|
|
|
Sets the Messaging Gateway agent to a known state so that it can be started |
|
|
Messaging Gateway agent will clean log queues for all configured messaging system links |
|
|
Messaging Gateway agent recovers a Messaging Gateway subscriber that has failed due to a missing log record |
|
|
Messaging Gateway agent recovers a Messaging Gateway subscriber that has failed due to a missing persistent source message |
Table 58-2 DBMS_MGWADM Constants—Force Values
Name | Type | Description |
---|---|---|
|
|
Represents a forced action |
|
|
Represents a normal, nonforced action |
Table 58-3 DBMS_MGWADM Constants—Logging Levels
Name | Type | Description |
---|---|---|
|
|
The standard (the least) information written to the log file |
|
|
The greatest information written to the log file |
|
|
The third level of detail of logging information written to the log file |
|
|
The second level detail of logging information written to the log file |
Table 58-4 DBMS_MGWADM Constants—Named Property Constants
Name | Type | Description |
---|---|---|
|
|
A constant ( |
|
|
A constant ( |
|
|
A constant ( |
Table 58-5 DBMS_MGWADM Constants—Other Constants
Name | Type | Description |
---|---|---|
|
|
Used to indicate that JMS connections will be used to access JMS destinations in a domain-independent manner that supports a unified messaging model |
|
|
Used to indicate that JMS queue connections will be used to access JMS destinations |
|
|
Used to indicate that JMS topic connections will be used to access JMS destinations |
|
|
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. |
Table 58-6 DBMS_MGWADM Constants—Propagation Types
Name | Type | Description |
---|---|---|
|
|
Represents the propagation type for non-Oracle to Oracle Streams AQ propagation. The propagation source is a queue in a foreign (non-Oracle) messaging system and the destination is a local Oracle Streams AQ queue. |
|
|
Represents the propagation type for Oracle Streams AQ to non-Oracle propagation. The propagation source is a local Oracle Streams AQ queue and the destination is a queue in a foreign (non-Oracle) messaging system. |
Table 58-7 DBMS_MGWADM Constants—Queue Domain Types
Name | Type | Description |
---|---|---|
|
|
Represents a queue destination. A JMS queue (point-to-point model) is classified as a queue. |
|
|
Represents a topic destination. A JMS topic (publish-subscribe model) is classified as a topic. |
Table 58-8 DBMS_MGWADM Constants—Shutdown Modes
Name | Type | Description |
---|---|---|
|
|
Represents the immediate shutdown mode |
|
|
Represents the normal shutdown mode |
Table 58-9 DBMS_MGWADM Constants—WebSphere MQ Interface Types
Name | Type | Description |
---|---|---|
|
|
Represents the Base Java interface for the WebSphere MQ messaging system |
The views listed in Table 58-10 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 58-10 Database Views
Name | Description |
---|---|
Configuration and status information for Messaging Gateway |
|
Names and types of messaging system links currently created |
|
Messaging system properties for WebSphere MQ links |
|
Messaging system properties for TIB/Rendezvous links |
|
Queue properties of registered queues |
|
Subscriber properties, status, and statistical information |
|
Schedule properties and status |
This view lists configuration and status information for Messaging Gateway, as shown in Table 58-11.
Table 58-11 MGW_GATEWAY View Properties
Name | Type | Description |
---|---|---|
|
|
The database connect string used by the Messaging Gateway agent. |
|
|
The database instance on which the Messaging Gateway agent is currently running. This should be |
|
|
Job number of the queued job used to start the Messaging Gateway agent process. The job number is set when Messaging Gateway is started and cleared when it shuts down. |
|
|
Gateway agent ping status. Values:
|
|
|
The time when the Messaging Gateway agent job currently running was started. This should be |
|
|
Status of the Messaging Gateway agent. Values:
|
|
|
Database username used by the Messaging Gateway agent to connect to the database |
|
|
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. |
|
|
Message for last Messaging Gateway agent error |
|
|
Time of last Messaging Gateway agent error |
|
|
Maximum number of messaging connections to Oracle Database |
|
|
Maximum heap size used by the Messaging Gateway agent (in MB) |
|
|
Maximum number of messaging threads created by the Messaging Gateway agent |
This view lists the names and types of messaging system links currently defined. Table 58-12 lists the MGW_LINKS
view properties.
Table 58-12 MGW_LINKS View Properties
Name | Type | Description |
---|---|---|
|
|
User comment for the link |
|
|
Name of the messaging system link |
|
|
Type of messaging system link. Values
|
This view lists information for the WebSphere MQ messaging system links. The view includes most of the messaging system properties specified when the link is created. Table 58-13 lists the MGW_MQSERIES_LINKS
view properties.
Table 58-13 MGW_MQSERIES_LINKS View Properties
Name | Type | Description |
---|---|---|
|
|
Connection channel |
|
|
Name of the WebSphere MQ host |
|
|
Inbound propagation log queue |
|
|
Messaging interface type. Values:
|
|
|
User comment for the link |
|
|
Name of the messaging system link |
|
|
Maximum number of messaging connections |
|
|
Link options |
|
|
Outbound propagation log queue |
|
|
Port number |
|
|
Name of the WebSphere MQ queue manager |
This view lists information for TIB/Rendezvous messaging system links. The view includes most of the messaging system properties specified when the link was created. Table 58-14 lists the MGW_TIBRV_LINKS
view properties.
Table 58-14 MGW_TIBRV_LINKS View Properties
Property Name | Type | Description |
---|---|---|
|
|
TIB/Rendezvous CM ledger file name |
|
|
TIB/Rendezvous CM correspondent name |
|
|
TIB/Rendezvous daemon parameter for rvd transport |
|
|
User comment for the link |
|
|
Name of the messaging system link |
|
|
TIB/Rendezvous network parameter for rvd transport |
|
|
Link options |
|
|
TIB/Rendezvous service parameter for rvd transport |
This view lists information for foreign queues. The view includes most of the queue properties specified when the queue is registered. Table 58-15 lists the MGW_FOREIGN_QUEUES
view properties.
Table 58-15 MGW_FOREIGN_QUEUES View Properties
Name | Type | Description |
---|---|---|
|
|
Queue domain type. Values:
|
|
|
Name of the messaging system link |
|
|
Name of the registered queue |
|
|
Optional queue properties |
|
|
Message provider (native) queue name |
|
|
User comment for the foreign queue |
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 58-16 lists the MGW_SUBSCRIBERS
view properties.
Table 58-16 MGW_SUBSCRIBERS View Properties
Name | Type | Description |
---|---|---|
|
|
Destination queue to which messages are propagated |
|
|
Number of messages moved to the propagation exception queue since the last time the agent was started |
|
|
Exception queue used for logging purposes |
|
|
Number of propagation failures |
|
|
Date of last propagation error |
|
|
Message for last propagation error |
|
|
Time of last propagation error |
|
|
Subscriber options |
|
|
Message propagation style. Values:
|
|
|
Number of messages propagated to the destination queue since the last time the agent was started |
|
|
Propagation type. Values:
|
|
|
Subscriber source queue |
|
|
Subscription rule |
|
|
Subscriber status. Values:
|
|
|
Propagation subscriber identifier |
|
|
Transformation used for message conversion |
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 58-17 lists the MGW_SCHEDULES
view properties.
Table 58-17 MGW_SCHEDULES View Properties
Name | Type | Description |
---|---|---|
|
|
Propagation destination |
|
|
Propagation window latency (in seconds) |
|
|
Reserved for future use |
|
|
Propagation type. Values:
|
|
|
Reserved for future use |
|
|
Indicates whether the schedule is disabled. |
|
|
Propagation schedule identifier |
|
|
Propagation source |
|
|
Reserved for future use |
|
|
Reserved for future use |
The DBMS_MGWADM
package defines the following OBJECT
types.
Object Types
This type specifies basic properties for a WebSphere MQ 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), -- Methods STATIC FUNCTION construct RETURN SYS.MGW_MQSERIES_PROPERTIES, STATIC FUNCTION alter_construct RETURN SYS.MGW_MQSERIES_PROPERTIES );
Attributes
Table 58-18 SYS.MGW_MQSERIES_PROPERTIES Attributes
Attribute | Description |
---|---|
|
The name of the WebSphere MQ queue manager |
|
The host on which the WebSphere MQ messaging system resides. If hostname is |
|
The port number. This is used only for client connections; that is, when |
|
The channel used when establishing a connection to the queue manager. This is used only for client connections; that is, when |
|
The type of messaging interface to use. Values:
|
|
The maximum number of messaging connections to the WebSphere MQ messaging system |
|
The username used for authentication to the WebSphere MQ messaging system |
|
The password used for authentication to the WebSphere MQ messaging system |
|
The name of the WebSphere MQ queue used for propagation recovery purposes when this messaging link is used for inbound propagation; that is, when queues associated with this link serve as a propagation source:
|
|
The name of the WebSphere MQ queue used for propagation recovery purposes when this messaging link is used for outbound propagation; that is, when queues associated with this link serve as a propagation destination:
|
Methods
Table 58-19 SYS.MGW_MQSERIES_PROPERTIES Methods
Method | Description |
---|---|
|
Constructs a new |
|
Constructs a new |
This type specifies an array of properties.
Syntax
TYPE SYS.MGW_PROPERTIES AS VARRAY (2000) OF SYS.MGW_PROPERTY;
Attributes
Table 58-20 SYS.MGW_PROPERTIES Attributes
Attribute | Description |
---|---|
|
Property name |
|
Property value |
Usage Notes
Unless noted otherwise, Messaging Gateway uses named properties as follows:
Names with the MGWPROP$_
prefix are reserved. They are used for special purposes and are invalid when used as a normal property name.
A property name can exist only once in a property list; that is, a list can contain only one value for a given name. The name is case-insensitive.
In general, a property list is order-independent, and the property names may appear in any order. An alter property list is an exception.
You can use a new property list to alter an existing property list. Each new property modifies the original list in one of the following ways: adds a new property, modifies a property, removes a property, or removes all properties.
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:
Add or modify property
MGW_PROPERTY.NAME = property_name MGW_PROPERTY.VALUE = property_value
If a property of the given name already exists, then the current value is replaced with the new value; otherwise the new property is added to the end of the list.
Remove property
MGW_PROPERTY.NAME = 'MGWPROP$_REMOVE'
MGW_PROPERTY.VALUE = name_of_property_to_remove
No action is taken if the property name does not exist in the original list.
Remove all properties
MGW_PROPERTY.NAME = 'MGWPROP$_REMOVE_ALL' MGW_PROPERTY.VALUE = not used
See Also:
"TheDBMS_MGWADM
package defines constants to represent the reserved property names on Table 58-4, "DBMS_MGWADM Constants—Named Property Constants"This type specifies a named property which is used to specify optional properties for messaging links, foreign queues, and subscribers.
Syntax
TYPE SYS.MGW_PROPERTY IS OBJECT( name VARCHAR2(500), value VARCHAR2(4000), -- Methods STATIC FUNCTION construct --- (1) RETURN SYS.MGW_PROPERTY, STATIC FUNCTION construct( --- (2) p_name IN VARCHAR2, p_value IN VARCHAR2) RETURN SYS.MGW_PROPERTY );
Attributes
Table 58-21 SYS.MGW_PROPERTY Attributes
Attribute | Description |
---|---|
|
Property name |
|
Property value |
Methods
Table 58-22 SYS.MGW_PROPERTY Methods
Method | Description |
---|---|
|
Constructs a new |
|
Constructs a new |
A type that specifies basic properties for a TIB/Rendezvous messaging system link. The Messaging Gateway agent creates a TIB/Rendezvous transport of type TibrvRvdTransport
for each Messaging Gateway link.
Syntax
TYPE SYS.MGW_TIBRV_PROPERTIES IS OBJECT( service VARCHAR2(128), daemon VARCHAR2(128), network VARCHAR2(256), cm_name VARCHAR2(256), cm_ledger VARCHAR2(256), -- Methods STATIC FUNCTION construct RETURN SYS.MGW_TIBRV_PROPERTIES, STATIC FUNCTION alter_construct RETURN SYS.MGW_TIBRV_PROPERTIES );
Attributes
Table 58-23 SYS.MGW_TIBRV_PROPERTIES Attributes
Attribute | Description |
---|---|
|
The service parameter for the rvd transport |
|
The daemon parameter for the rvd transport |
|
The network parameter for the rvd transport |
|
The CM correspondent name. Reserved for future use. |
|
The CM ledger file name. Reserved for future use. |
Methods
Table 58-24 SYS.MGW_TIBRV_PROPERTIES Methods
Method | Description |
---|---|
|
Constructs a new |
|
Constructs a new |
Table 58-25 DBMS_MGWADM Package Subprograms
Subprogram | Description |
---|---|
Adds a subscriber used to consume messages from a source queue for propagation to a destination |
|
Alters Messaging Gateway agent parameters |
|
Alters the properties of a TIB/Rendezvous messaging system link |
|
Alters the properties of a WebSphere MQ messaging system link |
|
Alters a propagation schedule |
|
Alters the parameters of a subscriber used to consume messages from a source queue for propagation to a destination |
|
Cleans up Messaging Gateway |
|
Creates a messaging system link to a TIB/Rendezvous messaging system |
|
Creates a messaging system link to a WebSphere MQ messaging system |
|
Configures connection information used by the Messaging Gateway agent for connections to Oracle Database |
|
Disables a propagation schedule |
|
Enables a propagation schedule |
|
Registers a non-Oracle queue entity in Messaging Gateway |
|
Removes a messaging system link for a non-Oracle messaging system |
|
Removes a subscriber used to consume messages from a source queue for propagation to a destination |
|
Resets the propagation error state for a subscriber |
|
Schedules message propagation from a source to a destination |
|
Dynamically alters the Messaging Gateway agent logging level |
|
Shuts down the Messaging Gateway agent |
|
Starts the Messaging Gateway agent |
|
Removes a non-Oracle queue entity in Messaging Gateway |
|
Removes a propagation schedule |
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 options IN SYS.MGW_PROPERTIES DEFAULT NULL);
Parameters
Table 58-26 ADD_SUBSCRIBER Procedure Parameters
Parameter | Description |
---|---|
|
Specifies a user-defined name that identifies this subscriber |
|
Specifies the type of message propagation. |
|
Specifies the source queue to which this subscriber is being added. The syntax and interpretation of this parameter depend on the value specified for |
|
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 |
|
Specifies an optional subscription rule used by the subscriber to dequeue messages from the source queue. This is |
|
Specifies the transformation needed to convert between the Oracle Streams AQ payload and an ADT defined by Messaging Gateway. The type of transformation needed depends on the value specified for If |
|
Specifies a queue used for exception message logging purposes. This queue must be on the same messaging system as the propagation source. If The source queue and exception queue cannot be the same queue. |
|
Optional subscriber properties. |
Usage Notes
See Also:
"Handling Arbitrary Payload Types Using Message Transformations", in Oracle Streams Advanced Queuing User's Guide and Reference for more information regarding message conversion and transformationIf the non-Oracle messaging link being accessed for the subscriber uses a JMS interface, then the Messaging Gateway agent will use the Oracle JMS interface to access the Oracle Streams AQ queues. Otherwise the native Oracle Streams AQ interface will be used. Parameters are interpreted differently when the Messaging Gateway agent uses Oracle JMS for JMS connections.
Transformations are not currently supported if the Oracle JMS interface is used for propagation. The transformation parameter must be NULL
.
See Also:
For additional information regarding subscriber optionsOUTBOUND_PROPAGATION Subscribers
The parameters for a subscriber used for outbound propagation are interpreted as follows:
queue_name
specifies the local Oracle Streams AQ queue that is the propagation source. This must have a syntax of schema.queue
.
destination
specifies the foreign queue to which messages are propagated. This must have a syntax of registered_queue@message_link
.
rule
specifies an optional Oracle Streams AQ subscriber rule if the native Oracle Streams AQ interface is used, or a JMS selector if the Oracle JMS interface is used. If NULL
, then no rule or selector is used.
transformation
specifies the transformation used to convert the Oracle Streams AQ payload to an ADT defined by Messaging Gateway.
Messaging Gateway propagation dequeues messages from the Oracle Streams AQ queue using the transformation to convert the Oracle Streams AQ payload to a known ADT defined by Messaging Gateway. The message is then enqueued in the foreign messaging system based on the Messaging Gateway ADT.
exception_queue
specifies the name of a local Oracle Streams AQ queue to which messages are moved if an exception occurs. This must have a syntax of schema.queue
.
If the native Oracle Streams AQ interface is used, then a subscriber will be added to the Oracle Streams AQ queue when this procedure is called, whether or not Messaging Gateway is running. The local subscriber will be of the form sys.aq$_agent('MGW_
subscriber_id
'
, NULL,
NULL)
.
If the Oracle JMS interface is used, then the Messaging Gateway agent will create a JMS durable subscriber with the name of MGW_
subscriber_id
. If the agent is not running when this procedure is called, then the durable subscriber will be created the next time the agent starts.
The exception queue has the following caveats:
The user is responsible for creating the Oracle Streams AQ queue to be used as the exception queue.
The payload type of the source and exception queue must match.
The exception queue must be created as a queue type of DBMS_AQADM.NORMAL_QUEUE
rather than DBMS_AQADM.EXCEPTION_QUEUE
. Enqueue restrictions prevent Messaging Gateway propagation from using an Oracle Streams AQ queue of type EXCEPTION_QUEUE
as a Messaging Gateway exception queue.
INBOUND_PROPAGATION Subscribers
The parameters for a subscriber used for inbound propagation are interpreted as follows:
queue_name
specifies the foreign queue that is the propagation source. This must have a syntax of registered_queue@message_link
.
destination
specifies the local Oracle Streams AQ queue to which messages are propagated. This must have a syntax of schema.queue
.
rule
specifies an optional subscriber rule that is valid for the foreign messaging system. This is NULL
if no rule is needed.
transformation
specifies the transformation used to convert an ADT defined by Messaging Gateway to the Oracle Streams AQ payload type.
Messaging Gateway propagation dequeues messages from the foreign messaging system and converts the message body to a known ADT defined by Messaging Gateway. The transformation is used to convert the Messaging Gateway ADT to an Oracle Streams AQ payload type when the message is enqueued to the Oracle Streams AQ queue.
exception_queue
specifies the name of a foreign queue to which messages are moved if an exception occurs. This must have a syntax of registered_queue@message_link
.
Whether or not a subscriber is needed depends on the requirements of the non-Oracle messaging system. If a durable subscriber is necessary, then it will be created by the Messaging Gateway agent. If the agent is not running at the time this procedure is called, then the creation of the subscriber on the non-Oracle messaging system will occur when the agent next starts.
The exception queue has the following caveats:
The exception queue must be a registered non-Oracle queue.
The source and exception queues must use the same messaging system link.
This procedure configures Messaging Gateway agent parameters.
Syntax
DBMS_MGWADM.ALTER_AGENT ( max_connections IN BINARY_INTEGER DEFAULT NULL, max_memory IN BINARY_INTEGER DEFAULT NULL, max_threads IN BINARY_INTEGER DEFAULT NULL);
Parameters
Table 58-27 ALTER_AGENT Procedure Parameters
Parameter | Description |
---|---|
|
The maximum number of messaging connections to Oracle Database used by the Messaging Gateway agent. If it is |
|
The maximum heap size, in MB, used by the Messaging Gateway agent. If it is |
|
The number of messaging threads that the Messaging Gateway agent creates. If it is |
Usage Notes
Default values for these configuration parameters are set when the Messaging Gateway agent is installed.
Changes to the max_memory
and max_threads
parameters take effect the next time the Messaging Gateway agent is active. If the Messaging Gateway agent is currently active, then it must be shut down and restarted for the changes to take effect.
Alters the properties of a TIB/Rendezvous messaging system link.
Syntax
DBMS_MGWADM.ALTER_MSGSYSTEM_LINK ( linkname IN VARCHAR2, properties IN SYS.MGW_TIBRV_PROPERTIES, options IN SYS.MGW_PROPERTIES DEFAULT NULL, comment IN VARCHAR2 DEFAULT DBMS_MGWADM.NO_CHANGE );
Parameters
Table 58-28 ALTER_MSGSYSTEM_LINK Procedure Parameters for TIB/Rendezvous
Parameters | Description |
---|---|
|
The messaging system link name |
|
Basic properties for a TIB/Rendezvous messaging system link. If |
|
Optional link properties. If |
|
A user-specified description, or |
Usage Notes
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 optional 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.
See Also:
SYS.MGW_PROPERTIES Object TypeSome properties cannot be modified, and this procedure will fail if an attempt is made to alter such a property. For properties and options that can be changed, a few are dynamic, and Messaging Gateway uses the new values immediately. Others require the Messaging Gateway agent to be shut down and restarted before they take effect.
See Also:
"TIB/Rendezvous System Properties" in Oracle Streams Advanced Queuing User's Guide and Reference for more information about the messaging system properties and optionsThis procedure alters the properties of a WebSphere MQ 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 58-29 ALTER_MSGSYSTEM_LINK Procedure Parameters for WebSphere MQ
Parameters | Description |
---|---|
|
The messaging system link name |
|
Basic properties for a WebSphere MQ messaging system link. If it is |
|
Optional link properties. |
|
An optional description or |
Usage Notes
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 optional 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.
See Also:
SYS.MGW_PROPERTIES Object TypeSome properties cannot be modified, and this procedure will fail if an attempt is made to alter such a property. For properties and options that can be changed, a few are dynamic, and Messaging Gateway uses the new values immediately. Others require the Messaging Gateway agent to be shut down and restarted before they take effect.
See Also:
"WebSphere MQ System Properties" in Oracle Streams Advanced Queuing User's Guide and Reference for more information about the messaging system properties and optionsThis 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 NULL);
Parameters
Table 58-30 ALTER_PROPAGATION_SCHEDULE Procedure Parameters
Parameter | Description |
---|---|
|
Identifies the propagation schedule to be altered |
|
Reserved for future use |
|
Reserved for future use |
|
Specifies the polling interval, in seconds, used by the Messaging Gateway agent when checking for messages in the source queue. If no messages are available in the source queue, then the agent will not poll again until the polling interval has passed. Once the agent detects a message it will continue propagating messages as long as any are available. Values: |
Usage Notes
This procedure always overwrites the existing value for each parameter. If a given parameter is not specified, then the existing values are overwritten with the default value.
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, options IN SYS.MGW_PROPERTIES DEFAULT NULL );
Parameters
Table 58-31 ALTER_SUBSCRIBER Procedure Parameters
Parameter | Description |
---|---|
|
Identifies the subscriber to be altered |
|
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 propagation type. A |
|
Specifies the transformation needed to convert between the Oracle Streams AQ payload and an ADT defined by Messaging Gateway. The type of transformation needed depends on the subscriber propagation type. A |
|
Specifies a queue used for exception message logging. This queue must be on the same messaging system as the propagation source. If no exception queue is associated with the subscriber, then propagation stops if a problem occurs. The syntax and interpretation of this parameter depend on the subscriber propagation type. A The source queue and exception queue cannot be the same queue. |
|
Optional subscriber properties. If |
Usage Notes
If the non-Oracle messaging link being accessed for the subscriber uses a JMS interface, then the Messaging Gateway agent will use the Oracle JMS interface to access the Oracle Streams AQ queues. Otherwise the native Oracle Streams AQ interface will be used. Parameters are interpreted differently when the Messaging Gateway agent uses Oracle JMS for JMS connections.
When propagating from a JMS source, the subscriber rule cannot be altered. Instead, the subscriber must be removed and added with the new rule. For JMS, changing the message selector on a durable subscription is equivalent to deleting and re-creating the subscription.
Transformations are not currently supported if the Oracle JMS interface is used for propagation. The transformation parameter must be DBMS_MGWADM.NO_CHANGE
(the default value).
The options
parameter specifies a set of properties used to alter the current optional 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.
See Also:
SYS.MGW_PROPERTIES Object Type for more information on the options parameter
"WebSphere MQ System Properties" in Oracle Streams Advanced Queuing User's Guide and Reference for more information about WebSphere MQ subscriber options
"TIB/Rendezvous System Properties" in Oracle Streams Advanced Queuing User's Guide and Reference for more information about TIB/Rendezvous subscriber options
"OUTBOUND_PROPAGATION Subscribers for outbound propagation parameter interpretation
"INBOUND_PROPAGATION Subscribers for inbound propagation parameter interpretation
This procedure cleans up Messaging Gateway. The procedure performs cleanup or recovery actions that may be needed when Messaging Gateway is left in some abnormal or unexpected condition. The MGW_GATEWAY
view lists Messaging Gateway status and configuration information that pertains to the cleanup actions.
Syntax
DBMS_MGWADM.CLEANUP_GATEWAY( action IN BINARY_INTEGER, sarg IN VARCHAR2 DEFAULT NULL);
Parameters
Table 58-32 CLEANUP_GATEWAY Procedure Parameters
Parameter | Description |
---|---|
|
The cleanup action to be performed. Values:
|
|
Optional argument whose meaning depends on the value specified for |
Usage Notes
CLEAN_STARTUP_STATE
sarg
is not used and must be NULL
.
The CLEAN_STARTUP_STATE
action recovers Messaging Gateway to a known state when the Messaging Gateway agent has crashed or some other abnormal event occurs, and Messaging Gateway cannot be restarted. This should be done only when the Messaging Gateway agent has been started but appears to have crashed or has been nonresponsive for an extended period of time.
The CLEAN_STARTUP_STATE
action may be needed when the MGW_GATEWAY
view shows that the AGENT_STATUS
value is something other than NOT_STARTED
or START_SCHEDULED,
and the AGENT_PING
value is UNREACHABLE
for an extended period of time.
If the AGENT_STATUS
value is BROKEN
, then the Messaging Gateway agent cannot be started until the problem has been resolved and the CLEAN_STARTUP_STATE
action used to reset the agent status. A BROKEN
status can indicate that the Messaging Gateway start job detected a Messaging Gateway agent already running. This condition that should never occur under normal use.
Cleanup tasks include:
Removing the queued job used to start the external Messaging Gateway agent process.
Setting certain configuration information to a known state. For example, setting the agent status to NOT_STARTED.
Execution of this command fails if:
The agent status is NOT_STARTED
or START_SCHEDULED.
No shutdown attempt has been made prior to calling this procedure, except if the agent status is STARTING.
The Messaging Gateway agent is successfully contacted.
The assumption is that the agent is active, and this procedure fails. If the agent does not respond after several attempts have been made, then the cleanup tasks are performed. This procedure takes at least several seconds and possibly up to one minute. This is expected behavior under conditions where this particular cleanup action is appropriate and necessary.
Note:
Terminate any Messaging Gateway agent process that may still be running after aCLEAN_STARTUP_STATE
action has been successfully performed. This should be done before calling DBMS_MGWADM
.STARTUP
to start Messaging Gateway. The process is usually named extprocmgwextproc
.CLEAN_LOG_QUEUES
sarg
is not used and must be NULL
.
The Messaging Gateway agent will clean log queues for all configured messaging system links. The agent will temporarily stop all propagation activity and then remove all obsolete and bad log records from the log queues for all links. The procedure will fail if the Messaging Gateway agent is not running.
This cleanup action is automatically performed each time the Messaging Gateway agent is started.
Note:
For Oracle Database 10g, theCLEAN_LOG_QUEUES
action is performed only on agent startup. If this procedure is called when the agent is running, then the Messaging Gateway agent ignores it.RESET_SUB_MISSING_LOG_REC
sarg
specifies a Messaging Gateway subscriber ID to be reset. It must be not NULL
.
The Messaging Gateway agent recovers a Messaging Gateway subscriber that has failed due to a missing log record. The agent will reset the source and destination log records. The procedure will fail if the Messaging Gateway agent is not running.
Caution:
If the messages in the source queue had already been propagated to the destination queue, then this action may result in duplicate messages.RESET_SUB_MISSING_MESSAGE
sarg
specifies a Messaging Gateway subscriber ID to be reset. It must be not NULL
.
The Messaging Gateway agent recovers a Messaging Gateway subscriber that has failed due to a missing persistent source message. The agent will treat the message as a non-persistent message and continue processing that subscriber. The procedure will fail if the Messaging Gateway agent is not running.
Creates a link to a TIB/Rendezvous messaging system.
Syntax
DBMS_MGWADM.CREATE_MSGSYSTEM_LINK ( linkname IN VARCHAR2, properties IN SYS.MGW_TIBRV_PROPERTIES, options IN SYS.MGW_PROPERTIES DEFAULT NULL, comment IN VARCHAR2 DEFAULT NULL );
Parameters
Table 58-33 CREATE_MSGSYSTEM_LINK Procedure Parameters for TIB/Rendezvous
Parameter | Description |
---|---|
|
A user-defined name to identify this messaging system link |
|
Basic properties of a TIB/Rendezvous messaging system link. |
|
Optional link properties. |
|
A user-specified description. |
Usage Notes
See Also:
"TIB/Rendezvous System Properties" in Oracle Streams Advanced Queuing User's Guide and Reference for more information about the messaging system properties and optionsThis procedure creates a messaging system link to a WebSphere MQ 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 58-34 CREATE_MSGSYSTEM_LINK Procedure Parameters for WebSphere MQ
Parameter | Description |
---|---|
|
A user-defined name to identify the messaging system link |
|
Basic properties of a WebSphere MQ messaging system link |
|
Optional link properties. |
|
A user-specified description. |
Usage Notes
See Also:
"WebSphere MQ System Properties" in Oracle Streams Advanced Queuing User's Guide and Reference for more information about the messaging system properties and optionsThis procedure configures connection information used by the Messaging Gateway agent for connections to Oracle Database.
Syntax
DBMS_MGWADM.DB_CONNECT_INFO ( username IN VARCHAR2, password IN VARCHAR2, database IN VARCHAR2 DEFAULT NULL);
Parameters
Table 58-35 DB_CONNECT_INFO Procedure Parameters
Parameter | Description |
---|---|
|
The username used for connections to Oracle Database. |
|
The password used for connections to Oracle Database. |
|
The database connect string used by the Messaging Gateway agent. Oracle strongly recommends that a not |
Usage Notes
The Messaging Gateway agent connects to Oracle Database as the user configured by this procedure. An Oracle administrator should create the user, grant it the role MGW_AGENT_ROLE,
and then call this procedure to configure Messaging Gateway. Role MGW_AGENT_ROLE
is used to grant this user special privileges needed to access Messaging Gateway configuration information stored in the database, enqueue or dequeue messages to and from Oracle Streams AQ queues, and perform certain Oracle Streams AQ administration tasks.
This procedure disables a propagation schedule.
Syntax
DBMS_MGWADM.DISABLE_PROPAGATION_SCHEDULE ( schedule_id IN VARCHAR2 );
Parameters
Table 58-36 DISABLE_PROPAGATION_SCHEDULE Procedure Parameters
Parameter | Description |
---|---|
|
Identifies the propagation schedule to be disabled |
This procedure enables a propagation schedule.
Syntax
DBMS_MGWADM.ENABLE_PROPAGATION_SCHEDULE ( schedule_id IN VARCHAR2 );
Parameters
Table 58-37 ENABLE_PROPAGATION_SCHEDULE Procedure Parameters
Parameter | Description |
---|---|
|
Identifies the propagation schedule to be enabled |
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 58-38 REGISTER_FOREIGN_QUEUE Procedure Parameters
Parameters | Description |
---|---|
|
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. |
|
The link name for the messaging system on which this queue exists |
|
The message provider (native) queue name. If |
|
The domain type of the queue. |
|
Optional queue properties |
|
A user-specified description. Can be |
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.
See Also:
For more information when registering queues for the WebSphere MQ messaging system or the TIB/Rendezvous messaging system, specifically "Optional Foreign Queue Configuration Properties" in Oracle Streams Advanced Queuing User's Guide and Reference.This procedure removes a messaging system link for a non-Oracle messaging system.
Syntax
DBMS_MGWADM.REMOVE_MSGSYSTEM_LINK( linkname IN VARCHAR2);
Parameters
Table 58-39 REMOVE_MSGSYSTEM_LINK Procedure Parameters
Parameters | Description |
---|---|
|
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 procedure fails if there is a registered foreign (non-Oracle) queue that references this link.
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 58-40 REMOVE_SUBSCRIBER Procedure Parameters
Parameter | Description |
---|---|
|
Identifies the subscriber to be removed |
|
Specifies whether this procedure should succeed even if Messaging Gateway is not able to perform all cleanup actions pertaining to this subscriber. The Messaging Gateway agent uses various resources of Oracle Database and the non-Oracle messaging system for its propagation work. These resources are typically associated with each subscriber and need to be released when the subscriber is no longer needed. Therefore, this procedure should only be called when the Messaging 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 Oracle Streams AQ queue.
This procedure resets the propagation error state for a subscriber.
Syntax
DBMS_MGWADM.RESET_SUBSCRIBER ( subscriber_id IN VARCHAR2 );
Parameters
Table 58-41 RESET_SUBSCRIBER Procedure Parameters
Parameter | Description |
---|---|
|
Identifies the subscriber |
This procedure schedules message propagation from a source to a destination. The schedule must be enabled and Messaging 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 NULL);
Parameters
Table 58-42 SCHEDULE_PROPAGATION Procedure Parameters
Parameter | Description |
---|---|
|
Specifies a user-defined name that identifies the schedule |
|
Specifies the type of message propagation. |
|
Specifies the source queue whose messages are to be propagated. The syntax and interpretation of this parameter depend on the value specified for |
|
Specifies the destination queue to which messages are propagated. The syntax and interpretation of this parameter depend on the value specified for |
|
Reserved for future use |
|
Reserved for future use |
|
Reserved for future use |
|
Specifies the polling interval, in seconds, used by the Messaging Gateway agent when checking for messages in the source queue. If no messages are available in the source queue, then the agent will not poll again until the polling interval has passed. Once the agent detects a message it will continue propagating messages as long as any are available. Values: |
Usage Notes
For outbound propagation, parameters are interpreted as follows:
source
specifies the local Oracle Streams AQ queue from which messages are propagated. This must have a syntax of schema.queue
.
destination
specifies the foreign queue to which messages are propagated. This must have a syntax of registered_queue@message_link
.
For inbound propagation, parameters are interpreted as follows:
source
specifies the foreign queue from which messages are propagated. This must have a syntax of registered_queue@message_link
.
destination
specifies the local Oracle Streams AQ queue to which messages are propagated. This must have a syntax of schema.queue
.
The schedule is set to an enabled state when it is created.
This procedure dynamically alters the Messaging Gateway agent logging level. The Messaging Gateway agent must be running.
Syntax
DBMS_MGWADM.SET_LOG_LEVEL ( log_level IN BINARY_INTEGER);
Parameters
Table 58-43 SET_LOG_LEVEL Procedure Parameters
Parameter | Description |
---|---|
|
Level at which the Messaging Gateway agent logs information. |
This procedure shuts down the Messaging Gateway agent. No propagation activity occurs until Messaging Gateway is restarted.
Syntax
DBMS_MGWADM.SHUTDOWN ( sdmode IN BINARY_INTEGER DEFAULT DBMS_MGWADM.SHUTDOWN_NORMAL);
Parameters
Table 58-44 SHUTDOWN Procedure Parameters
Parameter | Description |
---|---|
|
The shutdown mode. The only value currently supported is |
This procedure starts the Messaging Gateway agent. It must be called before any propagation activity can take place.
Syntax
DBMS_MGWADM.STARTUP( instance IN BINARY_INTEGER DEFAULT 0, force IN BINARY_INTEGER DEFAULT DBMS_MGWADM.NO_FORCE);
Parameters
Table 58-45 STARTUP Procedure Parameters
Parameter | Description |
---|---|
|
Specifies which instance can run the job queue job used to start the Messaging Gateway agent. If this is zero, then the job can be run by any instance. |
|
If this is |
Usage Notes
The Messaging Gateway agent cannot be started until an agent user has been configured using DBMS_MGWADM.DB_CONNECT_INFO
.
This procedure submits a job queue job, which starts the Messaging Gateway agent when it runs. The instance
and force
parameters are used for job queue affinity, which you use to indicate whether a particular instance or any instance can run a submitted job.
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 58-46 UNREGISTER_FOREIGN_QUEUE Procedure Parameters
Parameter | Description |
---|---|
|
The queue name |
|
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 procedure fails if a subscriber or propagation schedule references the non-Oracle queue.
This procedure removes a propagation schedule.
Syntax
DBMS_MGWADM.UNSCHEDULE_PROPAGATION ( schedule_id IN VARCHAR2 );
Parameters