<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>db2commerce.com</title>
	
	<link>http://db2commerce.com</link>
	<description>Expert tips on building and administering DB2 LUW databases</description>
	<lastBuildDate>Thu, 23 May 2013 11:00:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/db2commerce/wKTM" /><feedburner:info uri="db2commerce/wktm" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>db2commerce/wKTM</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Check Out the New db2commerce.com Site Design!</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/Z9RwZiAV03c/</link>
		<comments>http://db2commerce.com/2013/05/23/check-out-the-new-db2commerce-com-site-design/#comments</comments>
		<pubDate>Thu, 23 May 2013 11:00:23 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2241</guid>
		<description><![CDATA[You may have noticed that I have updated the site design for db2commerce.com. Check it out and let me know if you find any problems or have any suggestions. Web design is not my first line of work, but I&#8217;m pleased with how it came out. I went live with the new design late last [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2011/08/30/websphere-commerce-database-design-observations/' rel='bookmark' title='Websphere commerce database design observations'>Websphere commerce database design observations</a></li>
<li><a href='http://db2commerce.com/2011/12/07/the-basics-of-index-design-for-db2/' rel='bookmark' title='The basics of Index Design for DB2'>The basics of Index Design for DB2</a></li>
<li><a href='http://db2commerce.com/2012/11/21/check-out-my-developerworks-article-on-mining-your-package-cache-for-problem-sql/' rel='bookmark' title='Check Out My developerWorks Article on Mining Your Package Cache for Problem SQL!'>Check Out My developerWorks Article on Mining Your Package Cache for Problem SQL!</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>You may have noticed that I have updated the site design for <a href="http://db2commerce.com">db2commerce.com</a>. Check it out and let me know if you find any problems or have any suggestions. Web design is not my first line of work, but I&#8217;m pleased with how it came out. </p>
<p>I went live with the new design late last week after some helpful input from a few friends, and a number of hours worth of work on it over the course of several weeks. I&#8217;m still finding a few things here and there to tweak, but most of it looks the way I want it to now. May I just say how frustrating the design differences are between browsers. I like the site best in Chrome and Firefox, and am not as fond of how IE displays things.</p>
<p>I personally really like the new design, but would love to hear from readers!</p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2011/08/30/websphere-commerce-database-design-observations/' rel='bookmark' title='Websphere commerce database design observations'>Websphere commerce database design observations</a></li>
<li><a href='http://db2commerce.com/2011/12/07/the-basics-of-index-design-for-db2/' rel='bookmark' title='The basics of Index Design for DB2'>The basics of Index Design for DB2</a></li>
<li><a href='http://db2commerce.com/2012/11/21/check-out-my-developerworks-article-on-mining-your-package-cache-for-problem-sql/' rel='bookmark' title='Check Out My developerWorks Article on Mining Your Package Cache for Problem SQL!'>Check Out My developerWorks Article on Mining Your Package Cache for Problem SQL!</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=Z9RwZiAV03c:Pa2pbhYV7H8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=Z9RwZiAV03c:Pa2pbhYV7H8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/Z9RwZiAV03c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/05/23/check-out-the-new-db2commerce-com-site-design/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/05/23/check-out-the-new-db2commerce-com-site-design/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=check-out-the-new-db2commerce-com-site-design</feedburner:origLink></item>
		<item>
		<title>SQL Tip: COALESCE</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/D8RAg32icqo/</link>
		<comments>http://db2commerce.com/2013/05/21/sql-tip-coalesce/#comments</comments>
		<pubDate>Tue, 21 May 2013 11:00:32 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2237</guid>
		<description><![CDATA[I haven&#8217;t generally been known for my SQL tips. I can find my way around SQL decently enough, but for years, I didn&#8217;t do much of it. I&#8217;ve used it more and more as the years have gone by as I have moved out of a stictly physical/system DBA role and into a more mixed [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2010/06/03/fun-with-in-lists-and-genrow/' rel='bookmark' title='Fun with IN-lists and GENROW'>Fun with IN-lists and GENROW</a></li>
<li><a href='http://db2commerce.com/2012/03/12/db2caem-get-actual-row-counts-in-your-explain-plans/' rel='bookmark' title='db2caem &#8211; Get Actual Row Counts in Your Explain Plans'>db2caem &#8211; Get Actual Row Counts in Your Explain Plans</a></li>
<li><a href='http://db2commerce.com/2012/01/17/advanced-sql-analysis/' rel='bookmark' title='More advanced SQL analysis'>More advanced SQL analysis</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I haven&#8217;t generally been known for my SQL tips. I can find my way around SQL decently enough, but for years, I didn&#8217;t do much of it. I&#8217;ve used it more and more as the years have gone by as I have moved out of a stictly physical/system DBA role and into a more mixed role where I interact and collaborate with our development team. I&#8217;ve also developed some of my own tools, and that has taught me worlds about more complicated SQL.</p>
<p>Some of my SQL tips are going to seem pretty darn basic, but the truth is that the most basic topics are my most popular articles, and I might have a tidbit here and there that some of my readers aren&#8217;t familiar with.</p>
<p>This first tip is centered on the COALESCE. I actually first became aware of COALESCE when I took an Oracle administration class. We had to use a COALESCE function in class, and I thought there must be something like it in DB2.</p>
<h2>COALESCE vs. CASE</h2>
<p>The whole point of COALESCE is to help you deal with a situation where you may want to return something different if a value is NULL. This is pretty common, and while you can do the same functionality with a CASE statement, COALESCE is shorter and simpler.</p>
<p>Basically, the whole point of COALESCE is that it is a function that returns the first value that is not NULL. You can pass in as many (compatible) arguments as you like &#8211; it can handle any data types. Many times, the last argument passed in is a string literal or constant (number).</p>
<p>How can this help you? Let&#8217;s take a look at an example. In my case, I needed to return a value from a table, but if that value happened to be NULL, I needed instead to return a default value of -20. In my case, the CASE statement looked like this:</p>
<pre>case 
    when stgfilter is null 
        then -20 
    else stgfilter 
end</pre>
<p>Not complicated, but still several lines to get what I need. When using COALESCE to do the same logic, I can use:</p>
<pre>coalesce(stgfilter,-20)</pre>
<h2>Performance</h2>
<p>Logically, it feels like COALESCE has less work to do, so should perform faster. But I don&#8217;t know if the DB2 optimizer really knows the difference. When I did a little experiment with my two methods on tiny little <200 row tables, I got the following two explain plans:</p>
<h3>Case statement</h3>
<pre>Access Plan:
-----------
        Total Cost:             15.1685
        Query Degree:           1
 
                             Rows
                            RETURN
                            (   1)
                             Cost
                              I/O
                              |
                               1
                           >^NLJOIN
                           (   2)
                            15.1683
                               2
                     /--------+---------\
                    1                      1
                 >NLJOIN                IXSCAN
                 (   3)                 (   7)
                 15.1579               0.0103311
                    2                      0
           /-------+-------\              |
          1                   1           18
       IXSCAN              FETCH    INDEX: WSCOMUSR
       (   4)              (   5)   X_STR_MAP_IX01
      0.0145029            15.1434        Q5
          0                   2
         |               /---+----\
         110            1          26359
   INDEX: SYSIBM     IXSCAN   TABLE: WSCOMUSR
SQL120207213008270  (   6)      STORECENT
         Q1          7.57994        Q3
                        1
                       |
                      26359
                 INDEX: WSCOMUSR
                    I0000345
                       Q3</pre>
<h3>COALESCE</h3>
<pre>Access Plan:
-----------
        Total Cost:             15.1685
        Query Degree:           1
 
                             Rows
                            RETURN
                            (   1)
                             Cost
                              I/O
                              |
                               1
                           >^NLJOIN
                           (   2)
                            15.1683
                               2
                     /--------+---------\
                    1                      1
                 >NLJOIN                IXSCAN
                 (   3)                 (   7)
                 15.1579               0.0103311
                    2                      0
           /-------+-------\              |
          1                   1           18
       IXSCAN              FETCH    INDEX: WSCOMUSR
       (   4)              (   5)   X_STR_MAP_IX01
      0.0145029            15.1434        Q5
          0                   2
         |               /---+----\
         110            1          26359
   INDEX: SYSIBM     IXSCAN   TABLE: WSCOMUSR
SQL120207213008270  (   6)      STORECENT
         Q1          7.57994        Q3
                        1
                       |
                      26359
                 INDEX: WSCOMUSR
                    I0000345</pre>
<p>No, I did not copy and paste wrong &#8211; those are two exactly identical explain plans. And when I checked, the re-written SQL did not show one method had been converted to the other.</p>
<p>I can&#8217;t exactly exrapolate these results to more complex situations, of course, but I still thought it was interesting.</p>
<p>I would love it if any readers have any knowledge about the performance differences of CASE vs. COALESCE that they&#8217;d be willing to share in the comments.</p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2010/06/03/fun-with-in-lists-and-genrow/' rel='bookmark' title='Fun with IN-lists and GENROW'>Fun with IN-lists and GENROW</a></li>
<li><a href='http://db2commerce.com/2012/03/12/db2caem-get-actual-row-counts-in-your-explain-plans/' rel='bookmark' title='db2caem &#8211; Get Actual Row Counts in Your Explain Plans'>db2caem &#8211; Get Actual Row Counts in Your Explain Plans</a></li>
<li><a href='http://db2commerce.com/2012/01/17/advanced-sql-analysis/' rel='bookmark' title='More advanced SQL analysis'>More advanced SQL analysis</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=D8RAg32icqo:alE9eAlf-cc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=D8RAg32icqo:alE9eAlf-cc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/D8RAg32icqo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/05/21/sql-tip-coalesce/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/05/21/sql-tip-coalesce/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=sql-tip-coalesce</feedburner:origLink></item>
		<item>
		<title>WebSphere Commerce Instance Creation Creates Database as Wrong User</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/ZoN2f29an4I/</link>
		<comments>http://db2commerce.com/2013/05/16/websphere-commerce-instance-creation-creates-database-as-wrong-user/#comments</comments>
		<pubDate>Thu, 16 May 2013 11:00:19 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[Build]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2169</guid>
		<description><![CDATA[This post is specific to WebSphere Commerce. We&#8217;ve reported this issue to IBM, but since we&#8217;ve run into it several times across more than a year, and in multiple different Fix Packs of Commerce, I thought I&#8217;d share it in case someone else runs into it. The main way it manifests initially is like this: [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2012/02/07/websphere-commerce-instance-creation-doesnt-like-db2-9-7-fixpack-5/' rel='bookmark' title='WebSphere Commerce Instance Creation Doesn&#8217;t Like DB2 9.7 FixPack 5'>WebSphere Commerce Instance Creation Doesn&#8217;t Like DB2 9.7 FixPack 5</a></li>
<li><a href='http://db2commerce.com/2010/06/02/instance-creation-in-websphere-commerce-7-db2-9-5/' rel='bookmark' title='Instance Creation in WebSphere Commerce 7 (DB2 9.5)'>Instance Creation in WebSphere Commerce 7 (DB2 9.5)</a></li>
<li><a href='http://db2commerce.com/2011/02/25/data-movement-options-for-commerce-databases-creation-of-staging-database-during-build/' rel='bookmark' title='Data Movement Options for Commerce Databases &#8211; Creation of staging database during build'>Data Movement Options for Commerce Databases &#8211; Creation of staging database during build</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>This post is specific to WebSphere Commerce. </p>
<p>We&#8217;ve reported this issue to IBM, but since we&#8217;ve run into it several times across more than a year, and in multiple different Fix Packs of Commerce, I thought I&#8217;d share it in case someone else runs into it. The main way it manifests initially is like this:</p>
<pre>
/configureWorkspaces.xml:245: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=DB2INST1;SELECT;WSCOMUSR.KEYS, DRIVER=4.14.122
</pre>
<p>The user &#8216;DB2INST1&#8242; in the above may change, but basically an error like this comes up somewhere along the line saying that your DB2 instance owner does not have permissions on the database.</p>
<p>We only see this for an instance creation where isRemote is set to false.</p>
<p>I&#8217;m not sure that anyone cares about the root cause of the issue, but our engineers narrowed it down to a single line that fails in one of the Commerce scripts &#8211; COMMERCE_HOME/bin/createdb.db2.sh in Fixpack 5, line 155(also in later fixpacks, at least to FP7):</p>
<pre>db2 -v attach to $DB2INSTANCE user $USER using $PASSWORD >> $LOG 2>&#038;1</pre>
<p>$DB2INSTANCE is undefined anywhere else during this process. It results in a minor error during DB creation:</p>
<pre>attach to user db2inst1 using db2inst1
SQL0104N  An unexpected token "db2inst1" was found following "USER".  Expected tokens may include:  "USER".  SQLSTATE=42601</pre>
<p>The underlying problem is that the db2profile was not sourced for the user id running the instance creation prior to running the instance creation.</p>
<p>This issue is only seen if you are using separate ids for DBAuser, DBuser, and running the instance creation (which you should be!). It appears to me that WebSphere Commerce is assuming you are using the same ID for everything, so you would already have the db2profile sourced.</p>
<p>The key to preventing this is to ensure that the db2profile is sourced by the user in question prior to executing the instance creation. You may have to do this in the .profile, .bash_profile or .bashrc, but it is easy to add lines like this (changing paths depending on where your $INSTANCEHOME is):</p>
<pre>if [ -f /db2home/db2inst1/sqllib/db2profile ]; then
    . /db2home/db2inst1/sqllib/db2profile
fi</pre>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2012/02/07/websphere-commerce-instance-creation-doesnt-like-db2-9-7-fixpack-5/' rel='bookmark' title='WebSphere Commerce Instance Creation Doesn&#8217;t Like DB2 9.7 FixPack 5'>WebSphere Commerce Instance Creation Doesn&#8217;t Like DB2 9.7 FixPack 5</a></li>
<li><a href='http://db2commerce.com/2010/06/02/instance-creation-in-websphere-commerce-7-db2-9-5/' rel='bookmark' title='Instance Creation in WebSphere Commerce 7 (DB2 9.5)'>Instance Creation in WebSphere Commerce 7 (DB2 9.5)</a></li>
<li><a href='http://db2commerce.com/2011/02/25/data-movement-options-for-commerce-databases-creation-of-staging-database-during-build/' rel='bookmark' title='Data Movement Options for Commerce Databases &#8211; Creation of staging database during build'>Data Movement Options for Commerce Databases &#8211; Creation of staging database during build</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=ZoN2f29an4I:dY2GIaCGVCQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=ZoN2f29an4I:dY2GIaCGVCQ:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/ZoN2f29an4I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/05/16/websphere-commerce-instance-creation-creates-database-as-wrong-user/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/05/16/websphere-commerce-instance-creation-creates-database-as-wrong-user/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=websphere-commerce-instance-creation-creates-database-as-wrong-user</feedburner:origLink></item>
		<item>
		<title>What to do with a Character you Cannot Query</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/uq3Ho-Cc5oU/</link>
		<comments>http://db2commerce.com/2013/05/14/what-to-do-with-a-character-you-cannot-query/#comments</comments>
		<pubDate>Tue, 14 May 2013 11:00:44 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2140</guid>
		<description><![CDATA[This post comes out of one of the more challenging technical problems I have encountered recently. Problem Description An international client went live recently. We did the work of building their new WebSphere Commerce 7 website, and go-live involved loading some data from their old site. I&#8217;m not sure exactly how that load was done, [...]<div class='yarpp-related-rss yarpp-related-none'>

No related posts.
</div>
]]></description>
				<content:encoded><![CDATA[<p>This post comes out of one of the more challenging technical problems I have encountered recently.</p>
<h2>Problem Description</h2>
<p>An international client went live recently. We did the work of building their new WebSphere Commerce 7 website, and go-live involved loading some data from their old site. I&#8217;m not sure exactly how that load was done, but I suspect massload (a WebSphere Commerce Utility) was used. Somehow the data in that load file was messed up, and there were issues where the last name should have been:<br />
MUÑOZ<br />
but instead showed up as:<br />
MU&#x2592OZ<br />
This was put very literally into the database, so we had bad data in the database.</p>
<p>It wasn&#8217;t just that character. I identified several other incorrect representations of either the same character or other &#8220;special&#8221; charaters, including:<br />
▒<br />
„<br />
‰<br />
ã<br />
�<br />
Ã</p>
<p>The thing is that all of the others were easy to query for and find. As inefficient as a LIKE on &#8216;%string%&#8217; can be, when it is a one-time thing and critical, it worked. </p>
<p>But when I tried a LIKE on &#8216;%▒%&#8217;, I got no results, even though I knew the value existed. Even a search on = &#8216;MU▒OZ&#8217; returned nothing when I knew there were dozens of them. Even a count on it pulled up nothing. I even tried LIKE &#8216;%@▒%&#8217; escape &#8216;@&#8217;, and that did not work.</p>
<p>The even bigger problem here is that when anything with this character was queried using application tools, the application tool (such as CMC) simply stopped and reported &#8220;error&#8221;. The application was unable to proceed. This actually appeared to happen for all JDBC tools since I got similar results in CC and Data Studio (yes, I stooped to the use of GUIs to check things out).</p>
<p>The problem statement became: How do I query a character that does not really seem to be there &#8211; that DB2 SQL for some reason cannot read?</p>
<h2>Finding a Resolution</h2>
<p>I am more and more convinced that a expert is not someone who knows everything about a topic, but someone who knows a lot and knows who to ask when they get stuck. After googling and searching the info center and IBM support site, I sent an email out to all of my DBA friends looking for some help. One person was able to get the question in front of a well-known IBMer who gave me the suggestion that worked.</p>
<p>They suggested looking at the actual binary values that made up the string. Using that, I was able to come up with the answers. To figure out what binary the character was, I looked at some of them using this query:</p>
<pre>
select substr(lastname,1,18) as lastname, cast(lastname as varchar(50) for bit data) as bin_lstname from wscomusr.address where lastname like 'MU%' with ur

LASTNAME           BIN_LSTNAME
------------------ -------------------------------------------------------------------------------------------------------
MU;OZ              x'4D553B4F5A'
MU▒OZ              x'4D55D14F5A'
MUÑOZ              x'4D55C3914F5A'
...
</pre>
<p>From this, I could tell that the problem character was &#8216;D1&#8242;. So assuming that D1 wasn&#8217;t the random combination of the end of some other character and beginning of some other character, I found the rows using:</p>
<pre>
select lastname from wscomusr.address where locate(x'D1',lastname) > 0 with ur

LASTNAME
--------------------------------------------------------------------------------------------------------------------------------
MU▒OZ
MU▒OZ
MU▒OZ
...
</pre>
<p>Since we had proof that ▒ was not always Ñ, we chose not to try to replace anything. We were dealing with just a few thousand occurrences, so I queried the primary keys of the rows with issues, and the developer used the input file to write appropriate update statements for each one. </p>
<p>This was all days of work to work through, of course &#8211; don&#8217;t get the impression that any of this was easy.</p>
<p>I put this out there so that anyone else who runs across this or a similar issue can learn from my mistakes, and hopefully find an answer without having to email every DBA they know.</p>
<div class='yarpp-related-rss yarpp-related-none'>
<p>No related posts.</p>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=uq3Ho-Cc5oU:0v9m4rW9bq0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=uq3Ho-Cc5oU:0v9m4rW9bq0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/uq3Ho-Cc5oU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/05/14/what-to-do-with-a-character-you-cannot-query/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/05/14/what-to-do-with-a-character-you-cannot-query/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=what-to-do-with-a-character-you-cannot-query</feedburner:origLink></item>
		<item>
		<title>IDUG NA 2013 Pictures</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/B8Nbj40UpDU/</link>
		<comments>http://db2commerce.com/2013/05/10/idug-na-2013-pictures/#comments</comments>
		<pubDate>Fri, 10 May 2013 11:00:04 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[Just for Fun]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2157</guid>
		<description><![CDATA[Ok, this is the last post focused on IDUG NA 2013. I posted something deeply technical yesterday, didn&#8217;t I? I wanted to share some pictures from the conference. I snaged these from various Twitter and Facebook posts, so thanks everyone who took pictures. Scott Hayes, Dan Luksetich, Kurt Struyf, and Me (taken by Kelly Fitzgerald) [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2013/04/29/idug-orlando-yet-another-post/' rel='bookmark' title='IDUG Orlando (yet another post)'>IDUG Orlando (yet another post)</a></li>
<li><a href='http://db2commerce.com/2013/04/23/heading-to-idug-2013-learn-from-my-experience/' rel='bookmark' title='Heading to IDUG 2013? Learn from my experience.'>Heading to IDUG 2013? Learn from my experience.</a></li>
<li><a href='http://db2commerce.com/2012/09/12/idug-na-tech-conference-2013-you-can-be-a-presenter/' rel='bookmark' title='IDUG NA Tech Conference 2013 &#8211; you can be a presenter!'>IDUG NA Tech Conference 2013 &#8211; you can be a presenter!</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Ok, this is the last post focused on IDUG NA 2013. I posted something deeply technical yesterday, didn&#8217;t I? I wanted to share some pictures from the conference. I snaged these from various Twitter and Facebook posts, so thanks everyone who took pictures. </p>
<h3>Scott Hayes, Dan Luksetich, Kurt Struyf, and Me (taken by Kelly Fitzgerald)</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/PreConfDinner.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/PreConfDinner-300x225.jpg?9d7bd4" alt="PreConfDinner" width="300" height="225" class="alignnone size-medium wp-image-2165" /></a></p>
<h3>Me with JB, Rebecca Bond, and Susan Visser</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/DB2Women.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/DB2Women.jpg?9d7bd4" alt="DB2Women" width="274" height="206" class="alignnone size-full wp-image-2163" /></a></p>
<h3>Me, JB, Mike Krafick, Rebecca Bond</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/DB2WomenAndMike.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/DB2WomenAndMike.jpg?9d7bd4" alt="DB2WomenAndMike" width="274" height="206" class="alignnone size-full wp-image-2164" /></a></p>
<h3>Before the Spotlight with a bunch of folks</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/BunchOfGeeks.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/BunchOfGeeks.jpg?9d7bd4" alt="BunchOfGeeks" width="274" height="206" class="alignnone size-full wp-image-2162" /></a></p>
<h3>Me, presenting. If anyone has a better picture, please send/share!</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/10Comandments.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/10Comandments-224x300.jpg?9d7bd4" alt="10Comandments" width="224" height="300" class="alignnone size-medium wp-image-2161" /></a></p>
<h3>From the photo booth at the DBI Party &#8211; Me, Adam Schneider, and Mike Krafick</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/PhotoBooth.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/PhotoBooth-225x300.jpg?9d7bd4" alt="PhotoBooth" width="225" height="300" class="alignnone size-medium wp-image-2160" /></a></p>
<h3>The past two winners of DB2&#8242;s Got Talent &#8211; Kohli and Mohan</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/MohanKohli.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/MohanKohli-300x225.jpg?9d7bd4" alt="MohanKohli" width="300" height="225" class="alignnone size-medium wp-image-2159" /></a></p>
<h3>Mike Krafick, Me, and a first time IDUG attendee!</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/MeMikeAndFirstTimer.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/MeMikeAndFirstTimer-300x225.jpg?9d7bd4" alt="MeMikeAndFirstTimer" width="300" height="225" class="alignnone size-medium wp-image-2158" /></a></p>
<h2>Additional Pictures added after initial publish of this post:</h2>
<h3>Doing the DB2 Cocktail hour with Dan Luksetich and Scott Hayes</h3>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/05/DB2CocktailHour.jpg?9d7bd4"><img src="http://db2commerce.com/wp-content/uploads/2013/05/DB2CocktailHour-300x199.jpg?9d7bd4" alt="DB2CocktailHour" width="300" height="199" class="alignnone size-medium wp-image-2182" /></a></p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2013/04/29/idug-orlando-yet-another-post/' rel='bookmark' title='IDUG Orlando (yet another post)'>IDUG Orlando (yet another post)</a></li>
<li><a href='http://db2commerce.com/2013/04/23/heading-to-idug-2013-learn-from-my-experience/' rel='bookmark' title='Heading to IDUG 2013? Learn from my experience.'>Heading to IDUG 2013? Learn from my experience.</a></li>
<li><a href='http://db2commerce.com/2012/09/12/idug-na-tech-conference-2013-you-can-be-a-presenter/' rel='bookmark' title='IDUG NA Tech Conference 2013 &#8211; you can be a presenter!'>IDUG NA Tech Conference 2013 &#8211; you can be a presenter!</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=B8Nbj40UpDU:UOzQsa3pH5A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=B8Nbj40UpDU:UOzQsa3pH5A:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/B8Nbj40UpDU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/05/10/idug-na-2013-pictures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/05/10/idug-na-2013-pictures/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=idug-na-2013-pictures</feedburner:origLink></item>
		<item>
		<title>When is a Reorg Really Online?</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/0FKVKBWVY4s/</link>
		<comments>http://db2commerce.com/2013/05/09/when-is-a-reorg-really-online/#comments</comments>
		<pubDate>Thu, 09 May 2013 11:00:38 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[Data Pruning/DBClean]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2147</guid>
		<description><![CDATA[We bandy about the term &#8220;online&#8221; reorg. But you&#8217;d be surprised how often there are issues with that. IBM officially calls it an &#8220;INPLACE&#8221; reorg. Read on to understand exactly when it is fully online and when it is not. Truncation When we first got our hands on online reorgs, it seemed like the &#8220;INPLACE&#8221; [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2012/02/22/issue-with-online-reorgs-on-unformatted-event-monitor-tables/' rel='bookmark' title='Issue with Online Reorgs on Unformatted Event Monitor Tables'>Issue with Online Reorgs on Unformatted Event Monitor Tables</a></li>
<li><a href='http://db2commerce.com/2012/07/12/how-to-delete-data-from-a-db2-table-and-release-disk-space/' rel='bookmark' title='How to Delete Data From a DB2 Table and Release Disk Space'>How to Delete Data From a DB2 Table and Release Disk Space</a></li>
<li><a href='http://db2commerce.com/2013/05/07/idug-na-2013-brain-dump/' rel='bookmark' title='IDUG NA 2013 Brain Dump'>IDUG NA 2013 Brain Dump</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>We bandy about the term &#8220;online&#8221; reorg. But you&#8217;d be surprised how often there are issues with that. IBM officially calls it an &#8220;INPLACE&#8221; reorg. Read on to understand exactly when it is fully online and when it is not.</p>
<h2>Truncation</h2>
<p>When we first got our hands on online reorgs, it seemed like the &#8220;INPLACE&#8221; keyword was all we needed, and we had availability during reorg &#8211; that any they required less disk space at one time. Yet, if you don&#8217;t specify the &#8220;NOTRUNCATE&#8221; keyword on the reorg command, then at the end of the reorg, DB2 does a lock-drain on the table, and acquires an S lock. This may be more accepatable in a DW/DSS environment than it is in an OLTP/e-commerce environment. I still find that my smaller clients can handle truncation just fine, so I implement reorgs allowing truncation (usually at a very low volume time), and then wait for issues before adding in that &#8220;NOTRUCATE&#8221; keyword.</p>
<p>What does NOTRUNCATE really do? Well, in the course of a reorg, the pages are properly populated with data &#8211; fitting as many rows as possible on to a page. If there has been more data deleted than added or if the pattern of deletions has caused pages to become sparsely populated, then after the reorg, DB2 is left with empty pages at the end of the table. If you do NOT specify NOTRUNCATE, an S lock is acquired on the table and these pages at the end of the table are freed back to the tablespace to be used however makes sense for the tablespace.</p>
<p>If NOTRUNCATE is specified, there is no lock, and those pages remain a part of the table to be filled or left empty as data growth for that table only allows.</p>
<p>Think about the growth patterns in your database when deciding whether or not to allow truncation. Generally my e-commerce databases are steadily (and slowly if I&#8217;m pruning right) growing. Unless there&#8217;s a large delete, I don&#8217;t expect to have a lot of pages to truncate, and even if there are some, they&#8217;ll generally get filled in with data pretty quickly.</p>
<p>Thus if you&#8217;ve been doing a lot of deletion, you&#8217;ll want to let your reorgs truncate so you can get that space back.</p>
<h2>Online Reorg of Indexes</h2>
<p>We call it online index reorgs. And, heck, it is more online than the old classic offline reorgs. But, unless you&#8217;re specifying &#8216;CLEANUP ONLY&#8217; or &#8216;CLEANUP ONLY PAGES&#8217;, DB2 will re-build the indexes and acquire a <strong>Z lock</strong> on the table while switching indexes. Yes, a Z lock &#8211; also known as a super-exclusive lock. This causes troubles, especially for my larger clients.</p>
<p>To be clear, the syntax that triggers this behavior is:</p>
<pre>REORG INDEXES ALL FOR schema.table ALLOW WRITE ACCESS</pre>
<p>The good part is that you should only be doing this type of reorg if formulas F5 or F6 are flagged in REORGCHK. If formula F7 is flagged, you should add &#8216;CLEANUP ONLY&#8217; and if formula F8 is flagged, you should add &#8216;CLEANUP ONLY PAGES&#8217;. If formula F4 is flagged, you should be reorging the table on the index only if you desire the table to be clustered on that index, otherwise you should ignore flags on F4.</p>
<h2>Reorg Performance</h2>
<p>I&#8217;ve asked a number of people in a number of situations if I can either improve reorg performance or throttle the reorgs. Reorgs cannot be throttled, and several people recently have made it clear to me that IBM&#8217;s strategic direction is not to improve REORG, but to reduce the need for reorgs.</p>
<p>There are two things you should know about REORG and perceived performance. The first is that an inplace REORG will wait forever for each and every lock it needs. REORG does not respect LOCKTIMEOUT. If you have users that are not committing frequently, or worse, a table where an application holds a lock on the table continuously, you can run into problems. Maybe the answer to speeding up the reorg is to get your applications to commit more frequently. </p>
<p>I&#8217;ve actually had an issue with an event monitor that writes to an unformatted table &#8211; I have to specifically exclue it from reorgs, or my reorgs hang up on it. </p>
<p>The other thing you need to know about reorg performance is that clustering reorgs are slower than non-clustering reorgs. A clustering reorg (REORG table on INDEX) does a forward scan through the table and generates a RID list using the specified index. It clears out a few pages, and then moves in the RIDs that need to be there. A non-clustering reorg starts at the end of the table and tries to move rows from the end of the table up among the other rows &#8211; if it vacates pages, they are already at the end of the table. </p>
<p>That means that a clustering reorg often moves every row in a table, and reads the index too, while a non-clustering reorg only moves the rows it needs to.</p>
<p>Between that and some other details I&#8217;ve learned recently, I am reconsidering my strategy of many years to reorg every table that doesn&#8217;t have a clustering index on it&#8217;s primary key. I think I&#8217;ll still aim for some clustering, but based on things I&#8217;ve learned about index efficiency, I think it&#8217;ll be more selective, and focused on lower cardinality columns.</p>
<h2>HADR Backpressure</h2>
<p>I have a number of clients who see HADR go into a &#8220;CONGESTED&#8221; state during reorgs. And indeed, online reorgs can generate an astounding number of log files. Every one of those log entries must be copied over the HADR link. This can slow down your reorg performance if you&#8217;re using NEARSYNC (or SYNC). At the IDUG NA 2013 conference, I actually got two ideas on how to deal with this problem. </p>
<p>First, consider making the LOGBUFSZ larger on the Standby than on the Primary. I&#8217;ve always tried to keep my database settings the same between primary and standby, but this actually makes sense to me &#8211; more memory available for logs on the standby with NEARSYNC doesn&#8217;t affect recoverablity unless both servers fail at exactly the same time, and it does give a bit more room.</p>
<p>Second, there is a new parameter available in DB2 10.1 called HADR_SPOOL_LIMIT. It is in the DB config, and if set to a non-zero value, it allows logs on the standby to spool to disk &#8211; so they are still exeternalized, and your recoverablility is not impaired. The one drawback is that your actual failover time might be longer, because if there were a lot of logs spooled to disk, the standby would have to rollforward through all of them to come up. I wouldn&#8217;t like to be spooling all the time, but it sounds like a great solution for spikes like online reorgs can cause. I have not actually used this feature, since I&#8217;ve been unable to get my hands on 10.1 yet &#8211; hopefully WebSphere Commerce will certify 10.1 this year so I can play with it.</p>
<h2>Offline Reorg Trick</h2>
<p>Did you know you can do an offline reorg using ADMIN_MOVE_TABLE? And with 10.1.2, DB2 will support ADMIN_MOVE_TABLE for tables with RI. I&#8217;d have to investigate how online ADMIN_MOVE_TABLE really is(seems like it would make sense to have a table lock for the switch), but it is intriguing.</p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2012/02/22/issue-with-online-reorgs-on-unformatted-event-monitor-tables/' rel='bookmark' title='Issue with Online Reorgs on Unformatted Event Monitor Tables'>Issue with Online Reorgs on Unformatted Event Monitor Tables</a></li>
<li><a href='http://db2commerce.com/2012/07/12/how-to-delete-data-from-a-db2-table-and-release-disk-space/' rel='bookmark' title='How to Delete Data From a DB2 Table and Release Disk Space'>How to Delete Data From a DB2 Table and Release Disk Space</a></li>
<li><a href='http://db2commerce.com/2013/05/07/idug-na-2013-brain-dump/' rel='bookmark' title='IDUG NA 2013 Brain Dump'>IDUG NA 2013 Brain Dump</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=0FKVKBWVY4s:JGWftges_aE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=0FKVKBWVY4s:JGWftges_aE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/0FKVKBWVY4s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/05/09/when-is-a-reorg-really-online/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/05/09/when-is-a-reorg-really-online/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=when-is-a-reorg-really-online</feedburner:origLink></item>
		<item>
		<title>IDUG NA 2013 Brain Dump</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/dfC_rwkbpK8/</link>
		<comments>http://db2commerce.com/2013/05/07/idug-na-2013-brain-dump/#comments</comments>
		<pubDate>Tue, 07 May 2013 11:00:46 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[DB2 Settings]]></category>
		<category><![CDATA[Education and Skills]]></category>
		<category><![CDATA[Explains]]></category>
		<category><![CDATA[Fix Pack or Feature Pack]]></category>
		<category><![CDATA[High Availability]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2129</guid>
		<description><![CDATA[Wait, don&#8217;t avoid reading this because you didn&#8217;t go to the conference. There is still valuable stuff here. In fact, it is even more valuable for those who did not go. Last year, I posted my brain dump by basically re-writing all of my paper notes. This year, I&#8217;m going to try to make it [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2013/04/23/heading-to-idug-2013-learn-from-my-experience/' rel='bookmark' title='Heading to IDUG 2013? Learn from my experience.'>Heading to IDUG 2013? Learn from my experience.</a></li>
<li><a href='http://db2commerce.com/2012/05/21/idug-na-tech-conference-wrap-up/' rel='bookmark' title='IDUG NA Tech Conference wrap-up'>IDUG NA Tech Conference wrap-up</a></li>
<li><a href='http://db2commerce.com/2013/04/29/idug-orlando-yet-another-post/' rel='bookmark' title='IDUG Orlando (yet another post)'>IDUG Orlando (yet another post)</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Wait, don&#8217;t avoid reading this because you didn&#8217;t go to the conference. There is still valuable stuff here. In fact, it  is even more valuable for those who did not go. Last year, I posted my brain dump by basically re-writing all of my paper notes. This year, I&#8217;m going to try to make it a bit more organized.</p>
<p>It was really an awesome week. I learned so much, and I think I did well on my first time presenting. We&#8217;ll see when the surveys come back. If you&#8217;re not familiar with how they do things, IDUG tries to choose proven speakers. This means that if you have bad reviews, you&#8217;re less likely to be approved to present next year. So if you were there, go do all your reviews ASAP to give speakers their props.</p>
<p>This is a brain dump. It&#8217;s the stuff that really stood out to me in each session. It does no justice whatsoever to the depth and quality of the speakers&#8217; presentations, and does not cover a bunch of stuff I already know. Please comment if you see any inaccuracies or have any comments on the sessions or my details of them.</p>
<h2>Monday &#8211; ED4: DB2 for LUW Top Gun Performance Workshop &#8211; Scott Hayes and Martin Hubel</h2>
<p>There&#8217;s a lot to learn here. I&#8217;m pretty good with performance tuning, and took Scott&#8217;s pre-conference workshop in 2005. It&#8217;s a whole other experience to take it now as a more experienced DBA. Many things I will use. I highly recommend it if you get the chance.</p>
<h2>Tuesday &#8211; Keynote</h2>
<p>The one and only session where I took no notes. </p>
<h2>Tuesday &#8211; S02: DB2 for Linux, Unix, and Windows: Recent Enhancements and Trends &#8211; Matt Huras</h2>
<p>I learn from Matt every time I see him speak. I got some interesting details about BLU and some interesting clues on what is coming down the road. My notes include:</p>
<ul>
<li>BLU is a DMS tablespace type</li>
<li>Compression in 10.1 gains additional efficiency through the use of &#8220;Approximate Huffman Encoding&#8221; &#8211; my understanding of that is that a smaller value is chosen for the most frequently compressed values</li>
<li>Encrypted data does not need to be uncomressed to be evaluated</li>
<li>SIMD &#8211; Single Instruction, Multiple Data &#8211; in 10.5 DB2 can, for example, compare 4 values at once to see if they match a literal value</li>
<li>In 10.5, DB2 can dedicate specific CPUs to only look at memory for what they&#8217;re working on</li>
<li>A BLU table is specified by the &#8220;ORGANIZE BY COLUMN&#8221; keywords in the create table statement</li>
<li>A &#8220;synopsis&#8221; table is maintained alongside the actual columns of data for BLU tables. This is then used in some way for data elimination. This table is always there, and is changed atomically.</li>
<li>For analytics workloads, there is a registry variable &#8211; DB2_WORKLOAD that should be set to ANALYTICS</li>
<li>You can convert tables from normal to BLU</li>
<li>The create table statement will allow you to specify &#8220;ORGANIZE BY ROW&#8221; to explicitly specify a regular table</li>
<li>LODADing into BLU tables performs comparably to LOADing into traditional tables with indexes</li>
<li>BLU is not appropriate for high inserts/deletes because they have to touch more pages to do an insert than with traditional tables</li>
<li>IBM may or may not be including the ability to index on an expression in some future (post 10.5) release of DB2</li>
</ul>
<h2>Tuesday &#8211; E01: Advanced Query Tuning with IBM Data Studio for Developers &#8211; Tony Andrews</h2>
<ul>
<li>Ways of reducing I/O:
<ul>
<li>Index</li>
<li>System Tuning</li>
<li>BP Tuning</li>
<li>Early Elimination</li>
<li>Program and SQL Tuning</li>
</ul>
</li>
<li>Residual predicates are ones that are applied after the data is retrieved and are therefore generally expensive</li>
<li>IXSCAN is displayed in an explain plan whether or not it is truly a scan &#8211; it could be just index access.</li>
</ul>
<h2>Tuesday &#8211; C02: DB2 10 LUW &#8211; Securely Hiding Behind the Mask &#8211; Rebecca Bond</h2>
<ul>
<li>With RCAC, we can do permissions for rows and masks for columns </li>
<li>This is also called FGAC or Fine-Grained Access Control</li>
<li>Column masking is the topic of this presentation</li>
<li>There is no need to mask all data &#8211; we can create a template and do partial masking</li>
<li>This can be included in db2look with the right flags</li>
<li>UDFs and Triggers can be secured</li>
<li>XML and LOBS cannot be masked</li>
<li>Catalog tables cannot be masked</li>
<li>Nicknames cannot be masked</li>
<li>Changes to masking invalidate the Package Cache</li>
<li>Change control of masking is critical</li>
<li>Must test masking changes very thoroughly to ensure they are providing the desired result</li>
<li>System tables for this stuff: SYSCAT.CONTROLS, SYSCAT.CONTROLDEP</li>
<li>Masking isn&#8217;t fool proof &#8211; it only covers when the data in a row is VIEWED &#8211; for example, a count(*) where query would still give information on the true values</li>
</ul>
<h2>Tuesday &#8211; D03: DB2 Busines Continuity Features &#8211; Dale Mcinnis</h2>
<p>I always learn from Dale, too, when he speaks. I wish I could have attended his other session, but it conflicted with something I couldn&#8217;t miss.</p>
<ul>
<li>Top causes of business interruption:
<ul>
<li>Human error (70-75%, mitigate this with documentation)</li>
<li>Planned maintenance</li>
<li>Disaster</li>
<li>Component failure</li>
</ul>
</li>
<li>Recent Paradigm shift from failover to active/active</li>
<li>Geographic dispersion</li>
<li>Regular maintenance is simply required &#8211; you cannot just ignore it in favor of higher uptime</li>
<li>Application maintenance hassles:</li>
<ul>
<li>Renaming of columns</li>
<li>New versions of stored procedures</li>
</ul>
</li>
<li>Websphere Commerce does not support:
<ul>
<li>Range partitioned tables</li>
<li>Insert time clustering (ITC) tables</li>
</ul>
</li>
<li>IBM is working harder to get the apps they write anyway to support more recent features quickly. It sounds like we may get Commerce certifying on DB2 10 this year</li>
<li>Dale published a great whitepaper on DB2 integration with dedup devices <a href="http://www.ibm.com/developerworks/data/library/techarticle/dm-1302db2deduplication/index.html">http://www.ibm.com/developerworks/data/library/techarticle/dm-1302db2deduplication/index.html</a></li>
<li>TSM dedup can run on the client, which saves network traffic</li>
<li>IBM is working on support for online schema changes</li>
<li>IBM&#8217;s not necessarily scientific polling inds that 75% of OLTP clients, whether on DB2 or Oracle, are doing nothing for DR, only HA</li>
<li>Xcoto has been renamed to Unity!</li>
<li>DR technologies are generally:
<ul>
<li>Physical replication</li>
<li>Logical replication</li>
<li>Storage replication</li>
<li>Single cluster across multiple locations</li>
</ul>
</li>
<li>Not all data must be replicated across sites &#8211; such as guest carts</li>
<li>HADR modes for HA
<ul>
<li>Sync</li>
<li>Nearsync</li>
</ul>
</li>
<li>HADR modes for DR:
<ul>
<li>Async</li>
<li>Super Async</li>
</ul>
</li>
<li>IBM is considering an admin mode on the target for Q replication to turn off things like Triggers</li>
</ul>
<h2>Tuesday &#8211; H04: Best Practices: Upgrade to DB2 LUW 10 &#8211; Melanie Stopfer</h2>
<p>Wow, Melanie really packs the information in. Worth downloading the slides for any presentation she gives.</p>
<ul>
<li>Upgrade servers first, clients later</li>
<li>Use db2prereqcheck</li>
<li>After upgrade, remember to:
<ul>
<li>Uninstall Firefox browser</li>
<li>Re-apply licenses</li>
<li>db2fs (optional)</li>
<li>db2val -a</li>
<li>db2ls</li>
</ul>
</li>
<li>db2ckupgrade</li>
<li>With 10.1, type 1 indexes are no longer allowed. If you are coming from 9.7, you already do not have them, so you can specify -not1 to skip this step and speed it up</li>
<li>Tempspace must be 2X SYSCAT space</li>
<li>SYSCAT space must be 50% empty</li>
<li>The upgrade is done as a single UOW, so be careful of log space</li>
<li>Query Patroller has been discontinued</li>
<li>HADR MUST be stopped</li>
<li>Run db2ckbkup and db2cklogs after backup and before upgrade</li>
<li>If you are really desperate, technically only the last delta backup must be offline &#8211; the full could be online</li>
<li>Always verify the upgrade with db2level</li>
<li>There is a url for getting any needed bind packages</li>
<li>Upgrade does runstats on SYSCAT tables only &#8211; may need a runstats for other tables</li>
<li>db2tdbmgr to upgrade tools (things in the SYSTOOLS tablespace)</li>
<li>db2exmig can be used to upgrade the explain tables &#8211; if you have data in them you want to keep</li>
<li>Event monitor tables must be upgraded too, or event monitors won&#8217;t work &#8211; both formatted and unformatted tables</li>
<li>To undo an upgrade, you have to drop and re-create the instance &#8211; that&#8217;s why it is critical to have all settings documented</li>
<li>Always double-check EVERY config after upgrade &#8211; Diff is your friend</li>
<li>Consider using your HADR standby for backout if your upgrade on the primary fails before you have also done the standby</li>
<li>Copy all log files and .mig files in the active log path before connection &#8211; they are deleted on first connect</li>
<li>JDBC type 2 drivers are discontinued in DB2 10.1</li>
<li>Use Data Studio 3.1.1 or higher to take advantage of all 10.1 features</li>
<li>Default for detailed statistics is now sampled, (default for non-detailed statistics remains full)</li>
<li>Schema specification is no longer required for Runstats</li>
<li>Log records are larger &#8211; you&#8217;ll need to increase your active log space by 10-15%, and also LOGBUFSZ</li>
<li>Consider using these new features:
<ul>
<li>Adaptive Compression</li>
<li>Log Archive Compression</li>
<li>Multi-temperature storage</li>
<li>Insert-Time-Clustered tables</li>
<li>Partitioned tables</li>
<li>db2move supports parallelism</li>
<li>Change history</li>
</ul>
</li>
<li>The Redbook on <a href="http://www.redbooks.ibm.com/abstracts/sg248032.html">Unleasing DB2 10 for LUW</a> is good.</li>
</ul>
<h2>Wednesday &#8211; G05: PureData System for Transactions Overview &#8211; James Cho</h2>
<p>This session was a bit heavy on the marketing for me, but I wanted to have some details in case one of my clients buys one of these.</p>
<ul>
<li>You can create your only patterns</li>
<li>Includes pureScale with 2 CFs</li>
<li>Includes TSM</li>
<li>Includes some GUI facility for taking backups</li>
<li>Includes OPM</li>
<li>Full rack is bigger than Watson</li>
<li>Includes SSD</li>
<li>Cannot split tablespaces and control where their storage lands</li>
<li>Does not include Recovery Expert</li>
</ul>
<h2>Wednesday &#8211; C06: DB2 on the Cloud: Experiences from the Trenches &#8211; Leon Katsnelson</h2>
<p>This session was a bit focused on Amazon costs and options.</p>
<ul>
<li><a href="http://bigdatauniversity.com/">http://bigdatauniversity.com/</a> &#8211; this session is about how it is hosted in the cloud</li>
<li>Cloud = delivery (on-demand)</li>
<li>Infrastructure as a service</li>
<li>Platform as a service</li>
<li>Software as a service</li>
</ul>
<h2>Wednesday &#8211; E07: Battle-Proven SQL Tuning Techniques &#8211; Phill Gunning</h2>
<ul>
<li>Range delimiting predicates are applied earlier than many other predicates &#8211; that&#8217;s why you want them</li>
<li>Jump scan shows up in explain as a jump predicate</li>
<li>Jump Scans are counted in MON_GET_INDEX</li>
<li>Interesting way to re-write a not exists presented in the session &#8211; might look it up on the slides</li>
<li>DB2_ANTIJOIN can improve performance of not exists
<ul>
<li>Default = NO</li>
<li>Yes = not exists</li>
<li>Extend = not exists and not in</li>
</ul>
</li>
<li>&#8216;IN&#8217; is not always evil &#8211; it can sometimes be useful to encourage a semi-join</li>
</ul>
<h2>Wednesday &#8211; TNO: Nuts and Bolts for LUW Performance &#8211; Beulke, Gross, Stopfer</h2>
<ul>
<li>If using TRACKMOD=ON, then any change to a LOB will cause the entire tablespace to be backed up in full, which may lead to larger backups</li>
<li>LOBs should be in separate tablespace</li>
<li>SLOB = Small LOB</li>
<li>STMM sleeps for 60 seconds, does work, then sleeps again</li>
<li>To improve reorg performance:
<ol>
<li>Commit as frequently as possible, since reorg will wait forever for every single row &#8211; it does not respect LOCKTIMEOUT</li>
<li>Clustering reorgs do a forward scan while non-clustering reorgs do a backward scan &#8211; so non-clustering reorgs do half the work or less as clustering reorgs</li>
</ol>
</li>
<li>Consider a script to check active log space and pause reorgs if it is full</li>
</ul>
<h2>Thursday &#8211; C08: The 10 Commandments of Supporting E-Commerce Databases &#8211; ME!</h2>
<p>Well, this was my session, so I&#8217;ll refrain from a review. I think it went well.</p>
<h2>Thursday &#8211; C09: Index Jump Scans and Updated rules for optimal DB2 LUW Index Design &#8211; Scott Hayes</h2>
<p>This one was interesting. Basically, he had trouble getting jump scans to even happen, and in nearly all cases saw more logical reads on 10.1 than on 9.7. He later stated that execution time was about the same or better on 10.1, though. Good tips for using db2batch in the presentation.</p>
<h2>Thursday &#8211; C10: Wowza! Great Tips I&#8217;ve Learned about DB2 LUW 10.1 &#8211; Melanie Stopfer</h2>
<p>Melanie is one of my favorite people on the planet.</p>
<ul>
<li>MON_GET_TRANSACTION_LOG (love those MON_GET table functions!)</li>
<li>Make your log buffer on the standby larger to avoid back pressure</li>
<li>HADR_SPOOL_LIMIT (default=0) &#8211; still guarantees integrity, but allows logs on standby to spool out to disk</li>
<li>ecu_buf_pct</li>
<li>Disadvantage &#8211; this can extend takeover time</li>
<li>ADMIN_MOVE_TABLE can be used for and offline reorg, though you can&#8217;t use LONGLOBDATA in that reorg</li>
<li>If using auotmatic storage, set overhead at the stogroup level</li>
<li>(9.7) &#8211; db2pd -tablespaces has TRACKMOD stats (or MON_GET_TABLESPACE)</li>
<li>Paths changed (due to looping PureScale in):
<ul>
<li>Database Directory</li>
<li>Log</li>
<li>Archive Log</li>
<li>Backup file name</li>
</ul>
</li>
</ul>
<h2>Thursday &#8211; C11: A db2 LUW Fitness Plan &#8211; Brian Fairchild</h2>
<p>Brian is brilliant on reorgs, and has good stuff to say.</p>
<ul>
<li>MON_GET_TABLESPACE will show you if there are pages empty below the High Water Mark</li>
<li>Overflow accesses in the biggest reorg indicator</li>
<li>Great slides on reasons to reorg by formula &#8211; what each formula means</li>
<li>Value compression &#8211; can be used without specific license</li>
</ul>
<h2>Thursday &#8211; D12: An Index&#8217;s Guide to the Universe &#8211; Brad Price</h2>
<ul>
<li>Brad&#8217;s goal for OLTP is to have 5 indexes or less per table</li>
<li>ADVISE_INDEX can store potential indexes</li>
<li>When setting the explain mode, you can use &#8220;recommend indexes&#8221; to populate ADVISE_INDEX</li>
<li>There&#8217;s a use_index column in ADVISE_INDEXES that can be tweaked</li>
</ul>
<h2>Thursday &#8211; DB2 for LUW Panel</h2>
<ul>
<li>Index reorgs done with &#8220;cleanup only&#8221; are fully, 100% online</li>
<li>Full index reorgs take a Z lock during the switch phase</li>
<li>10.1 improves index prefetching</li>
<li>Allowing truncation during reorg gets an S lock at the table level</li>
<li>Read-ahead prefetching may cause the increased Logical Reads that were presented in Scott&#8217;s presentation</li>
<li>One should look at the execution time, not just he number of logical reads</li>
<li>LASTUSED is updated for indexes during a LOAD</li>
<li>PureScale requires AST, so you may have to use db2move or something to move data in from other tablespace types, if converting</li>
</ul>
<h2>Friday &#8211; G13: Customer Success Story: Using DBI Software tools for IBM DB2 LUW</h2>
<p>This one suprised me with quality of content and speaker &#8211; Kohli has some skills!</p>
<ul>
<li>Statistical views may be particularly useful when you have ranges in your where clause</li>
<li>Kohli presented some interesting techniques to deal with poor performing likes on &#8216;%string&#8217; and &#8216;%string%&#8217;. They&#8217;re complicated, and I cannot do them justice here.</li>
<li>Interesting techniques for generating test data</li>
<li>Great query on slide 47 for Foreign Key creation</li>
</ul>
<h2>Friday &#8211; C14: How to Maximize Performance Benefits from DB2 10.1 &#038; 10.1 BLU Intro &#8211; Michael Kwok</h2>
<p>Another surprisingly good one &#8211; interesting speaker and great content:</p>
<ul>
<li>Showed 10.1 performance benchmarks</li>
<li>ESE OLTP was about the same as 9.7</li>
<li>ESE Scalability was better than 9.7</li>
<li>Better performance on 10.1 was when leveraging multiple cores</li>
<li>When using jump scans, bigger gaps = better performance</li>
<li>10.1 is more proactive in prefetching &#8211; look at sync vs. async index reads</li>
<li>10.1 is faster for poorly clustered data</li>
<li>Need for reorgs is lower, and IBM&#8217;s strategic direction seems to be reducing the need for reorg rather than improving reorg</li>
<li>Path length for utilities reduced in 10.1</li>
<li>10.1 encourages anti-join</li>
<li>exfmt in 10.1 recommends indexes to support zig-zag join</li>
</ul>
<h2>Friday &#8211; C15: Data Masking: Protecting both Production and Test Environments &#8211; Wallid Rjaibi</h2>
<p>Man, was I tired by the time I got to this presentation. </p>
<ul>
<li>Verizon produces a comprehensive data security report</li>
<li>A trusted context includes additional capabilities like switching the user</li>
<li>Was 6.1 and cognos support trusted context &#8211; need to find out if Commerce does</li>
<li>When using column masking, you can call a UDF, but not a Stored Procedure</li>
<li>Guardium&#8217;s value add is if you&#8217;re working with multiple RDBMses</li>
<li>Consider the same mask on related columns</li>
<li>Can use Optim&#8217;s data masking UDFs with column masks</li>
</ul>
<p>I have done justice to nothing I saw. It was a fabulous week of drinking from a firehose of knowledge and hanging out with my DB2 geek friends. And it rained all week, so I didn&#8217;t feel bad about being inside and occupied from basically 7 am to 11 pm every day. If you haven&#8217;t been to an IDUG conference, GO &#8211; it is totally worth it.</p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2013/04/23/heading-to-idug-2013-learn-from-my-experience/' rel='bookmark' title='Heading to IDUG 2013? Learn from my experience.'>Heading to IDUG 2013? Learn from my experience.</a></li>
<li><a href='http://db2commerce.com/2012/05/21/idug-na-tech-conference-wrap-up/' rel='bookmark' title='IDUG NA Tech Conference wrap-up'>IDUG NA Tech Conference wrap-up</a></li>
<li><a href='http://db2commerce.com/2013/04/29/idug-orlando-yet-another-post/' rel='bookmark' title='IDUG Orlando (yet another post)'>IDUG Orlando (yet another post)</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=dfC_rwkbpK8:W_MGtMwZROM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=dfC_rwkbpK8:W_MGtMwZROM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/dfC_rwkbpK8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/05/07/idug-na-2013-brain-dump/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/05/07/idug-na-2013-brain-dump/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=idug-na-2013-brain-dump</feedburner:origLink></item>
		<item>
		<title>IDUG Orlando (yet another post)</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/WQuR4G4mkG4/</link>
		<comments>http://db2commerce.com/2013/04/29/idug-orlando-yet-another-post/#comments</comments>
		<pubDate>Mon, 29 Apr 2013 10:00:01 +0000</pubDate>
		<dc:creator>Ember Crooks</dc:creator>
				<category><![CDATA[Education and Skills]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2124</guid>
		<description><![CDATA[I know that every DB2 blogger out there is writting their posts about IDUG and what excites them about it and what their plans are. But I&#8217;m going to write my own post anyway to let my readers know what I&#8217;m excited about and where I&#8217;ll be. First off, I love to meet my readers. [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2012/05/11/idug-2012-na-tech-conference-in-denver/' rel='bookmark' title='IDUG 2012 &#8211; NA Tech Conference in Denver'>IDUG 2012 &#8211; NA Tech Conference in Denver</a></li>
<li><a href='http://db2commerce.com/2012/09/12/idug-na-tech-conference-2013-you-can-be-a-presenter/' rel='bookmark' title='IDUG NA Tech Conference 2013 &#8211; you can be a presenter!'>IDUG NA Tech Conference 2013 &#8211; you can be a presenter!</a></li>
<li><a href='http://db2commerce.com/2013/04/23/heading-to-idug-2013-learn-from-my-experience/' rel='bookmark' title='Heading to IDUG 2013? Learn from my experience.'>Heading to IDUG 2013? Learn from my experience.</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>I know that every DB2 blogger out there is writting their posts about IDUG and what excites them about it and what their plans are. But I&#8217;m going to write my own post anyway to let my readers know what I&#8217;m excited about and where I&#8217;ll be.</p>
<p>First off, I love to meet my readers. It totally makes my day to hear that you&#8217;re reading and that something in my blog has helped you. So find me and introduce yourself &#8211; let&#8217;s talk.</p>
<p>Second, I need pictures for the blog &#8211; of me with you, of me presenting or just your favorite moments. So snap them and send them on over. What I&#8217;d love to find somewhere in the week is a new photo I can use on the main page of the blog! </p>
<p>The single most exciting thing for me this week, is, of course, my own presentation. This is my very first time presenting at IDUG. I&#8217;ll be presenting Thursday morning at 8AM, so don&#8217;t pick that day to sleep in. My presentation is geared towards beginning and intermediate levels, and is  called &#8220;The 10 Commandments of Supporting E-Commerce Databases&#8221;. It will be in &#8220;Grand Sierra H&#038;I&#8221;, which I&#8217;m sure I&#8217;ll understand better once I&#8217;ve checked in on Monday morning.</p>
<p>Other sessions I&#8217;m particulary excited to see &#8211; I list them by person because that&#8217;s how I look for them first:</p>
<ul>
<li>Melanie Stopfer</li>
<ul>
<li>4/30 4:30PM H04 Best Practices: Upgrade to DB2 LUW 10</li>
<li>5/1 3:30PM SIG Nuts and bolts of DB Performance</li>
<li>5/2 1:00PM C10 Wowza! Great Tips I&#8217;ve learned about DB2 LUW 10</li>
</ul>
<li>Scott Hayes &#8211; 5/2 9:15 C09 &#8211; Index Jump Scans and Updated Rules for Optimal DB2 LUW Index Design</li>
<li>Rebecca Bond &#8211; 4/30 2:00 C02 &#8211; DB2 10 LUW – Securely Hiding Behind the Mask</li>
<li>Brian Fairchild &#8211; 5/2 2:15 C11 &#8211; A DB2 LUW Fitness Plan</li>
</ul>
<p>I&#8217;ll be in one of the educational seminars on Monday, and will generally be at most of the events in the evenings. I&#8217;m going to Melanie Stopfer&#8217;s Dine around on Thursday night, because she&#8217;s one of my favorite people on the plannet.</p>
<p>I&#8217;ll aslo be tweeting, so follow me <a href="https://twitter.com/ember_crooks">@ember_crooks</a> if you haven&#8217;t already.</p>
<p>I love the inspiration and ideas that I get from IDUG, and love hanging out with DB2 people. I&#8217;m so excited for this week!</p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2012/05/11/idug-2012-na-tech-conference-in-denver/' rel='bookmark' title='IDUG 2012 &#8211; NA Tech Conference in Denver'>IDUG 2012 &#8211; NA Tech Conference in Denver</a></li>
<li><a href='http://db2commerce.com/2012/09/12/idug-na-tech-conference-2013-you-can-be-a-presenter/' rel='bookmark' title='IDUG NA Tech Conference 2013 &#8211; you can be a presenter!'>IDUG NA Tech Conference 2013 &#8211; you can be a presenter!</a></li>
<li><a href='http://db2commerce.com/2013/04/23/heading-to-idug-2013-learn-from-my-experience/' rel='bookmark' title='Heading to IDUG 2013? Learn from my experience.'>Heading to IDUG 2013? Learn from my experience.</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=WQuR4G4mkG4:j78ncAJO9O0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=WQuR4G4mkG4:j78ncAJO9O0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/WQuR4G4mkG4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/04/29/idug-orlando-yet-another-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/04/29/idug-orlando-yet-another-post/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=idug-orlando-yet-another-post</feedburner:origLink></item>
		<item>
		<title>Attack of the Blob! (Blobs in a Transaction Processing environment)</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/TRcpGBhFPv8/</link>
		<comments>http://db2commerce.com/2013/04/26/attack-of-the-blob-blobs-in-a-transaction-processing-environment/#comments</comments>
		<pubDate>Fri, 26 Apr 2013 11:00:26 +0000</pubDate>
		<dc:creator>mkrafick</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2071</guid>
		<description><![CDATA[[This article is based off the "Attack of the Blob" DB2 Night Show webcast held on Friday April 26, 2013 at 11am EST.] I would love to say that the biggest technical challenge of my career was some massive data warehouse or an OLTP database with an insane number of transactions per second. Heck, I’ve even [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2013/04/22/domesticating-your-blob/' rel='bookmark' title='Domesticating your Blob.'>Domesticating your Blob.</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://db2commerce.com/2013/04/26/attack-of-the-blob-blobs-in-a-transaction-processing-environment/" title="click to read"><img class="post_image" src="http://db2commerce.com/wp-content/uploads/2013/04/Blob.jpg?9d7bd4" alt="The BLLLOOOBBBB!" /></a></p>
<p>[This article is based off the "Attack of the Blob" <a title="DB2 Night Show" href="http://www.dbisoftware.com/db2nightshow/">DB2 Night Show</a> webcast held on Friday April 26, 2013 at 11am EST.]</p>
<p>I would love to say that the biggest technical challenge of my career was some massive data warehouse or an OLTP database with an insane number of transactions per second. Heck, I’ve even had the distinction of working on the second largest DB2 database in the world (at that time).</p>
<p>No, the biggest technical challenge of my career was a three week ordeal on a small 35G database centered on a 5k row table that had data purged nightly because the data wasn’t important the next day. This was also a case where power didn’t mean speed—we were on an oversized server (4 CPU, 1.2 T Disk, 30G Memory) built for massive growth. I had enough juice to light up Atlanta, but really only needed to power a flashlight.</p>
<p>This table, with the help of other mistuned areas, would snarl the database so badly that the whole application would grind to a halt. This would cause 1600 locations and 10k+ teammates to light up our technical support lines like a Christmas tree.</p>
<p>As much as I would love to blame the SAN, or networking, or anyone other than me, the problem was in my back yard. How I discovered the issue is an article in itself. However, I should give a quick nod to Scott Hayes and DBI. My performance analysis method came from Scott’s “DB2 for LUW Performance Workshop” that I took as a pre-conference seminar at the IDUG Conference in 2012. He has a few blogs on the topic located on the DBI website under <a title="DBI Performance How To's" href="http://www.dbisoftware.com/blog/db2_performance.php?cat=39">“Performance How To’s” </a>. A good place to start are his “Elephants and Mosquitoes” entries.</p>
<p>It ultimately came down to a few areas:</p>
<ol>
<li>The database architecture was database agnostic. It wasn’t coded for DB2, or Oracle, or SQL Server. So DB2 features to improve speed were not implemented.</li>
<li>When the DB was stood up years ago, we dumped everything into the same tablespaces and bufferpools. That’s right, the “everyone in the pool” mentality. We did not tune for hot tables or important areas. In other words, we shot ourselves in the foot.</li>
<li>Blobs. These things are evil. I had never really tuned for this data type. I had to learn how to quickly tame this beast.</li>
</ol>
<p>For this article, I am going to focus on handling BLOBS. There was some basic Database Tuning 101 applied—implementing DB2 Environment settings for OLTP best practice, identifying hot tables and breaking them out to their own tablespaces and bufferpools, and tweaking the LOGBUFSZ settings—but the largest lift came from taming the evil BLOB that was slowing down my database.</p>
<h2>What is a Blob … besides big, ugly, and slow?</h2>
<p>BLOB is short for Binary Large Object which can be many things—for example, Documents, Voice Data, Pictures, or mixed media.</p>
<p>What makes BLOBs unique is that BLOB data is not stored in a row. It’s stored externally to the table with a pointer giving the location of the object. See the figure below:</p>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/04/01-LOBDescriptor.jpg?9d7bd4"><img class="aligncenter size-full wp-image-2075" alt="01-LOBDescriptor" src="http://db2commerce.com/wp-content/uploads/2013/04/01-LOBDescriptor.jpg?9d7bd4" width="534" height="323" /></a></p>
<p>Blobs are not stored within a row because it can be impractical, sometimes impossible, to fit the BLOB in row without blowing out row length limits (32k). See below for an example of why BLOBS are not in row natively. [Note: Both graphics taken directly from <a title="LOBs within DB2" href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.dbobj.doc%2Fdoc%2Fc0054525.html">IBM Info Center</a>]</p>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/04/02-LOB32kViolation.jpg?9d7bd4"><img class="aligncenter size-full wp-image-2077" alt="02-LOB32kViolation" src="http://db2commerce.com/wp-content/uploads/2013/04/02-LOB32kViolation.jpg?9d7bd4" width="484" height="161" /></a></p>
<p>So, why do we care if we are not storing data in row? BLOB data types are a concern to DBA’s because they spin disk. If data is not stored within a row, it can’t be brought up into memory (bufferpool), which means I/O overhead. I/O overhead, spinning disk, physical reads—they all are slow compared to reading in memory. Is this a big deal? Not always. For a data warehouse, where a query can run minutes or hours, this isn’t as crippling as it sounds; but from a transaction processing point of view, where we measure things in milliseconds, time to spin disk can be an eternity.</p>
<h2>Symptoms—How did I/O affect the Database?</h2>
<p>To give you an example of how blobs affect I/O, let’s take a look at some metrics from my database in a 20 minute timeframe.</p>
<pre>Direct reads					=	233754
Direct writes					=	174318
							(8715 Minute)
Direct write elapsed time (ms)			=	24593
Update/Insert/Delete statements executed	=	93176
Log pages written				=	88708
Number write log IOs				=	78827</pre>
<p>Metrics are all about perspective. Is writing to disk 174k+ times in 20 minutes excessive? Without data to compare to, it’s hard to tell. But common sense tells us we can assume at the very least the application is a little chatty when it comes to direct writes.</p>
<p>The other piece of the puzzle is disk utilization. When the DB was humming, data disks would go to 30-40% utilized while DB2 Log disk ran at 50-60%. When the situation started to get a little dicey, was when data disks were up and holding anywhere between 60-80% and DB2 Log disks were at 90%+. Data was moving, and moving at a good clip, but the response time wasn’t fast enough for the application.</p>
<p>Why was the DB2 Log disk consistently higher? Blobs log heavily by nature. So not only are you off spinning disk to access the blob, but you are putting pressure on your logging disk as well.</p>
<p>It seems a lost cause, doesn&#8217;t it? Blobs by nature spin disk, the application accesses this table on almost every transaction, and we can’t get DB2 to lift this into memory. It seems as if you are between a rock and a hard place.</p>
<p>What was the vendor’s solution? Isolate the table into its own tablespace and its own LUN of disk. Better yet, if you are in real pain, make that a solid state disk. This is what other clients have had to do in the past, and to be honest, at the time, this seemed like the only solution. In the end, it turned out to be “Plan B”—Let’s try a Hail Mary Pass and see what turns up.</p>
<h2>Domesticating your Blob</h2>
<h3>Stop the Chit Chat</h3>
<p>If your DB went down, do you really need to recover the data from that BLOB? Well, in our case, that was a resounding no. Not only did we not need the data, the table was purged each night for performance reasons.</p>
<p>So let me introduce the NOT LOGGED clause:</p>
<pre>For example:
CREATE TABLE EMPLOYEE
    (EMPNO     CHAR(6)     NOT NULL PRIMARY KEY,
    FIRSTNME  VARCHAR(12) NOT NULL,
    MIDINIT   CHAR(1)     NOT NULL WITH DEFAULT,
    LASTNAME  VARCHAR(15) NOT NULL,
    WORKDEPT  CHAR(3),
    PHONENO   CHAR(4),
    PHOTO     BLOB(10M)   NOT NULL  NOT LOGGED)
IN RESOURCE</pre>
<p>So what happens in a recovery scenario? Well, if you RESTORE and ROLLFORWARD, the blob data will be replaced by binary zeros.</p>
<p>That isn’t to say that there is no record of what is going on. DB2 uses “shadowing,” a recovery technique where current storage pages are never overwritten. Old unmodified pages are kept as “shadow copies” that are discarded when they are no longer needed for rollback. So you lose recovery, but not the ability to rollback a transaction stopped in mid-flight.</p>
<p>[As a side note: Rule of thumb is to use this feature on LOBS over 10MB. LOBS over 1G can’t be logged.]</p>
<p>This feature by itself dropped DB2LOG disk utilization by 10%. This bought us enough time to focus on implementing best practices and tackling the larger problem of how the database was using blobs.</p>
<h3>Break Rule Number 1</h3>
<p>Remember what I said about DB2 not being able to keep blobs in a row? It was impractical and sometimes impossible?</p>
<p>I lied. Well, not lied as much as didn’t tell all the truth.</p>
<p>Natively, lobs are not held in row. I mentioned this is because blobs are usually much bigger than 32k and would blow out maximum row size; but this isn’t always the case. If your blob can fit into the row, you can explicitly tell DB2 to treat it that way using DB2’s INLINE feature.</p>
<p>What is the benefit? Once the blob is held in row, it CAN be pulled into bufferpool and be accessed in memory. You remove the need for physical reads. Don’t forget, the row (including blob) is now eligible for row compression!</p>
<p>To do this you need three commands.</p>
<h4>Step 1:</h4>
<p>Use the ADMIN_EST_INLINE_LENGTH command to see if your blob can fit into a normal size row.</p>
<pre>Command:
ADMIN_EST_INLINE_LENGTH--(--column-name--)--------------&gt;</pre>
<p>Results:</p>
<ul>
<li>(number): Size needed in row to be brought inline</li>
<li>NULL: Inputs are NULL</li>
<li>-1: Cannot be inlined due to length</li>
<li>-2: Inserted before 9.7, can’t be evaluated</li>
</ul>
<h4>Step 2:</h4>
<p>Alter the table using the INLINE command.</p>
<pre>Command:
ALTER TABLE (tablename) ALTER COLUMN (colname) SET INLINE LENGTH 
(Where value is max length from ADMIN_EST_INLINE_LENGTH evaluation)</pre>
<p>Keep in mind, you will need to respect the max row length based off your tablespace settings. You will also need to add 4 for INLINE overhead.[Note: Graphic taken from <a title="Row Limits" href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.rtn.doc%2Fdoc%2Fr0054083.html">IBM Info Center</a>]</p>
<p><a href="http://db2commerce.com/wp-content/uploads/2013/04/03-RowLimits.jpg?9d7bd4"><img class="aligncenter size-full wp-image-2076" alt="03-RowLimits" src="http://db2commerce.com/wp-content/uploads/2013/04/03-RowLimits.jpg?9d7bd4" width="701" height="175" /></a></p>
<p>&nbsp;</p>
<h4>Step 3:</h4>
<p>REORG the table using LONGLOB feature. For the INLINE feature to take effect, you must UPDATE the row or run a REORG using the LONGLOB parameter. You won’t need to do this every time as it is only used for the conversion process. There usually isn’t a real benefit unless there are XML columns in your table; in that case, some space may be reclaimed. In a normal REORG this would be time consuming and doesn’t improve clustering.</p>
<p>Finally, as you step back and admire your work, know that not all blobs will inline. In our specific case, close to 20-30% of our blobs could not be brought into rows. This is OK: operating 70%-80% of the time in memory is still a huge improvement. It is acceptable to spin disk 20-30% of the time, in our scenario.</p>
<p>[In our specific scenario, we had this table in its own tablespace and bufferpool after the redesign. Not only did we turn off FILESYSTEM CACHING (see below), the bufferpool was large enough to pull the bulk of the table in memory].</p>
<h3>Put on Afterburners</h3>
<p>Lifting your blobs into memory should give you an enormous lift. However, there is one more tuning tidbit you can implement: Know when and when not to use FILESYSTEM CACHING.</p>
<p>Using FILESYSTEM CACHING or NO FILESYSTEM CACHING commands allow you to enable/disable non-buffered I/O on specific tablespaces while avoiding dependency on physical layout. In an AIX environment, you can cause double buffering at a DB2 level when the O/S is already buffering for you.</p>
<p>When dealing with BLOBs natively, you WANT filesystem caching enabled. DB2 needs this buffering to improve performance.</p>
<p>When you do not have BLOBs, you DO NOT want filesystem caching enabled.</p>
<p>In our specific scenario, we had blob and non-blob tables mixed in the same tablespaces and bufferpools. This was a huge performance drag because only 15% of our 400+ tables needed filesystem caching. The other 85% were doing double work.</p>
<p>If you are thinking ahead and are able to separate your blobs into their own tablespaces and bufferpools you can turn on FILESYSTEM CACHING as needed for blob tables.</p>
<p>Note: If you now have INLINED blobs, you can disable filesystem caching. If the bulk of blobs are in row, you will get more lift by turning this feature off.<br />
<a href="http://db2commerce.com/wp-content/uploads/2013/04/usain.jpg?9d7bd4"><img class="alignright size-full wp-image-2091" alt="usain" src="http://db2commerce.com/wp-content/uploads/2013/04/usain.jpg?9d7bd4" width="243" height="283" /></a></p>
<h3>Usain Bolt got nothing on us.</h3>
<p>After three weeks of research, analysis, testing, and redesign we were ready to go live and implement our new solution. Would the new approach address our needs or was I really going to need to speak to management and advocate for solid state drives?</p>
<p>Here is a peek of what we saw, comparing apples to apples:</p>
<pre>				Before		After
Direct reads			= 233754	73471	68% Improvement
Direct writes			= 174318	14008	91% Improvement
Direct write requests		= 16213	        262	98% Improvement
Direct write elapsed time (ms)	= 24593	        1622	93% Improvement
Log pages written		= 88708	        53642	Overall work drops
Log write time (sec.ns)		= 89	   	76	Overall work drops
Number write log IOs		= 78827	        48354	Overall work drops</pre>
<p>And what was the feedback from load testing?</p>
<ul>
<li>Total Transactions Processed increased by 9%</li>
<li>20% of Total Transactions improved by 15-16%</li>
<li>Less than 1% (Quote &#8220;Very Very Few&#8221;) of transactions slowed down slightly</li>
</ul>
<p>More detail from production:</p>
<ul>
<li>SQL exceeding 2 seconds on basic FETCH drops from thousands to less than 50</li>
<li>97.93% drop &#8211; Execution time for UPDATE statements per 100 executions against problem table (0.436 seconds to 0.009 seconds)</li>
<li>81.7% drop &#8211; Execution time for SELECT statements per 100 executions against problem table (0.656 seconds to 0.120 seconds)</li>
<li>ZERO Lock Escalations per 1000 transactions</li>
<li>Write Rate (how often we have to spin disk) &#8211; Drops 60 IOPS (per volume) to 18 (70% Improvement)</li>
<li>Write Transfer Size &#8211; Increases from 8k to 18k per IO Operation (2.25x Improvement)</li>
<li>Read Rate (how often we have to spin disk) &#8211; Drops from 15 IOPS (per volume) to 12.</li>
<li>Read Transfer Size &#8211; Increases from 4.29 to 4.94 per IO Operation</li>
<li>10-20% drop in disk utilization</li>
</ul>
<h2>Every superhero needs a sidekick</h2>
<p>I wasn’t kidding when I said that this was the biggest challenge of my career. Nor was I exaggerating in my DB2 Night Show webcast when I said I pulled in a small army to help. I may speak as an expert in this blog, but I am not an expert. An expert works almost independently—I solved this with a small army: Prashant Sogarwal, who hands down has to be one of the top DBA’s on the east coast, helped design the solution and acted as a mentor. Stephanie Knight-Baker spent hours in data analysis and solution coding. Scott Hayes and his performance and tuning techniques helped narrow down where the problem was; Scott’s expertise in tuning was also invaluable. Ember was always available to bounce ideas off of and encouraged me more than once.</p>
<p>This leads me to a point I want to make as a parting thought. Where would I have been without my friends, teammates, and contacts? All of these contacts were made through my volunteerism through the DB2 User Group—IDUG (International DB2 User Group). My analysis techniques came from conference sessions and my network of help came from other members.</p>
<p>You can’t save the day on your own. You can’t stand up in front of an executive, with an “S” on your chest and the wind at your back, without a team to support you. So I encourage you to not only apply the techniques and analysis in this article, but to go out and actively seek out that small team you go to in an emergency. Because in the end it will be your peers, friends, and mentors that pull you out of the fire. Or in this case, beat back the giant blob trying to eat your database one I/O at a time.</p>
<h2>Further Reading from IBM Info Center:</h2>
<ol>
<li><a title="Large Objects (LOBs)" href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.ref.doc%2Fdoc%2Fr0008473.html">Large objects (LOBs)</a></li>
<li><a title="Large Object (LOB) column considerations" href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.admin.doc%2Fdoc%2Fc0004978.htm">Large object (LOB) column considerations</a></li>
<li><a title="INLINE LOBs improve performance" href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.perf.doc%2Fdoc%2Fc0053761.html">Inline LOBs improve performance</a></li>
<li><a title="ADMIN_EST_INLINE_LENGTH Function" href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.sql.rtn.doc%2Fdoc%2Fr0054083.html">ADMIN_EST_INLINE_LENGTH function &#8211; Estimate length required to inline data</a></li>
<li><a title="Storing LOBS inline in table rows" href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.dbobj.doc%2Fdoc%2Fc0054525.html">Storing LOBs inline in table rows &#8211; IBM DB2 9.7 for Linux, UNIX, and Windows</a></li>
<li><a title="Table Spaces without file system caching" href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.dbobj.doc%2Fdoc%2Fc0052377.html">Table spaces without file system caching</a></li>
</ol>
<hr />
<p><strong><a href="http://db2commerce.com/wp-content/uploads/2012/06/Krafick_Headshot.jpg?9d7bd4"><img class="alignleft size-full wp-image-907" alt="Krafick_Headshot" src="http://db2commerce.com/wp-content/uploads/2012/06/Krafick_Headshot.jpg?9d7bd4" width="130" height="186" /></a>Michael Krafick</strong> is an occasional contributor to db2commerce.com. He has been a production support DBA for over 12 years in data warehousing and highly transactional OLTP environments. He was acknowledged as a top ten session speaker for “10 Minute Triage” at the 2012 IDUG Technical Conference. Michael also has extensive experience in setting up monitoring configurations for DB2 Databases as well as preparing for high availability failover, backup, and recovery. He can be reached at “Michael.Krafick (at) gmail (dot) com”. Linked-in Profile: http://www.linkedin.com/in/michaelkrafick. Twitter: mkrafick</p>
<p>&nbsp;</p>
<p>Mike’s blog posts include:<br />
<a title="10 Minute Triage: Assessing Problems Quickly (Part I)" href="http://db2commerce.com/2012/06/28/10-minute-triage-assessing-problems-quickly-part-1/"> 10 Minute Triage: Assessing Problems Quickly (Part I)</a><br />
<a title="10 Minute Triage: Assessing Problems Quickly (Part II)" href="http://db2commerce.com/2012/07/05/10-minute-triage-assessing-problems-quickly-part-2/"> 10 Minute Triage: Assessing Problems Quickly (Part II) </a><br />
<a title="Now, now you two play nice ... DB2 and HACMP failover" href="http://db2commerce.com/2012/12/18/now-now-you-two-play-nice-db2-and-hacmp-failover/">Now, now you two play nice … DB2 and HACMP failover</a><br />
<a title="Technical Conference - It's a skill builder, not a trip to Vegas" href="http://db2commerce.com/2013/01/10/technical-conferences-its-a-skill-builder-not-a-trip-to-vegas/">Technical Conference – It’s a skill builder, not a trip to Vegas.</a><br />
<a title="Why won't you just die?! (Cleaning DB2 Processes in Memory)" href="http://db2commerce.com/2013/04/25/why-wont-you-just-die-cleaning-db2-process-in-memory/">Why won’t you just die?! (Cleaning DB2 Process in Memory)</a></p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2013/04/22/domesticating-your-blob/' rel='bookmark' title='Domesticating your Blob.'>Domesticating your Blob.</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=TRcpGBhFPv8:SVdE7i95OcM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=TRcpGBhFPv8:SVdE7i95OcM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/TRcpGBhFPv8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/04/26/attack-of-the-blob-blobs-in-a-transaction-processing-environment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/04/26/attack-of-the-blob-blobs-in-a-transaction-processing-environment/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=attack-of-the-blob-blobs-in-a-transaction-processing-environment</feedburner:origLink></item>
		<item>
		<title>Why won’t you just die?! (Cleaning DB2 Process in Memory)</title>
		<link>http://feedproxy.google.com/~r/db2commerce/wKTM/~3/ty3CWTjdAu4/</link>
		<comments>http://db2commerce.com/2013/04/25/why-wont-you-just-die-cleaning-db2-process-in-memory/#comments</comments>
		<pubDate>Thu, 25 Apr 2013 11:00:44 +0000</pubDate>
		<dc:creator>mkrafick</dc:creator>
				<category><![CDATA[Data Pruning/DBClean]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://db2commerce.com/?p=2056</guid>
		<description><![CDATA[It happens. We joke that it doesn’t. Make sure not tell our Oracle or SQL Server counterparts but occasionally DB2 becomes … How do I put this eloquently? Hosed. Snarled. Non-functional. Zombied (think the “Walking Dead” TV show). Dorked. Sometimes there is a memory leak, instance level crash, trap, or OS issue. DB2 just goes [...]<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href='http://db2commerce.com/2011/03/07/what-to-do-when-db2-wont-work/' rel='bookmark' title='What to do when DB2 won&#8217;t work'>What to do when DB2 won&#8217;t work</a></li>
<li><a href='http://db2commerce.com/2012/10/26/when-both-hadr-servers-are-rebooted-at-the-same-time-db2-wont-work/' rel='bookmark' title='When Both HADR Servers are Rebooted at the Same Time, DB2 Won&#8217;t Work'>When Both HADR Servers are Rebooted at the Same Time, DB2 Won&#8217;t Work</a></li>
<li><a href='http://db2commerce.com/2012/11/20/looking-at-how-much-memory-db2-is-using/' rel='bookmark' title='Looking at How Much Memory DB2 is Using'>Looking at How Much Memory DB2 is Using</a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p><a href="http://db2commerce.com/wp-content/uploads/2012/06/Krafick_Headshot.jpg?9d7bd4"><img class="size-full wp-image-907 alignleft" alt="Krafick_Headshot" src="http://db2commerce.com/wp-content/uploads/2012/06/Krafick_Headshot.jpg?9d7bd4" width="130" height="186" /></a>It happens. We joke that it doesn’t. Make sure not tell our Oracle or SQL Server counterparts but occasionally DB2 becomes … How do I put this eloquently? Hosed.</p>
<p>Snarled.</p>
<p>Non-functional.</p>
<p>Zombied (think the “Walking Dead” TV show).</p>
<p>Dorked.</p>
<p>Sometimes there is a memory leak, instance level crash, trap, or OS issue. DB2 just goes into a bad state and you have to bring down DB2 as gently as you can.</p>
<p>And if not, hit it with a bat. Whatever works.</p>
<p>Even when DB2 comes down properly, you need to be diligent to make sure EVERYTHING has stopped before some more serious work happens, like a DB2 upgrade. You need ZERO DB2 processes in memory.</p>
<p>[Side Note: Ember has a really good article on stopping DB2 in preparation for an upgrade. Check out the article here - <a title="How to Completely Stop DB2" href="http://db2commerce.com/2011/04/13/how-to-completely-stop-db2/">Link</a>]</p>
<p>There is a level of escalation when DB2 is snarled. You start with deactivating the database which allows all things to come to a natural end. However, if step two fails, move to step 3, if step 3 fails, move to the big guns in step four. If you end up hitting step five, you know things are not good.</p>
<ol>
<li>Deactivate Database</li>
<li>DB2STOP</li>
<li>DB2STOP force</li>
<li>DB2_KILL</li>
<li>Server Reboot</li>
</ol>
<p>There is always real risk with a DB2_KILL of instance or database corruption. It is always a last resort.</p>
<p>Let’s say DB2 is down one way or another. And we want to be sure all DB2 processes are out of memory and the server isn’t chewing on something that could be a zombie. How do we accomplish that in an AIX/UNIX/LINUX environment?</p>
<h2>Zombie Hunting</h2>
<h3>IPCS</h3>
<p>From the DB2 Info Center: “<em>The ipcs command writes to the standard output information about active interprocess communication facilities. If you do not specify any flags, the ipcs command writes information in a short form about currently active message queues, shared memory segments, semaphores, remote queues, and local queue headers</em>”.</p>
<p>To use this in our environment you can issue the following.</p>
<pre>Command:
ipcs | grep db2

This returns something similar to:
q 154140691 0xffffffff -Rrw------- INSTID GROUPNM
q 611319866 0xffffffff -Rrw------- INSTID GROUPNM
m 708837404 0x7e074e61 --rw------- INSTID GROUPNM
m 577765405 0xffffffff --rw------- INSTID GROUPNM
s 16777236  0x7e074e74 --ra-ra-ra- FENCEID GROUPNM</pre>
<p>(Where ‘q’ is Message Queue, ‘m’ is Shared Memory Segment, and ‘s’ is a semaphore)</p>
<p>In short, all items returned are DB2 processes still in memory. If you brought DB2 down cleanly there may be very few or no processes. If you hit DB2 with a bat (db2_kill), you may have many.</p>
<p>To clean your memory of DB2 processes you can issue two different commands.</p>
<ol>
<li>IPCLEAN<br />
Issuing “ipclean” by itself will act as a catch-all. Essentially any processes in memory for that ID are terminated, or a terminate is attempted. If you came down cleanly with a deactivate and DB2STOP, IPCLEAN should be sufficient. DB2_KILL issues an ipclean as a part of its processing.</p>
</li>
<li>IPCRM<br />
From the DB2 Info Center: “<em>Removes message queue, semaphore set, or shared memory identifiers</em>”.</p>
<pre>Command:
    Ipcrm 	-q 	ID
    Ipcrm 	-m 	ID
    Ipcrm 	-s 	ID</pre>
<p>Where q,m,s matches what was returned in IPCS command. The ID used is listed in the first column of IPCS.</p>
<p>Example:</p>
<pre>
ipcrm -q 154140691 </pre>
</li>
</ol>
<p>For more details on the IPCS and IPCRM commands, head over to the DB2 Info Center at <a title="IPCS Info Center" href="http://tinyurl.com/dyra4m2">http://tinyurl.com/dyra4m2</a> .</p>
<h2>Use Caution</h2>
<p>Let’s admit it; we are not System Administrators (SA). Use these commands with caution as they can cause more harm than good. Run them as the DB2 instance owner. Use common sense, and if you are over your head, reach out to your SA. They will be happy to help. Getting them involved could prevent a reboot.</p>
<p>I don’t know about you, but I bribe my SA for help with coffee. Don’t make a newbie mistake and try to bribe with that weak stuff in the break room. If the SA grumbles and snarls, you used cheap coffee. Proceed to Starbucks quickly.</p>
<hr />
<p><strong>Michael Krafick</strong> is an occasional contributor to db2commerce.com. He has been a production support DBA for over 12 years in data warehousing and highly transactional OLTP environments. He was acknowledged as a top ten session speaker for “10 Minute Triage” at the 2012 IDUG Technical Conference. Michael also has extensive experience in setting up monitoring configurations for DB2 Databases as well as preparing for high availability failover, backup, and recovery. He can be reached at “Michael.Krafick (at) gmail (dot) com”. Linked-in Profile: http://www.linkedin.com/in/michaelkrafick. Twitter: mkrafick</p>
<p>Mike’s blog posts include:<br />
<a title="10 Minute Triage: Assessing Problems Quickly (Part I)" href="http://db2commerce.com/2012/06/28/10-minute-triage-assessing-problems-quickly-part-1/"> 10 Minute Triage: Assessing Problems Quickly (Part I)</a><br />
<a title="10 Minute Triage: Assessing Problems Quickly (Part II)" href="http://db2commerce.com/2012/07/05/10-minute-triage-assessing-problems-quickly-part-2/"> 10 Minute Triage: Assessing Problems Quickly (Part II) </a><br />
<a title="Now, now you two play nice ... DB2 and HACMP failover" href="http://db2commerce.com/2012/12/18/now-now-you-two-play-nice-db2-and-hacmp-failover/">Now, now you two play nice … DB2 and HACMP failover</a><br />
<a title="Technical Conference - It's a skill builder, not a trip to Vegas" href="http://db2commerce.com/2013/01/10/technical-conferences-its-a-skill-builder-not-a-trip-to-vegas/">Technical Conference – It’s a skill builder, not a trip to Vegas.</a></p>
<div class='yarpp-related-rss'>
<p>Related posts:</p><ol>
<li><a href='http://db2commerce.com/2011/03/07/what-to-do-when-db2-wont-work/' rel='bookmark' title='What to do when DB2 won&#8217;t work'>What to do when DB2 won&#8217;t work</a></li>
<li><a href='http://db2commerce.com/2012/10/26/when-both-hadr-servers-are-rebooted-at-the-same-time-db2-wont-work/' rel='bookmark' title='When Both HADR Servers are Rebooted at the Same Time, DB2 Won&#8217;t Work'>When Both HADR Servers are Rebooted at the Same Time, DB2 Won&#8217;t Work</a></li>
<li><a href='http://db2commerce.com/2012/11/20/looking-at-how-much-memory-db2-is-using/' rel='bookmark' title='Looking at How Much Memory DB2 is Using'>Looking at How Much Memory DB2 is Using</a></li>
</ol>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=ty3CWTjdAu4:R25kpZFzz3I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/db2commerce/wKTM?a=ty3CWTjdAu4:R25kpZFzz3I:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/db2commerce/wKTM?d=qj6IDK7rITs" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/db2commerce/wKTM/~4/ty3CWTjdAu4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://db2commerce.com/2013/04/25/why-wont-you-just-die-cleaning-db2-process-in-memory/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://db2commerce.com/2013/04/25/why-wont-you-just-die-cleaning-db2-process-in-memory/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=why-wont-you-just-die-cleaning-db2-process-in-memory</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced

 Served from: db2commerce.com @ 2013-05-23 21:11:12 by W3 Total Cache -->
