Saturday, 15 February 2014

IBM WebSphere MQ Client Overview

An IBM WebSphere MQ client is part of the IBM WebSphere MQ product that can be installed on its own, on a separate machine from the MQ server. You can run an IBM WebSphere MQ application on an IBM WebSphere MQ client, which interacts with one or more IBM WebSphere MQ servers. The IBM WebSphere MQ client connects to queue managers by means of a communications protocol. The servers to which the client connects might or might not be part of an IBM WebSphere MQ cluster.


The queues and other IBM WebSphere MQ objects are held on a queue manager that you have installed on an MQ server machine. When the application issues a client call, the IBM WebSphere MQ client directs the request to a queue manager, where it is processed and from where a reply is sent back to the IBM WebSphere MQ client. The link between the MQ application and the IBM WebSphere MQ client is established dynamically at runtime.

Thursday, 6 February 2014

Messages Backup On Queues Using Qload & Unload Utility

Create Queue Manager:
                CRTMQM QM1
Start Queue Manager:
                STRMQM QM1
Get RUNMQSC Console For Queue Manager:
                RUNMQSC QM1
Create Two Local Queues:
                DEFINE QLOCAL(Q1)
                DEFINE QLOCAL(Q2)

Put 10 messages into Q1.

Download MO03 Support Pack To Do Following Operations.

Unload a Queue to a File
qload –m QM1 –i Q1 –f c:\myfile
Load a Queue from a File
qload –m QM1 –o Q1 –f c:\myfile
Copy the messages from one Queue to another Queue
qload –m QM1 –i Q1 -o Q2 
Copy the first 10 messages from one Queue to another Queue
qload –m QM1 –i Q1 –o Q2 –r#10

Option
Meaning
x
Process message number x only.
x..y
Process message number x through y only
x#y
Process y messages starting from message x
#y
Process y messages starting from the beginning.
Note: This is the same as 1#y

Move the messages from one Queue to another Queue
qload –m QM1 –I Q1 –o Q2


Saturday, 11 January 2014

Dead Letter Handler Configuration Using Service Object

Configuring the DLQ Handler as a server service object:
To run the DLQ handler as a service, you need to define a server service object in that queue manager. This example uses a batch file and rules table for the DLQ Handler.

Step:1 Configure Dead Letter Queue For Queue Manager:

Define QLocal(DEAD.QUEUE) LIKE(SYSTEM.DEAD.LETTER.QUEUE)

ALTER QMGR DEADQ(DEAD.QUEUE)

ALTER QL(LOCAL-QUEUE-NAME) MAXDEPTH(5)

Step:2 Create Batch File

Contents of dlqhandler.bat

cd "C:\Program Files\IBM\WebSphere MQ\bin"
runmqdlq %1 %2 %3

The rules table should be defined with some REASON and ACTION sequence and WAIT (YES), which means that the DLQ Handler waits indefinitely for further messages to arrive on the DLQ.

Step:3 Rules table Content : File Name is-- RULETBL.RUL

WAIT(YES) RETRYINT(20)
REASON(*) ACTION(FWD/RETRY/DISCARD/IGNORE) FWDQ('QUEUENAME') FWDQM('QMGRNAME')

Step:4 Define server service object for DLQ Handler

DEFINE SERVICE(dlqhandler) +
SERVTYPE(SERVER) +
CONTROL(QMGR) +
STARTCMD('C:\IBM\WebSphere\MQ\dlqhandler.bat') +
DESCR('dead letter queue handler as server service') +
STARTARG('DEADQ IBMQMR < C:\IBM\WebSphere\MQ\RULETBL.RUL') +
STDOUT('C:\IBM\WebSphere\MQ\Log.txt') +
STDERR('C:\IBM\WebSphere\MQ\Err.txt') +
REPLACE

You can set CONTROL to MANUAL, QMGR, or STARTONLY based on your requirements. The value of STARTCMD is the absolute path of the executable file dlqhandler.bat (on Windows).

Step:5 Start Service:
Start service(dlqhandler)

Step:6 Display Service Status:
Display SVStatus(dlqhandler)

Step:7 Send 10 Messages From Source 

5 messages are get stored on local queue
5 messages are get stored on DEAD.QUEUE.
Retrieve messages on local queue. dead letter handler will process messages to local queue. 

Tuesday, 13 August 2013

How To Install IBM MQ On Windows

Installation On Windows
  1. Login as Administrator to the destination windows server using Remote Desktop Connection Tool
  2. Check hostname of the windows server (command is--- hostname). Hostname should not contain any spaces 
We must check Hardware & Software requirements to proceed our MQSeries installation
  •  How much disk space is free. How much disk space is required for our configuration.                 (command is -- dir | find "free") 900MB required for full installation.
  • Speed of the processor.
  • Hardware type (32 bit or 64 bit)                                                                                                 (command is--- systeminfo
  • Get MQseries Software Dump to our destination server.
  • Check whether MQSeries installation supports our destination platform or not by invoking MQLaunchpad
  • Check Eclipse installation required for our MQSeries features.If it is required we must install Eclipse first.
How To Install Eclipse & MQSeries

  • Find following path then invoke the setup.exe.                                                                              (Path is ---- MQV7.X/prereqs/IES/setup.exe)
  • Find MQLaunchpad in the following path.                                                                                          (Path is ----- MQV7.X/MQLaunch.exe)
  • Click On Software requirements in the MQ Installation Wizard. Following wizard shows prerequisite softwares has installed or not
  • Click on WebSphereMQ Installation and then click on Launch IBM WebSphere MQ Installer.

  • It opens following window. accept the license agreement

  • Choose setup type 

  • select folder for program files and then click on next

  • select data-files folder and then click on next

  • select Global securityKit files folder and then click on next


  • select  log files folder and then click on next

  • select features to install in the following window
  • In the following window we can have a look what are the features selected to install and then click on install

  • After installation check MQSeries Installed Version Info Using Command “dspmqver”. (open command prompt then execute command)

Wednesday, 3 April 2013

What is a Resource Manager, Transaction & Syncpoint

What is a resource manager?
A resource manager is a computer subsystem that owns and manages resources that can be accessed and updated by applications (i.e., WMQ queue manager – whose resources are its queues, DB2 database – whose resources are its tables).

What is a unit of work?
When a application updates the resources of one or more resource managers, it's often vital that all updates complete successfully as a group, or none of them complete. Updates that complete this way are said to occur within a 'unit of work' or 'transaction'.

What is a sync point coordinator?

The point in time when all updates within a unit of work are either committed or backed out is called a 'sync point'. The computer subsystem that manages units of work is called a sync point coordinator.

What Is Dead Letter Queue & Dead Letter Handler

Dead Letter Queue (DLQ)

- When messages can not be delivered to the intended queue, the messages may be delivered to a Dead Letter Queue (DLQ) if the queue manager has one defined.

- By default a queue manager does not have a Dead Letter Queue but you should define one for every queue manager.

- In every Queue Manager default dead letter queue is SYSTEM.DEAD.LETTER.QUEUE.


Dead Letter Messages

1) Messages can be placed on the DLQ by the queue manager, the channels (MCA) or by applications
2) When the messages are put onto DLQ, they should have a Dead Letter Header (DLH). DLH will be generated by Queue manager and MCA.
3) If application are putting the messages onto DLQ, applications must create the Dead Letter Header (DLH) to message.

Dead Letter Queue Handler

Once a message arrives on the DLQ you can automate the handling of that message using the DLQ handler program. You can have the handler running and waiting for messages to arrive on the DLQ or you can set up the DLQ to trigger the start of the handler program

Starting the DLQ Handler
You can start the DLQ handler using the RUNMQDLQ command.
Example: RUNMQDLQ -Q <DEDA LETTER QUEUE NAME> -M <QMGR NAME>  <rules.tb

where DLQ = name of your dead letter queue
QMGR = queue manager name and
rules.tb is a file with your rules table

Rules Table
It Defines how the DLQ handler will process the messages on the DLQ
Two types of entries in the rules table
-Control Data
-Rules

runmqdlq can take rules table from command line or redirect from file.

Sample Program

Websphere MQ supplies a sample program called amqsdlq which provides similar function as runmqdlq. This allows users to customize the way messages are handled from the DLQ, especially useful if you have applications placing messages directly onto DLQ.

How to write Rules in rule table explained
Rule table is looks something like: Pattern/Keyword Action. ( simillat to find a particular keyword and the do the action specified)

Pattern Keywords – allow you to match only certain messages on the DLQ
Ex: REASON – match only messages with a specified reason code

Action Keywords describe how a matching message is processed
ACTION(DISCARD|IGNORE|RETRY|FWD)
FWDQ – name of queue where message is forwarded
FWDQM – name of qmgr where message is forwarded
HEADER(YES|NO) – do messages have DLH header
PUTAUT(DEF|CTX) – userid of runmqdlq program or userid from the MD of the message on the DLQ
RETRY – number of times to retry each matching rule

More about Rule Table
1) A rules table must contain at least one rule.
2) Keywords can occur in any order.
3) A keyword can be included only once in any rule.
4) Keywords are not case-sensitive.
5) A keyword and its parameter value must be separated from other keywords by at least one blank space or comma.
6) There can be any number of blanks at the beginning or end of a rule, and between keywords, punctuation, and values.
7) Each rule must begin on a new line.
8) For reasons of portability, the significant length of a line must not be greater than 72 characters.

Sample Rule Table
***************************************************
* An example rules table for the runmqdlq command *
***************************************************
* Control data entry
* ------------------
* If parameters are not supplied on the runmqdlq command use
* SYSTEM.DEAD.LETTER.QUEUE as the input queue, use QM1_TEST as the
* queue manager and set retry interval to 20 seconds
inputq('SYSTEM.DEAD.LETTER.QUEUE') inputqm('QM1_TEST') retryint(20)

* Rules entries
* -----
* Include a rule with ACTION (RETRY) first to try to deliver the
* message to the intended destination. If a message is placed on the
* DLQ because its destination queue is full, attempt to forward the
* message to its destination queue. Make 5 attempts at approximately
* 20 second intervals (the default value for RETRYINT). Also include
* the "+" just to show how to wrap a command over to the next line.
REASON(MQRC_Q_FULL) ACTION(RETRY) RETRY(5)
* If a message is placed on the DLQ due to put inhibited, attempt to
* forward the message to its destination queue. Make 5 attempts at
* approximately 20 second intervals (the default value for RETRYINT).
REASON(MQRC_PUT_INHIBITED) ACTION(RETRY) RETRY(5)
* Include a rule to handle messages which do not match any of the
* patterns specified above. Send the messages to another queue named
* DEADQ where they can be handled later.
ACTION(FWD) FWDQ('DEADQ')

Runmqdlq examples
If you use the DLQ handler without redirecting stdin from a file (the rules table), the DLQ handler reads its input from the keyboard.
In WebSphere MQ for AIX, Solaris, HP-UX, and Linux, the DLQ handler does not start to process the named queue until it receives an end_of_file (Ctrl+D) character.
In WebSphere MQ for Windows it does not start to process the named queue until you press the following sequence of keys: Ctrl+Z, Enter, Ctrl+Z, Enter

C:\>runmqdlq SYSTEM.DEAD.LETTER.QUEUE QM1_TEST
WAIT(YES) RETRYINT(20)
REASON(MQRC_Q_FULL) ACTION(RETRY) RETRY(5)
REASON(MQRC_PUT_INHIBITED) ACTION(RETRY) RETRY(5)
REASON(*) ACTION(FWD) FWDQ('DEADQ')
^Z

2005-04-08 02.20.09 AMQ8708: Dead-letter queue handler started to process
INPUTQ(SYSTEM.DEAD.LETTER.QUEUE)



Friday, 5 October 2012

MQ Reason Codes


 2001

2009

2016

2025

2027

2029

2030

2031

2033

2035

2036

2037

2038

2039

2040

2101

2537

2538

2539

2540

2051

2052

2053

2058

2059

2092

2196

2195

2197

2198

2199

2189
MQRC_ALIAS_BASE_Q_TYPE_ERROR

MQRC_CONNECTION_BROKEN

MQRC_GET_INHIBITED

MQRC_MAX_CONNS_LIMIT_REACHED

MQRC_MISSING_REPLY_TO_Q

MQRC_MSG_TYPE_ERROR

MQRC_MSG_TOO_BIG_FOR_Q

MQRC_MSG_TOO_BIG_FOR_Q_MGR

MQRC_NO_MSG_AVAILABLE

MQRC_NOT_AUTHORIZED

MQRC_NOT_OPEN_FOR_BROWSE

MQRC_NOT_OPEN_FOR_INPUT

MQRC_NOT_OPEN_FOR_INQUIRE

MQRC_NOT_OPEN_FOR_OUTPUT

MQRC_NOT_OPEN_FOR_SET

MQRC_OBJECT_DAMAGED

MQRC_CHANNEL_NOT_AVAILABLE

MQRC_HOST_NOT_AVAILABLE

MQRC_CHANNEL_CONFIG_ERROR

MQRC_UNKNOWN_CHANNEL_NAME

MQRC_PUT_INHIBITED

MQRC_Q_DELETED

MQRC_Q_FULL

MQRC_Q_MGR_NAME_ERROR

MQRC_Q_MGR_NOT_AVAILABLE

MQRC_XMIT_Q_USAGE_ERROR

MQRC_UNKNOWN_XMIT_Q

MQRC_UNEXPECTED_ERROR

MQRC_UNKNOWN_DEF_XMIT_Q

MQRC_DEF_XMIT_Q_TYPE_ERROR

MQRC_DEF_XMIT_Q_USAGE_ERROR

MQRC_CLUSTER_RESOLUTION_ERROR

Saturday, 29 September 2012

Linux Basic Commands

$ -- Normal User Prompt
# -- System Admin Prompt

Commands

$ logname  (or) whoami  --------- To Check Present Working User

$ who ---------------------------- To Know Present Working Users
$ hostname --------To Know HostName(Machine Name) Of A Server
$ ifconfig ---------- To Find an IP 
$ lscpu ------------- To check CPU architecture
$ su [super user name] ---- Switch to Super User
$ clear---------- To Clear Screen
$ exit ------------To exit From user Session
$ man [cmd]----------- Help Facility 
$ date ----------- To Display date 
$ cal [month] [year] ----- To Display Calender
$ pwd ---------- To Know Present Working Directory
$ ls [flags]--------------To Display Directory Content
$ mkdir [dir name]---------- To Create New Directory
$ cd  [dir name] -------------- To Change Directory
$ mv [oldname] [newname) -------- To Rename Directory 
$ rmdir [Directory Name] ---------- To delete directory
$ mv [source path] [target path] ---- To Move directory with sub directories 
$ cp [source path] [target path] ---- To Copy directory with sub directories 
$ cat > [file name] ----------------- To Create  File
$ cp [source file] [target file] ------- To Copy A File
$ mv [Old File] [New File] --------- To Rename A File
$ rm [file name] --------------------- To Remove A File
$ locate [file name] ------------------- To Search A file In Whole File System
$ find [file name] [path] ---------------- To Search A file in Specified Path
$ gzip [file name] ---------------------- To Compress A File
$ gunzip [file name] ------------------- To Uncompressed A File
$ chmod [777] [file name] ------------- To Change File Permissions 
$ chown  [new owner name] [file name] --- To Change Owner
$ chgrp [new group name] [file name] ----- Change Group To A File
$ useradd -u [uid] -g [group name] -d [user home dir] -s [shell]- Creating New User
$ groupadd -g [group id] [group name] ------ To Create New Group
$ userdel [user name] ------ To Delete  User
$ shutdown [time] -------- To Shutdown System At Particular Time
$ shutdown -r now ------------- Shutdown and reboot immediately
$ shutdown -h halt -------------- Shutdown immediately and halt
$ df/df-k/df -g/df -h ---------- To Check Free Disk Space
$ du / du -s [dir name] ------- To Check Used Space 
$ vi [file name] -------------- To Open a File with VI Editor
$ head -n [no of lines] [file name] ---- To Display First N line in A File
$ tail -n [no of line] [file name] --------  To Display Last N lines In A File
  

Friday, 28 September 2012

Cluster Commands

How To Display Cluster Queue  Managers
DISPLAY CLUSQMGR(*)

How To Display Cluster Queues In Cluster Queue Manager
DISPLAY QCLUSTER(*)
How To Display Cluster Channels Status
DISPLAY CHSTATUS(*)
How To Know A Queue Manager Is Full Repository or Not  
DISPLAY CLUSQMGR(QMGR-NAME) QMTYPE

How To Suspend Queue Manager From Cluster
SUSPEND QMGR CLUSTER(CLUSTER-NAME)  
How To Know A Queue Manager Suspended or Active QMGR 
DISPLAY CLUSQMGR(QMGR-NAME) SUSPEND
How To Resume A Queue Manager To Cluster 
RESUME QMGR CLUSTER(CLUSTER-NAME) 
How To Refresh Cluster  
 REFRESH CLUSTER(CLUSTER-NAME) REPOS(YES/NO)

How To Reset Cluster
RESET CLUSTER(CLUSTER-NAME) QMID(QMGR-QMID) ACTION(FORCEREMOVE) QUEUES(YES/NO) 

Thursday, 27 September 2012

Channel And Listener Commands

Channel Commands
 How To Define channel Object
Sender Channel:
Define Channel(Channel-Name) Chltype(sdr) Conname('ip(port)') xmitq(Transmission queue name)

Receiver Channel:
Define Channel(channel name) Chltype(RCVR) Trptype(TCP)

 How To Display Channel Object
Display Channel(Channel-Name) 
 How To Display Channel Status
Display ChStatus(Channel-Name) 
 How To Alter Channel Object
Alter Channel(Channel-Name) 
Chltype(SDR/RCVR..) 
Maxmsgl(1024(Bytes))
 How To Start Channel
Start Channel(Channel-Name) 
 How To Stop Channel
Stop Channel(Channel-Name) status(Inactive/Stopped)
 How Ping Channel
Ping Channel(Channel-Name) 
 How To Reset Channel
Reset Channel(Channel-Name) Seqnum(1)
How To Delete Channel Object 
Delete Channel(Channel-Name)

Note: Channel Must Be In Down State to Delete.




Listener Commands:

How To Define Listener Object
Define Listener(Lstr-Name) Trptype(TCP/SPX/NETBIOS/LU 62) Port(1515) Control(qmgr/manual) 

How To Display Listener Object
Display LSTR(Lstr_Name) 

How To Alter Listener Object
Alter LSTR(Lstr-Name) Trptype(TCP/SPX/...) Control(qmgr/manual) 

How To Start Listener service
Start LSTR(Lstr-Name)
How To Display Listener Service Status
Display LSStatus(Lstr-Name)
How To Stop Listener Service 
Stop LSTR(Lstr-Name)

How To Delete Listener Object
Delete LSTR(Lstr-Name)


Best Regards,
MADHU K
IBM MQ Certified Professional
HYDERABAD
+917893751171/+919964371404
mailme.mq@gmail.com
trainingontech.com
http://www.ibmmqadmin-madhu.blogspot.in