Showing posts with label websphere. Show all posts
Showing posts with label websphere. Show all posts

Thursday, 18 December 2014

dmpmqcfg Save and Restore MQ queue manager objects

 Save Queue Manager configuration

 

dmpmqcfg(literally dump mq configurations), This is one of the powerfull and usefull command in the IBM MQ. Websphere MQ added this dmpmqcfg command along with others from v7.1 onwards for IBM i, windows, UNIX, & Linux platforms. This is actually a replacement of support pack MS03 popularly known as saveqmgr, which was in use for earlier versions.

This command is used to save the QM's configurations objects into different file formats and the output is used to create the duplicate and also to restore the existing. MQ objects are queue manager, such as queues, topics, channel  authentication records, and listeners.

If the environment is subjected for changes, It is used to save configurations periodically and create templates for duplicating. Please note that dmpmqcfg does not make backup of MQ Advanced Message Security policies and Subscriptions created by applications using the MQSUB MQI call of type MQSUBTYPE_API.    

dmpmqcfg is also used to dump the mq configurations of a remote queue manager without needed to run the dumpcfg command on the remote system. This is called queue mode.

  
The command dmpmqcfg takes the following options:

 -m   Queue manager name.
 -n   Object name or a generic object name.
 -t   Object type: all, authinfo, channel, clntconn, comminfo, listener, namelist, process, queue, qmgr, service, topic.
 -x   Export type: all, object, authrec, chlauth, sub.
 -o   Format: mqsc, 1line, setmqaut, grtmqmaut.
 -a   Dump all attributes.
 -z   Suppress warnings.
 -s   Reset channel message sequence number
 -q   Reply to queue name, default SYSTEM.DEFAULT.MODEL.QUEUE
 -r   Remote queue manager name (queued mode)
 -c   Client connection: default, DEFINE CHANNEL(chlname) CHLTYPE(CLNTCONN) ...


  • To save the MQ object configuration of queue manager QM.JOE.01 to qmgr_data.mqsc

   dmpmqcfg.exe -m QM.JOE.01 > qmgr_data.mqsc  


  • To save only the listeners data of QM.JOE.01 to qmgr_data_listener.out

   dmpmqcfg.exe -m QM.JOE.01 -t listener> qmgr_data_listener.out  


  • To save only the channel authentication records of QM.JOE.01 to qmgr_data_authrec.out

   dmpmqcfg.exe -m QM.JOE.01 -x authrec > qmgr_data_authrec.out  

  • To save the MQ configurations of a remote queue manager.

   dmpmqcfg -m MYQMGR -c "DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(CLNTCONN) CONNAME('hostname(1414)')"  

Sample output will be looking like below:


 ******************************************************************************************
* Script generated on 2014-12-18   at 17.43.04
* Script generated by user 'xjjh1' on host 'NPENSOGFLT144'
* Queue manager name: QM.JOE.01
* Queue manager platform: Windows
* Queue manager command level: (710/711)
* Command issued: dmpmqcfg.exe -m QM.JOE.01
******************************************************************************************
ALTER QMGR +
*  ALTDATE(2014-12-02) +
*  ALTTIME(15.27.59) +
   CCSID(850) +
   CLWLUSEQ(LOCAL) +
*  CMDLEVEL(710) +
*  COMMANDQ(SYSTEM.ADMIN.COMMAND.QUEUE) +
*  CRDATE(2014-12-02) +
*  CRTIME(15.27.59) +
   DEADQ('SYSTEM.DEAD.LETTER.QUEUE') +
*  PLATFORM(WINDOWSNT) +
*  QMID(QM.JOE.01_2014-12-02_15.27.59) +
   SSLCRYP(' ') +
   SSLKEYR('C:\IBM_MQ\qmgrs\QM!JOE!01\ssl\key') +
   SUITEB(NONE) +
*  VERSION(07010003) +
*  XRCAP(YES) +
   FORCE



P.S: In the above sample the lines starting with asterisk('*') will be not be added when restoring the file. These lines are only used to study the configurations nothing else.

Restore Queue Manager configuration

-on progress to be written here-

Tuesday, 15 July 2014

Jacl to Jython Conversion


The IBM Jacl to Jython Conversion Assistant (Jacl2Jython) is a program that assists in converting WebSphere administrative (wsadmin) scripts written in Jacl into Jython syntax.

This utility is a product of IBM and used for wsadmin scritps written on jacl and the results of conversion are syntactically equivalent but not 100% ready to execute. Manual correction and validation is required most of the time for complex jacl scripts.

If any line is difficult to convert automatically by this program, these preliminary converted lines of script are flagged #?PROBLEM? which needs manual verification.

This Utility you can download here and for detailed descriptions of this conversion utility. Unzip the pack. 




Set your JAVA_HOME environment variable in server/computer's command line and then change accordingly the [Jacl2Jython bat|sh]



 





SYNTAX :

Jacl2Jython.bat your_jacl_script.jacl




EXECUTION: 


Place the .jacl file in the same folder and execute(In my example it is test.jacl)




 
OUTPUT :

 You can see a python file generated for this jacl script in the same folder. Verify throughly the python script for any errors.