Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

The WebSphere Contrarian: Are you sure you want to reorg that messaging engine database?

Tom Alcott, Consulting IT Specialist, IBM
Tom Alcott is consulting IT specialist for IBM in the United States. He has been a member of the Worldwide WebSphere Technical Sales Support team since its inception in 1998. In this role, he spends most of his time trying to stay one page ahead of customers in the manual. Before he started working with WebSphere, he was a systems engineer for IBM's Transarc Lab supporting TXSeries. His background includes over 20 years of application design and development on both mainframe-based and distributed systems. He has written and presented extensively on a number of WebSphere run time issues.

Summary:  The standard practice for database administration is to periodically check on the database and table organization to insure optimal performance -- but do these standard practices apply to a database used for JMS persistent message storage with IBM® WebSphere® Application Server? This content is part of the IBM WebSphere Developer Technical Journal.

Date:  30 Jul 2008
Level:  Intermediate
Also available in:   Chinese

Activity:  5812 views
Comments:  

In each column, The WebSphere Contrarian answers questions, provides guidance, and otherwise discusses fundamental topics related to the use of WebSphere products, often dispensing field-proven advice that contradicts prevailing wisdom.

Swamp things

I recently fielded an e-mail query, which resulted in series of several more e-mails over the course of a couple of days, that prompted me to recall a saying that a former manager of mine was fond of:

When you're up to your armpits in alligators, it's easy to forget why you wanted to drain the swamp.

What brought this to mind, you ask? Well, the query was for an "IBM recommendation to give to a customer on running DB2 reorgs and runstats on their messaging engine DB," and while I didn't presume to speak on behalf of all of IBM, my recommendation was not to worry about doing so. Not being fond of alligators, I usually try to avoid draining swamps, and while it seemed clear to me why the swamp didn't even need to be drained -- or, in this case, why database utilities on the messaging engine database didn't need to be run -- the recommendation didn't sit well with the customer. While I'm not sure that the customer was ultimately convinced, I thought that I'd share my rationale and methodology with you here so you can decide what might be most appropriate for your environment.


Surveying the swamp

Before draining a swamp, it's always a good idea to survey it. In the case of the messaging engine database, you can start your survey in the WebSphere Application Server Information Center, which provides this information about the database structure:


Table 1. Messaging database tables
TablePurpose
SIBOWNEREnsures exclusive access to the data store by an active messaging engine.
SIBCLASSMAPCatalogs the different object types in the data store.
SIBLISTINGCatalogs the SIBnnn tables.
SIBXACTSMaintains the status of active two-phase commit transactions.
SIBKEYSAssigns unique identifiers to objects in the messaging engine.
SIBnnn, where nnn is numericContains persisted objects such as messages and subscription information; these tables hold both persistent and non-persistent objects, using separate tables for the different types of data.

One of the issues troubling the customer was the SIBOWNER table holding an exclusive lock as explained in the WebSphere Application Server Information Center, which states (in part):

The SIBOWNER table in the data store holds the lock as a pair of unique identifiers in a single row. When it starts, a messaging engine uses these two identifiers to acquire and maintain its exclusive lock:

  • MEUUID

    The unique identifier for a messaging engine, which remains the same whenever the messaging engine stops and restarts.

  • INCUUID

    The incarnation identifier for a messaging engine, which changes every time the messaging engine starts.

These identifiers determine which messaging engine is using a data store. These identifiers also determine whether a running instance of a messaging engine has maintained its exclusive lock for the time period during which it was running.

As a messaging engine starts, it obtains an exclusive table lock on the SIBOWNER table.

The result of the messaging engine holding an exclusive lock was that the database maintenance utilities could not be run in the preferred manner, which was to do so for all tables in the database.


Reclamation needed?

So now that you know what the swamp -- um, database -- looks like, do you really need to drain it? You can look at the content of this table by stopping the messaging engines that are using a messaging engine database:

>db2 select * from ibmme0.sibowner

ME_UUID          INC_UUID         VERSION     MIGRATION_VERSION
---------------- ---------------- ----------- -----------------
E4C0B7CC5E3B76D3 4C224C2252CE2BDD           1                 0

1 record(s) selected.

Based on the description of this table, this is what I expected to see. Further, the documentation on the remainder of the tables (and my knowledge of how the messaging engine works) led me to expect that all of the remaining tables for the messaging engine would be comprised of a small number of rows. I validated this by running two tests, one synchronous and one asynchronous, where over 5,000,000 messages were persisted and processed from the database, and then ran DB2® REORGHK to determine if a database reorg is needed. Here is the output from REORGHK:

F1: 100 * OVERFLOW / CARD < 5
F2: 100 * (Effective Space Utilization of Data Pages) > 70
F3: 100 * (Required Pages / Total Pages) > 80

SCHEMA.NAME                  CARD     OV     NP     FP ACTBLK    TSIZE  F1  F2  F3 REORG
----------------------------------------------------------------------------------------
Table: IBMME0.SIB000           48      0      3      3      -     9936   0 100 100 --- 
Table: IBMME0.SIB001            -      -      -      -      -        -   -   -   - --- 
Table: IBMME0.SIB002            -      -      -      -      -        -   -   -   - --- 
Table: IBMME0.SIBCLASSMAP      12      0      1      1      -      984   0   - 100 --- 
Table: IBMME0.SIBKEYS           3      0      1      1      -      111   0   - 100 --- 
Table: IBMME0.SIBLISTING        3      0      1      1      -       90   0   - 100 --- 
Table: IBMME0.SIBOWNER          1      0      1      1      -       62   0   - 100 --- 
Table: IBMME0.SIBXACTS          -      -      -      -      -        -   -   -   - --- 

The key column of interest here is, not surprisingly, entitled REORG, which displays an "*" when a reorg of a table is warranted. You'll note that the tables in this database don't require any maintenance, even after processing over 5,000,000 messages.

If you stand back and think about this for a minute, this shouldn't come as a great surprise. Database reorgs are performed for a couple of reasons:

  • to organize related data close together to minimize disk access times.
  • to evenly distribute free space, again to minimize disk I/O.

In the case of the SIBOWNER table, there's only a single row, so there's no "related data" to try and place close together; it should be relatively apparent why no reorg is required. Each of the other tables contain a small number of rows as well, again negating the need for maintenance. Even the SIB000 table, which is where the messages were inserted into and deleted from, doesn't need maintenance. Since the messaging engine is processing messages as they arrive (or quickly thereafter), the database doesn't grow very large, and as a result doesn't require maintenance.


Dip your toe before you drain

While it's probably not prudent to suggest that the messaging engine database never needs maintenance, I think you can safely conclude that not all the tables need to be examined. Given the use and characteristics of the tables in the messaging engine database, only the SIBnnn tables are likely candidates for reclamation -- sorry, maintenance. In certain cases, perhaps during a surge in messages or an outage of the messaging engine (assuming your weren't using WebSphere Application Server High Availability for failover), enough records might be placed in the database to warrant maintenance. Another possible cause of message build-up in the data store are "poison messages," which can be managed using the methods introduced in this Fix Pack. Regardless of the cause, I'm not sure I would always go to the effort of draining the swamp. Perhaps I would monitor the water level periodically, in this case nightly or weekly, checking the SIBnnn tables with the command:

>DB2 REORGCHK UPDATE STATISTICS ON TABLE SIB000 

and then perform a reorg if warranted. You could also choose to check the remainder of the tables as well, with the exception of the SIBOWNER table, without stopping the WebSphere Application Server messaging engines -- though again these other tables contain only a small number of rows when compared to most relational databases, so the vast majority of the time a reorg will not be required

While I've focused on UDB (DB2) as the messaging engine data store in this discussion, this advice and rationale is the same for other database managers as well, though the tools used to monitor the database will differ by vendor -- unless of course you're fond of draining swamps!


Resources

About the author

Tom Alcott

Tom Alcott is consulting IT specialist for IBM in the United States. He has been a member of the Worldwide WebSphere Technical Sales Support team since its inception in 1998. In this role, he spends most of his time trying to stay one page ahead of customers in the manual. Before he started working with WebSphere, he was a systems engineer for IBM's Transarc Lab supporting TXSeries. His background includes over 20 years of application design and development on both mainframe-based and distributed systems. He has written and presented extensively on a number of WebSphere run time issues.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=324709
ArticleTitle=The WebSphere Contrarian: Are you sure you want to reorg that messaging engine database?
publish-date=07302008
author1-email=alcott@us.ibm.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.

Special offers