Home

 

amqmdain (WebSphere MQ services control)

 

 

Purpose

The amqmdain command applies to WebSphere MQ for Windows only.

In WebSphere MQ V6.0 all WebSphere MQ services were migrated to WebSphere MQ service or listener objects, with the exception of ROOT custom services and queue manager services.

Use amqmdain to define and administer ROOT custom services, define and administer queue manager services, and perform other Windows specific administrative tasks.

Starting a queue manager service with amqmdain is not the same as using strmqm from the command line, because the WebSphere MQ service executes in a non-interactive session, running under a different user account.

To administer and define WebSphere MQ service and listener objects, use MQSC commands, PCF commands, or the WebSphere MQ Explorer.

 

Syntax


>>-amqmdain-----------------------------------------------------> >--+- qmgr start --QMgrName-------------------------+----------><    | .- -c -. |       +- qmgr end --QMgrName--+------+-----------------+       | +- -w -+ |       | +- -i -+ |       | '- -p -' |       +- qmgr alter --QMgrName-- -i --Initiation-------+       +- refresh --------------------------------------+       +- svc list -------------------------------------+       +- svc view --ServiceName------------------------+       +- svc start --ServiceName-----------------------+       +- svc end --ServiceName-------------------------+       +- svc alter --ServiceName--| Service options |--+       +- svc delete --ServiceName----------------------+       +- svc define --ServiceName--| Service options |-+       +- auto --QMgrName-------------------------------+       +- manual --QMgrName-----------------------------+       +- status --+----------+-------------------------+       | +-QMgrName-+ |       | '-all------' |       +- regsec ---------------------------------------+       +- spn --QMgrName--+-set---+---------------------+       | '-unset-' |       '- reg --+----------+--RegParams-----------------'        +-QMgrName-+         '- * ------'     Service options |--+----------------+--+------------------+--------------------->    '- -m --QMgrName-' '- -i --Initiation-'    >--+---------------+--+--------------+--+--------------+-------->    '- -t --Service-' '- -s  command-' '- -e  command-'    >--+-----------------+------------------------------------------|    '- -x --Execution-'   

 

Keywords and parameters

All parameters are required unless the description states they are optional.

In every case, QMgrName is the name of the queue manager service to which the command applies, and ServiceName is the name of the ROOT custom services to which the command applies.

qmgr start QMgrName

Starts a queue manager service.

This parameter can also be written in the form start QMgrName.

qmgr end QMgrName

Ends a queue manager service.

This parameter can also be written in the form end QMgrName.

-c

Controlled (or quiesced) shutdown.

-w

Wait shutdown.

-i

Immediate shutdown.

-p

Preemptive shutdown.

qmgr alter QMgrName

Alters a queue manager service.

-i Initiation

Initiation type. Possible values are:

  auto Sets a queue manager service to automatic startup.
  manual Sets a queue manager service to manual startup.

refresh

Refreshes or checks the status of a queue manager. You will not see anything returned on the screen after executing this command.

svc list

Displays a list of currently defined ROOT custom services.

svc view ServiceName

Displays detailed information for a ROOT custom service.

svc start ServiceName

Starts a ROOT custom service.

svc end ServiceName

Ends a ROOT custom service.

svc delete ServiceName

Deletes a ROOT custom service.

svc alter ServiceName ServiceOptions

Alter a ROOT custom service with the options specified in ServiceOptions.

svc define ServiceName ServiceOptions

Define a ROOT custom service with the options specified in ServiceOptions.

auto QMgrName

Sets a queue manager service to automatic startup.

manual QMgrName

Sets a queue manager service to manual startup.

status QMgrName | all

These parameters are optional.

  If no parameter is supplied: Displays the status of the WebSphere MQ services.
  If a QMgrName is supplied: Displays the status of the named queue manager service.
  If the parameter all is supplied: Displays the status of all ROOT custom services.

regsec

Ensures that the security permissions assigned to the Registry keys are correct.

spn QMgrName set | unset

Allows you to set or unset the service principal name for a queue manager.

reg QMgrName | * RegParams

Parameters QMgrName, and * are optional.

  If RegParams is specified alone: Modifies queue manager configuration information in the Windows Registry related to the default queue manager.
  If QMgrName and RegParams are specified: Modifies queue manager configuration information in the Windows Registry related to the queue manager specified by QMgrName.
  If * and RegParams are specified: Modifies WebSphere MQ configuration information in the Windows Registry.

The parameter, RegParams, specifies the Registry stanzas to change, and the changes that are to be made. RegParams takes one of the following forms:

  • -c add -s stanza -v attribute=value

  • -c remove -s stanza -v [attribute|*]

  • -c display -s stanza -v [attribute|*]

If you are specifying queue manager configuration information, the valid values for stanza are:

XAResourceManager\name
ApiExitLocal\name
CHANNELS
ExitPath
Log
QueueManagerStartup
TCP
LU62
SPX
NetBios
Connection
QMErrorLog
Broker
If you are modifying WebSphere MQ configuration information, the valid values for stanza are:
ApiExitCommon\name
ApiExitTemplate\name
ACPI
AllQueueManagers
CHANNELS
DefaultQueueManager
LogDefaults
ExitProperties

The following are usage considerations:

  • amqmdain does not validate the values you specify for name, attribute, or value.

  • When you specify add, and an attribute already exists, it is modified.

  • If a stanza does not exist, amqmdain creates it.

  • When you specify remove or display, we can use the value * to remove or display all attributes.

  • If you use remove to delete the only attribute in a stanza, the stanza itself is deleted.

  • Any modification you make to the Registry re-secures all WebSphere MQ Registry entries.

ServiceOptions

The options available when defining, or altering, a ROOT custom service.

-m QMgrName

The name of the associated queue manager.

  If no parameter is supplied: The service is defined as a ROOT custom service with no associated queue manager.
  If QMgrName is supplied: The queue manager specified by QMgrName is used.
If you omit this parameter, the service is defined as a ROOT custom service with no associated queue manager.

-i Initiation

Initiation type. Possible values are:

  auto Sets the ROOT custom service to automatic startup.
  manual Sets the ROOT custom service to manual startup.
If you omit this parameter, automatic startup is set.

-t Service

Specifies the ROOT custom service type. Possible values are:

  process The ROOT custom service is not expected to run to completion. To end the ROOT custom service, issue the svc end ServiceName command.
  command The ROOT custom service is expected to run to completion.
If you omit this parameter, Service is specified as process.

-s command

The command to execute when the ROOT custom service starts.

-e command

The command to execute when the ROOT custom service ends.

-x Execution

Specifies the execution type. Possible values are:

  prefix The ROOT custom service starts before the associated queue manager starts.
  suffix The ROOT custom service starts after the associated queue manager starts.
If you omit this parameter, Execution is specified as suffix.

 

Examples

The following example adds an XAResourceManager to queue manager TEST. The commands issued are:

amqmdain reg TEST -c add -s XAResourceManager\Sample -v SwitchFile=sf1
amqmdain reg TEST -c add -s XAResourceManager\Sample -v ThreadOfControl=THREAD
amqmdain reg TEST -c add -s XAResourceManager\Sample -v XAOpenString=openit
amqmdain reg TEST -c add -s XAResourceManager\Sample -v XACloseString=closeit
To display the values set by the commands above, use:
amqmdain reg TEST -c display -s XAResourceManager\Sample -v *
The display would look something like this:
0784726, 5639-B43 (C) Copyright IBM Corp. 1994, 2002. ALL RIGHTS RESERVED.
Displaying registry value for Queue Manager 'TEST'
        Attribute = Name, Value = Sample
        Attribute = SwitchFile, Value = sf1
        Attribute = ThreadOfControl, Value = THREAD
        Attribute = XAOpenString, Value = openit
        Attribute = XACloseString, Value = closeit   
To remove the XAResourceManager from queue manager TEST, use:
amqmdain reg TEST -c remove -s XAResourceManager\Sample -v *

 

Return codes

0 Command completed normally
-2 Syntax error
-3 Failed to initialize COM library
-4 Failed to initialize COM components
-7 Failed to configure service
-9 Unexpected Registry error
-10 Unable to access required service interface (IMQDService)
-11 Unable to access required service interface (ICustomService)
-12 Unable to access required service interface (ICustomServices)
-13 Unable to access required service interface (IUnknown)
-14 Specified service not found
-15 Specified service name already exists
-16 Failed to configure service principal name
-17 Failed to start service
-18 Failed to end service
-19 Failed to delete service
-20 Failed to store service definition
-21 Service initiation type could not be configured
-22 Service flags could not be configured
-23 Service flags could not be read
-24 Service dependency could not be configured
-25 Service start command could not be configured
-26 Service end command could not be configured
-27 Service name could not be configured

  1. If the qmgr start QMgrName command is issued, all return codes that can be returned with strmqm, can be returned here also. For a list of these return codes, see strmqm (start queue manager).

  2. If the qmgr end QMgrName command is issued, all return codes that can be returned with endmqm, can be returned here also. For a list of these return codes, see endmqm (end queue manager).

 

Parent topic:

The control commands


fa15570_


 

Home