Call Me at +91 7798846928 for Trainings

My photo
I am a Middleware Trainer and Consultant for Websphere (WAS, MQ), Weblogic, SOA and JBOSS Administration. Drop a mail to kvn@live.in for trainings and videos or call on +91 7798846928 for details.

Wednesday, February 19, 2014

How to generate Heap Dumps manually in Websphere Application Server 7 and analyze?

Although heap dumps are generated only in response to a detected memory leak, you must understand that generating heap dumps can have a severe performance impact on WebSphere Application Server for several minutes. When generating multiple heap dumps manually for memory leak analysis, make sure that significant objects are leaked in between the two heap dumps. This approach enables problem determination tools to identify the source of the memory leak.

On JVM in WebSphere Application Server, you can manually produce heap dumps by using the wsadmin tool to run scripts with generateHeapDump operation on MBeans. 
On a Java virtual machines (JVM) in WebSphere Application Server, you cannot enable automated heap dump generation.
 WAS supports the Jacl and Jython scripting languages only, which will be used to interface with WAS through wsadmin.

Steps involved:

1.    Start the wsadmin scripting client.

Finding JVM objectName:
<wsadmin> set objectName [$AdminControl queryNames WebSphere:type=JVM,process=<servername>,node=<nodename>,*] 

2.    Invoke the generateHeapDump operation on a JVM MBean, for example, 
<wsadmin> $AdminControl invoke $objectName generateHeapDump
 
 
where, 
The following table explains variables in the command previously mentioned.
$ is a Jacl operator for substituting a variable name with its value
invoke is the command
generateHeapDump is the operation you are invoking
<servername> is the name of the server on which you want to generate a heap dump
<nodename> is the node to which <servername> belongs
 
After running the wsadmin command above, the file name of the heap dump is returned.

How to analyze a heap dump generated either wise?

Do not analyze heap dumps on the WAS machine because analysis is very expensive (CPU and disk I/O intensive). For analysis, transfer heap dumps to a dedicated problem determination machine.

Steps involved:

 1.    On the physical application server where a memory leak is detected, go to the WebSphere Application Server home directory (WAS_ROOT\PROFILE_ROOT\ProfileName).
2.     Heap dumps generated here will be in below format:
         heapdump.<date>.<timestamp>.<pid>.phd 
3.     Gather all the .phd files and transfer them to your problem determination machine for analysis.
Note: In some environments they will be configured to plain text format, you can toggle this on adminconsole websphere variables section.
4.     "Memory Dump Diagnostic For Java" is the tool from IBM for heap dump analysis and verbose GC analysis. There are many other third-party tools available to do the same.

Thursday, February 13, 2014

Websphere MQ Basics/Fundamentals

IBM WMQ ensures once and only once assured delivery of messages from one business application to another business application.

Pre-defined MQ Objects are 7:
1 Queue Manager
2 Queue
3 Channel
4 Listener
5 Process
6 NameList
7 Service

Queue Manager is initial and foremost object. Unless QM object is defined the other objects cant be created.
The remaining 6 objects can/will be defined in Queue Manager control. Therefore Queue Manager is a sub-system which can control MQ objects.
Queue Manager is SPOC for connecting Business Apps to perform PUT/GET operations on Queue objects.

CRTMQM: is a control command to create a queue manager.
Template: C:\> CRTMQM <QMNAME>
Example: CRTMQM BOCQM1

In production like environment we limit the Queue Manager name to 8 uppercase characters. 8 char is the limit for QM object name.
Name of the MQ server is <QMNAME>

DSPMQ: is a control command to track the current status of QM.
Template: C:\> DSPMQ -M <QMNAME>
Example: DSPMQ -M BOCQM1
Default status of QM is 'ended immediately'.


How to create other MQ objects once QM is defined/created?
QM service should be running.

STRMQM: is a control command to start the QM.
Template: C:\> STRMQM <QMNAME>
Example: STRMQM BOCQM1

DSPMQ: is a contol command which will display QM name and status properties.
Now check the status of QM!
Example: DSPMQ -M BOCQM1
Status of BOCQM1 Queue manager is changed to 'Running'

ENDMQM: is a control command which will be used to stop QM.
Template: ENDMQM -I <QMNAME>, ENDMQM <QMNAME>
Example: ENDMQM -I VANQM1, ENDMQM VANQM1

How to create other MQ objects once QM is defined/created and is running?
RUNMQSC: is a control command To switch/interfacewith QM and define other MQ objects. Once we execute this command, MQSC for QM will be enabled.
All 14 MQSC commands are constant.

Valid MQSC commands are:
1 ALTER
2 CLEAR
3 DEFINE
4 DELETE
5 DISPLAY
6 END
7 PING
8 REFRESH
9 RESET
10 RESOLVE
11 RESUME
12 START
13 STOP
14 SUSPEND

The above MQSC commands will be used for administering the MQ objects defined under QM.
END is an MQSC command which is used to quit the RUNMQSC console(QM control area/WMQ System Admin MQ access).

In IBM WMQ, queues are classified in 2 categories:
1 Pre-defined Q's
2 Dynamic Q's

Pre-defined Q's are 4 in count:
1 Local Q >> Holds business data/messages, therefore its also called business Q.
2 Alias Q
3 Remote Q
4 Model Q >> is a template to create Dynamic Q using model Q object definition and is done in run-time.

Dynamic Q's are 2 in number:
1 Temporary Dynamic Q
2 Permanent Dynamic Q

There are 4 special local Queues(which are not business queues) :
1 Transmission Q
2 Initiation Q
3 Dead Letter Q
4 System Q

GOTCHAS >> If "TYPE(QLOCAL) USAGE(NORMAL)" then such a queue is a business queue. If USAGE(XMITQ) is used instead, then it will become transmission queue.


DEFINE: is a RUNMQSC command used to create pre-defined objects other than QM.
Channel names are limited to 20 characters in length.
Other object names can be upto 48 characters.
Example: DEFINE QLOCAL(QNAME)

DISPLAY: is a RUNMQSC command which is used to display properties of MQ objects other than QM.
Example: DISPLAY QSTATUS(QNAME) TYPE(HANDLE)

ALTER: is a RUNMQSC command used to change the behaviour/property values of objects other than QM.
Example: ALTER QLOCAL(QNAME) PUT(DISABLED) GET(ENABLED)

MAXMSGL: is a Q property which indicates the maximum length of a message that it can hold.
Example: DISPLAY QLOCAL(QNAME) MAXMSGL, ALTER QLOCAL(QNAME) MAXMSGL(40).
By default the maxmsgl property of a q can hold a message of lenth 4 MB each. Remember that it shows maxmessagelength value in bytes.
The maximum message length allowed in MQ is 100MB. Default is 4MB.

gotcha >> TASKKILL /F /PID PROCESSID
Example: TASKKILL /F /PID 3442

DELETE: is a RUNMQSC command used to delete the MQ objects other than QM.
Example: DELETE QLOCAL(TESTQ)

Wednesday, February 5, 2014

Sunday, January 26, 2014

Choosing or Switching Middleware Software


Choosing middleware to knit together disparate systems can be one of the biggest headaches in IT. But getting it right can also be one of the biggest opportunities to reap competitive advantage.

If you think your operating system constitutes the most critical software in your enterprise IT, think again. Middleware looks set to become the IT battleground of the future, the facet of your infrastructure from which you will need to thrash out business advantage. While the operating system is fast becoming a commodity item, the middleware tying applications and processes together is still an ill-defined range of software components, requiring considerable customisation and having no commonly agreed definition. Unfortunately, it is also far harder to get right.

The major analyst firms are predicting a rosy future for middleware. Gartner forecasts that middleware software will account for 28% of IT expenditure by 2015, compared with just 10% in 2002. This latter figure of 1% might seem puzzling given that integration has been a significant overhead in large IT projects for some time, but it only includes the software, not the internal IT effort of making it work. Indeed according to Ed Wrazen, marketing director of middleware consultancy CommerceQuest, integration already accounts for 30% to 40% of the cost of a typical IT project, and often as much as 70%.

Middleware software itself is supposed to ease the integration burden, by providing at least some of the functionality off-the-shelf to link applications together and provide more consistent access to information. In practice though middleware can create as many integration problems as it solves, if care is not taken to adopt a coherent strategy for enterprise application integration (EAI). For just as most large enterprises have a variety of different ERP systems, perhaps because of acquisitions or devolution of IT to local departments, so they have middleware from more than one supplier.

And yet, as Hanafi Houbart, senior consultant in e-commerce at Unipower Systems, points out, changing middleware on any scale is usually difficult and expensive. "In practice no one ever changes established middleware unless either the underlying operating system [bottomware], or overlying applications [topware] are also changed en masse, or the middleware itself has failed to establish well," says Houbart. "That's why middleware products tend to have longer product histories than front-line applications - they just keep getting upgraded."

If there is a time to change your principal middleware supplier though, for whatever reason, it is now. Within a few years middleware will be even more inextricably linked with key platforms and applications, making change yet harder. In theory it should be possible to change horses if the middleware adheres to common standards, but in truth the relevant standards do not yet exist and in any case are hard to crystallise in a continuously changing field. A major problem, according to Kay Hammer, chief executive officer of integration software firm ETI, is that applications are tied in with the middleware via application programming interfaces (APIs) in a way that is hard to standardise and needs completely reworking when you change supplier. This can be a complex process with the danger of introducing errors or unanticipated changes to processes.

"So while over time there will be some standard XML message format that would facilitate moving from one middleware supplier to another, to some extent while you're putting calls into your programs that directly reference their APIs, then you're really putting yourself at some risk," says Hammer.

To avoid becoming effectively locked in to their primary middleware, enterprises must build their own software shell between their applications and the back end or "bottomware" systems such as the database. The most enlightened organisations have already done this, says Hammer, who cites the case of one customer implementing a business-to-business (B2B) infrastructure based on BEA Systems' Web Logic middleware. "They're putting their own shell in because although happy with BEA Systems now, they recognise over time they may need to change their middleware supplier," says Hammer.

The shell handles all the calls into the underlying databases and provides a consistent layer connecting these to the topware applications. The middleware then plugs into this shell, which provides the link to the back-end systems. It is then easier, although still by no means trivial, to change the middleware, because now it just involves re-implementing the shell without changing the calls into backend systems.

Until recently enterprises needing to develop such a middleware shell would have had to do the job themselves, but now tools are emerging to help generate the interface layer. This layer needs to comprise not just hooks, but also information about what is being connected to, and what is being done. In effect, therefore, it should comprise metadata, providing a map to the back-end databases as well as information about how the front-end applications are accessing this. The big weakness of existing middleware suppliers is their lack of a metadata strategy, according to Hammer.

This applies even to the mature core application messaging products such as IBM's MQ Series and Microsoft's Message Queue. The latter is used mainly within the Microsoft environment, while MQ Series dominates the enterprise messaging environment with 70% of the market for software communication across platforms, as opposed to within a single operating system environment. MQ Series is almost synonymous with middleware in some minds, but while it has a good reputation it does not by itself provide the data and process management necessary to keep track of changes and ease the integration burden as new applications are developed.

MQ Series allows messages to be routed within an application framework to the correct system and then cause a process there to execute, triggering as it is called. What it does not do is provide a record of the routes and triggers, which would make it easier to manage the environment and effect changes.

There are some tools now that help with this, one being ETI's Extract Accelerator for MQ Series, which is a development aid for generating the calls and providing an audit trail of all the links to back-end systems and databases. Although currently only available for MQ Series, such a product would ease the pain of switching to another middleware supplier, because of the information it provides on all the inter-process links.

Middleware though is increasing its scope beyond application messaging. Products like MQ Series are asynchronous, providing a loose coupling between processes, so that one might send a message to another but not expect any response. There is also a need for protocols that support direct interaction, integrating applications more tightly together, and there are various products that allow this, including some of the tools within the object oriented Common Object Request Broker Architecture.

Because of the expanding scope of middleware, IBM has just gone through a re-branding exercise, bringing all the products together under the WebSphere logo. Not for the first time in IBM's case, the re-branding exercise is more a statement of intent than a fait accompli - ie, being a collection of often admirable but not particularly compatible products. According to Geoff Rayner, financial director in charge of IT at eHospital, an IBM middleware site which specialises in B2B trading in healthcare, WebSphere is not yet the answer to an enterprise's middleware integration problems that IBM would like its customers to believe. "WebSphere is an amalgamation of 1,000 things at present. People are confused by what's in there, and we've been through that learning curve ourselves just to find out what's in it."

Yet IBM's competitors can take little heart from these comments, for Rayner reckoned that they are all less well prepared for the challenges to come. "There's a big effort internally in IBM to bring it all together. The good thing for us is we don't have to pay for all that work."

In the hospital field, which Rayner describes as an IT nightmare with its huge collection of incompatible systems from a wide variety of suppliers, IBM's MQ Series is the best technology available for providing at least a basic level of integration between systems. This is providing real benefits for doctors and other workers within healthcare, Rayner insists. For example MQ is shortly to be used to integrate materials management with procurement and the supply chain within some hospitals, which will enable consultants, nurses and others to re-order surgical consumables by scanning as they leave or enter a ward rather than having to sit down in front of a terminal, or worse fill in a form. The key to MQ Series' success, says Rayner, is the number of different APIs it would communicate with, making it the best technology to form the core of a middleware strategy for a multi-supplier environment.

Not surprisingly, other suppliers dispute this relatively rosy view of IBM's position, arguing that it ignores the expanding role of middleware, beyond mere application integration, into unified content and document management. According to Tom Bird, UK head of collaborative working software supplier iManage, the missing piece of many middleware solutions is the support for common access to documents. "Over 80% of a corporation's knowledge exists in its documents," notes Bird, who adds that middleware did nothing on its own to open up documents and make them available to collaborative working communities, both within organisations and in B2B applications. The need is to elevate middleware into the spheres of content, document and knowledge management, Bird asserts.

In fact this point has not been lost on traditional middleware suppliers, and is one motive behind some of the recent rebranding exercises. Indeed BEA Systems, which is the main challenger to IBM in the middleware arena, is moving higher up the software food chain, according to its senior architect for UK and northern Europe, Mark Prichard. Particular targets for BEA, he says, are the content management suppliers such as Broadvision and Vignette. "Our differentiator compared with Broadvision is that we can provide almost as much functionality, but based entirely on the Enterprise Java Beans standards, with no proprietary kernel." This, says Prichard, made it easier to integrate content management with other key applications such as personalisation. "Enterprises prefer to go with a single supplier, but also want an open standards-based solution, even if the out-of-the-box functionality in a particular vertical market such as content management is not quite as deep."

With this comment, Prichard identifies the old dilemma for enterprises, which is whether to go with a perfect set of point solutions to individual problems, or compromise with a single supplier framework that will have weaknesses in some areas but eases the integration burden. In the case of middleware there is no sign of this dilemma being resolved.


Key middleware players

Middleware is dominated by five big suppliers, in this case IBM, BEA Systems, Oracle, Sun Microsystems, and Microsoft. According to the Giga Group, IBM will take over the lead in the market for multi-supplier middleware, with its share growing from 16% to 24% during this year. BEA will be number two. Microsoft will remain a big force for inter-application middleware within the Windows environment with its COM and Active/X technologies, while Oracle is strong among its own database customers. Both BEA and Sun have their main base among Unix sites, with the latter more predominant among users of its own hardware.

BEA is unique among the big five in being independent, or at least perceived to be, from any particular hardware or software platform. Yet it is IBM with MQ Series that is strongest in the market for middleware linking Unix and non-Unix systems, via its MQ Series messaging software.

NOTE: BEA Systems + Sun Microsystems are now merged with Oracle, making Oracle Weblogic and Fusion middleware as strong contenders for IBM's Websphere range of products. JBOSS needs a lot of corrections in its enterprise version (v6) before companies can transform. However IBM provides the worlds best after sales services including customer care. Oracle stands just next to it. JBOSS in not in this race. (Not inclined to any vendor - it is just my perspective)

Tips for changing middleware

  •     Understand why you are changing middleware, and work out what is wanted, for example greater ability to integrate with other systems you have
     
  •     Consider the change in the light of overall IT strategy. For example you may be implementing mobile applications in which case the new middleware must be capable of supporting pervasive computing and Wap devices

        
        Assess the features required. Typical features include asynchronous message queuing, message broking which facilitates synchronous and more closely integrated processes, support for distributed transactions, security, access to legacy systems, and support for small mobile devices
        
        Look at the products. Many suppliers call their products middleware, but with wide differences in functionality, capability and all round coverage. A key point to consider is what level of integration is needed
        
        Run a pilot project, especially if a major change of middleware right across an enterprise is being considered

        
        Start by migrating just one application. If the new middleware cannot cope, perhaps lacking sufficient support for key emerging standards such as Compact XML for small devices, then it is less costly to withdraw at this stage.

        
        Review the initial migration thoroughly before committing the whole enterprise. Determine the roadmap for future platform evolution, skills required, and define the enterprise's own middleware architecture accordingly - do not rely entirely on the supplier for this

        
        If all appears well, plan the full roll-out

        
        Execute the plan

Saturday, January 25, 2014

Thursday, January 16, 2014

What is the Major difference between Websphere Application Server v5.1, v6.1 and v7.0 ?

Profiles

WebSphere 5.1:No Concepts of profile ,there are 4 types of Installation -Express,Base ,Network Deployment and Enterprise.
Websphere 6.1:Cell Profile,Deployment Manager profile,Application Server profile,Custom Profile
Websphere 7.0 Cell(DeploymentManager and managed node),Management,Application Server,Custom profile,Secure Proxy.
Note:Under Management there are three types of profiles available :Administrative agent

Deployment Manager

Job Manager

Note:The Main use of Job Manager is to queue jobs to application server in a flexible management environment

Managing Profiles
WebSphere 5.1 :Websphere multiple installation instance can be created using wsinstance script

WebSphere 6.1:There are two ways of managing a profile
1.Profile Management Tool(GUI)

2.Manage profiles(Command interface for managing profiles )
WebSphere 7.0: same as 6.1

Security Roles
WAS 5.1:Administrator,operator,configurator
WAS 6.1:Administrator,operator,configurator,Deployer,Admin Security Manager,ISC Admin
WAS 7.0:Administrator,operator,configurator,Deployer,Admin Security Manager,ISC Admin,Auditor

WebServers supported
WAS 5.1:Apache HttpServer,Domino Server,IHS,Microsoft IIS,Sun Java System Web Server,HTTP Server for iseries
WAS 6.1:Apache HttpServer,Domino Server,IHS,Microsoft IIS,Sun Java System Web Server
WAS 7.0:HTTPServer for Z/Os and all web servers supported in 6.1

User Registries/Repositries
WAS 5.1:Local Operating System,Standalone LDAP registry,Standalone Custom registry
WAS 6.1:Federated repositories,Local Operating System,Standalone LDAP registry,Standalone Custom registry or file based registry
WAS 7.0:Same as 6.1

lOGGING AND TRACING
WAS 5.1Diagnostic trace
JVM logs
Process logs
IBM Service logs
WAS 6.1
Apart from the logs available in 5.1 there is a Change log detail levels which will enable the Message level and trace level of the JVM
WAS 7.0Same as V 6.1

Managing WebServers
WAS 5.1:Web Servers cannot be managed through Websphere Admin Console
WAS 6.1:WebServers can be Administered using the Websphere Admin Console (Stopping, Starting, Generation and propagation of Plug-in can be done). Web Servers can be created in Managed node or in Unmanaged node
WAS 7.0 same AS V 6.1

JMS
WAS 5.1:JMS Fail Over Support and scalability is not available
WAS 6.1:JMS Fail over support and scalability is available.SIB(Service Integration Bus Concept is being introduced)
WAS 7.0:Same as V 6.1

Monitoring
WAS 5.1:N/A
WAS 6.1:TPF(Tivoli Performance Viewer) is embedded in the Websphere Admin Console for monitoring WebSphere Objects
WAS 7.0same as V 6.1

Intelligent Run Time provisioning
WAS 5.1N/A
WAS 6.1N/A
WAS 7.0Intelligent run time provisioning is a new concept introduced in V7.0 At run time the server uses the activation plan to start only those components that are required inside the application server

Components like Web Container , EJB Container , Web Service and SIP Container are dynamically activated

SIP and Portlet Container
WAS 5.1:N/A
WAS 6.1SIP(Session Initiation Protocol) extends the application server to allow to run SIP applications written to JSR 116 Specification

The Portlet applications can deployed which is compliant with JSR 168

WAS 7.0same as V 6.1

wsadmin scripts
WAS 5.1:JACL is the scripting language which is used
WAS 6.1:JACL will be deprecated from 6.1 and Jython scripting will be used.
WAS 7.0:Same as V 6.1

Sunday, January 12, 2014

What is the difference between heap dump, thread dump and a core dump?

Heap dump - Collection of objects that are in memory (JVM)
Thread dump - Shows what each thread in a process is doing at a given point in time along with the stack trace.
Core dump - O/S level dump file which has O/S level info in addition to the heap dump.

Heap dump - is useful to analyse OOM situations.
Thread dump - To troubleshoot slow running of your application.
Core dump - When your JVM has crashed abruptly. To find details about native calls and so on.

Core dump will be generated automatically if a program crashed due to segmentation fault or some other reason. But core dump will not be generated if an application halt and been terminate by control+c or conventional way of kill or pkill.

In order to force a core dump generation you could run kill -6 <PID>

You should also make sure that you have enabled it and have provided enough space and permissions for it to get generated.

For Linux, the coredump is turned off by default on all systems. For RedHat Advanced Server 2.1, it should be under /etc/security. There should be a self-explanatory file called limits.conf and look for the word "core". If set to "0", then coredump is disabled.

For Solaris, you can also make sure core files are enabled with the coreadm command.

Check ulimit -a to see whether your environment allows core files to be produced.
ulimit -c (This is the size limit of the core file. Fix it with ulimit -c unlimited).
Kernel limitation (hard limit for ulimit -c).
Available disk space for the user (e.g., is there disk quota?).