<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Tork Wrench &#187; db2</title>
	<atom:link href="http://www.torkwrench.com/tag/db2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.torkwrench.com</link>
	<description>Things I learnt today, working on IBM Lotus Web Content Management.</description>
	<lastBuildDate>Tue, 17 Aug 2010 06:50:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>DB2 9.5 install hangs on Linux during db2icrt</title>
		<link>http://www.torkwrench.com/2010/06/22/db2-9-5-install-hangs-on-linux-during-db2icrt/</link>
		<comments>http://www.torkwrench.com/2010/06/22/db2-9-5-install-hangs-on-linux-during-db2icrt/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 02:07:16 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[random]]></category>
		<category><![CDATA[Centos]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[redhat]]></category>

		<guid isPermaLink="false">http://www.torkwrench.com/?p=243</guid>
		<description><![CDATA[How to fix a hung DB2 9.5 install on Linux. <a href="http://www.torkwrench.com/2010/06/22/db2-9-5-install-hangs-on-linux-during-db2icrt/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I spent a bunch of time cleaning up our collection of kickstart files. It&#8217;s a grind, I must&#8217;ve rerun the Redhat installer 40 times in the last 24 hours. The nice thing is that we now have the same base linux install for all the different versions of Redhat and Fedora that we are using. </p>
<p>All this change has thrown up some new problems however. For each of the installs I was doing, the system would hang when trying to install DB2. </p>
<p>When there is a problem with the db2 install, the first place to go is the /tmp/db2setup.log. Inside that it seemed to be hanging on the instance creation step.</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Command to be run: &quot;cd /opt/ibm/db2/V9.5/;/opt/ibm/db2/V9.5/instance/db2icrt -a server -s wse -u db2fenc1 -p db2c_db2inst1 db2inst1&quot;.</div></div>
<p>Looking through the output of <strong>ps -ef | grep db2</strong>, I saw a suspicious process called UpdateAutoRun.sh. </p>
<p>I couldn&#8217;t find a DB2 specific technote for this error, but a bit of searching brought up <a href="http://www-01.ibm.com/support/docview.wss?uid=swg1IZ18123">this one from Tivoli Monitoring (ITM).</a> Apparently DB2 installs an instance of ITM along with DB2 &#8211; I&#8217;m not sure what it is for. Anyway, there seems to be a dodgy script inside the ITM that relies on the venerable text editor &#8216;ed&#8217;. Without ed installed the log file <db2home>/itma/logs/UpdateAutoRun.log keeps filling up with the line:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">UpdateAutoRun.sh info: &nbsp;Delete of agent start all record successful.</div></div>
<p>Installing ed in (even while db2setup is running!) allows this script to finish and the rest of the install to complete successfully.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkwrench.com/2010/06/22/db2-9-5-install-hangs-on-linux-during-db2icrt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB2 and ConfigEngine : Security mechanism not supported</title>
		<link>http://www.torkwrench.com/2009/06/28/db2-and-configengine-security-mechanism-not-supported/</link>
		<comments>http://www.torkwrench.com/2009/06/28/db2-and-configengine-security-mechanism-not-supported/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 04:19:58 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[websphere]]></category>

		<guid isPermaLink="false">http://www.torkwrench.com/?p=112</guid>
		<description><![CDATA[How to fix the error "Connection authorization failure occurred.  Reason: Security mechanism not supported." when using DB2's DATA_ENCRYPT setting and WebSphere Portal's ConfigEngine. <a href="http://www.torkwrench.com/2009/06/28/db2-and-configengine-security-mechanism-not-supported/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I try to post really random solutions here, and this one&#8217;s a doozy ! I was updating a production machine from Portal 6.1.0 to 6.1.0.2. I always run the ConfigEngine tasks validate-standalone-ldap and validate-database-connection before I run any Portal update to make sure that the update won&#8217;t fail from something silly like a missing password. I&#8217;d highly recommend this practice on your Portal systems.<br />
This time when running validate-database-connection, I ran into this error:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">action-validate-database:<br />
&nbsp; &nbsp; &nbsp;[echo] domain &nbsp; &nbsp; &nbsp; 'jcr'<br />
&nbsp; &nbsp; &nbsp;[echo] DbtDbDriver &nbsp;'com.ibm.db2.jcc.DB2Driver'<br />
&nbsp; &nbsp; &nbsp;[echo] DbtDbLibrary '/home/db2inst1/sqllib/java/db2jcc.jar:/home/db2inst1/sqllib/java/db2jcc_license_cu.jar'<br />
&nbsp; &nbsp; &nbsp;[echo] DbtDbUser &nbsp; &nbsp;'db2inst1'<br />
&nbsp; &nbsp; &nbsp;[echo] DbtDbUrl &nbsp; &nbsp; 'jdbc:db2://localhost:50000/WPS6TCP'<br />
&nbsp; &nbsp; &nbsp;[echo] DbtDbName &nbsp; &nbsp;'WPS6TCP'<br />
&nbsp; &nbsp; &nbsp;[java] [06/28/09 13:47:09.620 EST] Attempting to make connection using: jdbc:db2://localhost:50000/WPS6TCP :: db2inst1 :: PASSWORD_REMOVED<br />
&nbsp; &nbsp; &nbsp;[java] [06/28/09 13:47:09.875 EST] ERROR: Error obtaining connecting for jdbc:db2://localhost:50000/WPS6TCP<br />
&nbsp; &nbsp; &nbsp;[java] com.ibm.db2.jcc.b.SqlException: [ibm][db2][jcc][t4][201][11237] Connection authorization failure occurred. &nbsp;Reason: Security mechanism not supported.<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.m(b.java:1981)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.a(b.java:1565)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.bb.b(bb.java:3386)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.bb.a(bb.java:332)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.bb.a(bb.java:112)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.j(b.java:1259)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.b(b.java:1132)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.b(b.java:715)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.a(b.java:701)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.a(b.java:378)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.a.b.&lt;init&gt;(b.java:316)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:166)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at java.sql.DriverManager.getConnection(DriverManager.java:572)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at java.sql.DriverManager.getConnection(DriverManager.java:165)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.wps.config.db.Database.init(Database.java:139)<br />
&nbsp; &nbsp; &nbsp;[java] &nbsp; &nbsp; at com.ibm.wps.config.db.validation.ValidationDriver.main(ValidationDriver.java:209)</div></div>
<p>It looked like the problem I&#8217;d seen on Ubuntu, where the database password was hashed with an unsupported scheme, but it couldn&#8217;t be, because this was on a plain old RHEL system. The difference was that I&#8217;d recently changed DB2&#8242;s database manager settings from AUTHENTICATION = SERVER to AUTHENTICATION = DATA_ENCRYPT . DATA_ENCRYPT is good because it will send your sql data <em>and</em> your authentication details encrypted across the wire. </p>
<p>Anyway, to make the validation work on a system where you have enabled the DATA_ENCRYPT parameter, just add securityMechanism=13; to the end of the database url. So mine becomes:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">jcr.DbUrl=jdbc:db2://localhost:50000/WP6TCP:securityMechanism=13;</div></div>
<p>So how would the system work in any case, if the database url was wrong?!? The answer is clear after delving into the WebSphere admin console a little bit. I&#8217;d configured the custom properties of each Portal datasource post database transfer to work with DATA_ENCRYPT, but not the database urls in wkplc_comp.properties. Here&#8217;s where you would set it.</p>
<p><img src="http://www.torkwrench.com/wp-content/uploads/2009/06/data_encrypt.png" alt="data_encrypt" title="data_encrypt" width="626" height="399" class="aligncenter size-full wp-image-113" /></p>
<p>It is important to emphasize that the wkplc*.properties file in ConfigEngine are templates only, and don&#8217;t affect the running of the system, until you run a ConfigEngine task against them. Only then do their values get copied to the actual Portal server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkwrench.com/2009/06/28/db2-and-configengine-security-mechanism-not-supported/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ERRORCODE=-4214, SQLSTATE=28000 from DB2 on Ubuntu</title>
		<link>http://www.torkwrench.com/2009/05/04/errorcode-4214-sqlstate28000-from-db2-on-ubuntu/</link>
		<comments>http://www.torkwrench.com/2009/05/04/errorcode-4214-sqlstate28000-from-db2-on-ubuntu/#comments</comments>
		<pubDate>Mon, 04 May 2009 06:36:46 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[ibm]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.torkwrench.com/?p=59</guid>
		<description><![CDATA[Connection authorization failure occurred.  Reason: Local security service non-retryable error. ERRORCODE=-4214, SQLSTATE=28000 is a common error when using DB2 on newer versions of Ubuntu. This post describes how to fix this problem. <a href="http://www.torkwrench.com/2009/05/04/errorcode-4214-sqlstate28000-from-db2-on-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Two posts in one day, wow. It&#8217;s all part of our special series: how to install and configure WebSphere Portal 6.1 on Ubuntu. This isn&#8217;t a Portal only issue, rather it&#8217;s a DB2+Ubuntu issue.</p>
<p>After getting Portal installed on this Ubuntu machine, you&#8217;re probably going to want to transfer the default Derby database to something more robust like DB2. So you edit wkplc_comp.properties and wkplc_dbtype.properties, and start to run:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">./ConfigEngine.sh create-database</div></div>
<p>And you get this in the ConfigTrace.log</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; [sqlproc] action: execute-sql-scripts<br />
&nbsp; [sqlproc] _________________________________________________________<br />
&nbsp; [sqlproc] Database autocommit parameter true<br />
&nbsp; [sqlproc] No delimiter has been specified, using [;] to separate the SQL statements.<br />
&nbsp; [sqlproc] Reading file /opt/WebSphere/wp_profile/ConfigEngine/config/database/work/db2/createBufferpools.run<br />
&nbsp; [sqlproc] Could not connect to database<br />
&nbsp; [sqlproc] com.ibm.db2.jcc.b.ao: [jcc][t4][2010][11246][3.53.70] Connection authorization failure occurred. &nbsp;Reason: Local security service non-retryable error. ERRORCODE=-4214, SQLSTATE=28000<br />
BUILD FAILED</div></div>
<p>Hmm, ok, I thought db2 was working. A good habit when debugging these things is to take the piece that ConfigEngine is trying run and run it independently. So right now I want ConfigEngine to create an empty db2 database that I can run database-transfer against. Try this:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">su - db2inst1<br />
db2 create db WP610 using codeset UTF8 territory au pagesize 8192</div></div>
<p>And that comes back successfully. However, that command sequence is not an accurate representation of what ConfigEngine is actually doing. We&#8217;re running ConfigEngine as root. But the ConfigEngine script is using the &#8220;user db2inst1 using
<password>&#8221; modifiers on the end of the database create command. So how about this?</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">db2 create db WP610 using codeset UTF8 territory au pagesize 8192 user db2inst1 using password<br />
SQL30082N &nbsp;Security processing failed with reason &quot;15&quot; (&quot;PROCESSING FAILURE&quot;). <br />
SQLSTATE=08001</div></div>
<p>Ah ha, a failure. In the first example, DB2 already trusts the user that we&#8217;re logged is as (db2inst1), so it doesn&#8217;t need to go back to the operating system and authenticate it. In the second example, we are logged in as root, so db2 needs to go to the operating system and authenticate the user. Ubuntu uses the tried and true passwd + shadow file combo to store usernames and their associated passwords. The trouble is since Ubuntu 8.10, it uses the newer and more secure SHA512 hashing function to store the passwords, and DB2 doesn&#8217;t understand SHA512. So the workaround is to change the hashing function in use on the machine, reset the password and then we should be able to use the &#8220;user db2inst1 using
<password>&#8221; type commands again.</p>
<p>Open /etc/pam.d/common-password in a text editor and change this line:</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">password &nbsp; &nbsp; &nbsp; &nbsp;[success=1 default=ignore] &nbsp; &nbsp; &nbsp;pam_unix.so obscure&lt;strong&gt; sha512&lt;/strong&gt;</div></div>
<p>to</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">password &nbsp; &nbsp; &nbsp; &nbsp;[success=1 default=ignore] &nbsp; &nbsp; &nbsp;pam_unix.so obscure &lt;strong&gt;md5&lt;/strong&gt;</div></div>
<p>Then run passwd db2inst1 and put the same or a new password. If you look at the shadow file , the hash will change from something like this:<br />
SHA512</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">db2inst1:$6$IKe6x6Zq$bSajPzHNIy7jQrPXbI8CrPRlpDYUVm8.A2BhNCxes5cY6LWoh7hQr14XW4agBWbW1ywKkSSDSLFV.NXCr2/1z0:14368:0:99999:7:::</div></div>
<p>MD5</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">db2inst1:$1$FF0YDtZn$gemqCKt4Ml375mhiBXk2U/:14368:0:99999:7:::</div></div>
<p>(The unencrypted password here is &#8216;password&#8217; &#8211; don&#8217;t get too excited!) .</p>
<p>Now try running <strong>ConfigEngine.sh create-database</strong> again. It should work. Make sure you change the system /etc/pam.d/common-password back to sha512, as you want the rest of your users to use this hashing function as it is more secure than md5sum . Hopefully DB2 should address this in a fixpack.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkwrench.com/2009/05/04/errorcode-4214-sqlstate28000-from-db2-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
