<?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>Wed, 04 Jan 2012 22:33:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>DB2 Silent Install Error:  The return value is &#8220;5121&#8243;.</title>
		<link>http://www.torkwrench.com/2010/10/20/db2-silent-install-error-the-return-value-is-5121/</link>
		<comments>http://www.torkwrench.com/2010/10/20/db2-silent-install-error-the-return-value-is-5121/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 01:15:41 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[solution]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[db2setup]]></category>
		<category><![CDATA[fixpack]]></category>
		<category><![CDATA[response file]]></category>

		<guid isPermaLink="false">http://www.torkwrench.com/?p=291</guid>
		<description><![CDATA[Is db2setup having trouble creating users on your system with Db2 9.7 FP2? How to solve Return code 5121. <a href="http://www.torkwrench.com/2010/10/20/db2-silent-install-error-the-return-value-is-5121/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I hit an interesting problem with DB2 yesterday. I&#8217;m a big user of the DB2 silent install. This is a system where you run the DB2 install once manually, and it generates a response file for you. Then you can pass the response file to the installer and run unattended installs. This is great if you want to run the install hundreds of times <img src='http://www.torkwrench.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . </p>
<p>One of the great things about how DB2 releases fixpacks is that they are installable. What I mean by this is that you don&#8217;t have to install the first version of the software and apply patches to it, you can just apply the patch at the outset. </p>
<p>When testing out DB2 9.7 fixpack 2 on Linux, I hit a weird error:</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">DBI1191I &nbsp;db2setup is installing and configuring DB2 according to the<br />
&nbsp; &nbsp; &nbsp; response file provided. Please wait.<br />
<br />
<br />
A minor error occurred while installing &quot;DB2 Enterprise Server Edition &quot; on<br />
this computer. Some features may not function correctly.<br />
<br />
For more information see the DB2 installation log at &quot;/tmp/db2setup.log&quot;.</div></div>
<p>It was a bit more like a major error. The DB2 installer could not create the instance user and so could not create the instance. Which means the system is pretty much useless. The following turned up in the db2setup.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">ERROR: An error occurred while creating the user &quot;dasusr1&quot; for the DB2<br />
Administration Server. The return value is &quot;5121&quot;.<br />
<br />
ERROR: One or more errors occurred while creating the DB2 Administration<br />
Server. The DB2 Administration Server may not function properly. Create the DB2<br />
Administration Server manually. If the problem persists contact your technical<br />
service representative.<br />
<br />
Creating the DB2 Administration Server :.......Failure<br />
Initializing instance list :.......Success<br />
ERROR: One or more errors occurred while committing the changes to the user<br />
&quot;db2inst1&quot;. &nbsp;Create or make any changes to this user manually.</div></div>
<p>What was interesting was the installer would breeze through creating the groups, but baulk on creating the users. The problem turned out to be a mismatch between the algorithm used to encrypt and read back the passwords in the response file.  Something changed in the algorithm in DB2 9.7 FP2 and I was using an old response file from the GA version of the code . Both versions are incompatible with each other. You can clearly see the differences below.</p>
<p>9.7 GA, 9.7 FP1 (also works with 9.5) .</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">INSTANCE &nbsp; &nbsp; &nbsp; = inst1<br />
inst1.TYPE &nbsp; &nbsp; &nbsp; = ese<br />
* &nbsp;Instance-owning user<br />
inst1.NAME &nbsp; &nbsp; &nbsp; = db2inst1<br />
inst1.GROUP_NAME &nbsp; &nbsp; &nbsp; = db2iadm1<br />
inst1.HOME_DIRECTORY &nbsp; &nbsp; &nbsp; = /home/db2inst1<br />
inst1.PASSWORD &nbsp; &nbsp; &nbsp; = 593230133242295434315043707434799413346823001425633741538145032334202723517094195256569<br />
ENCRYPTED &nbsp; &nbsp; &nbsp; = inst1.PASSWORD</div></div>
<p>9.7 FP2</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">INSTANCE &nbsp; &nbsp; &nbsp; = inst1<br />
inst1.TYPE &nbsp; &nbsp; &nbsp; = ese<br />
* &nbsp;Instance-owning user<br />
inst1.NAME &nbsp; &nbsp; &nbsp; = db2inst1<br />
inst1.GROUP_NAME &nbsp; &nbsp; &nbsp; = db2iadm1<br />
inst1.HOME_DIRECTORY &nbsp; &nbsp; &nbsp; = /home/db2inst1<br />
inst1.PASSWORD &nbsp; &nbsp; &nbsp; = 333377148682264443740525262714481366605672981260304236138250671067315119230836024976809300232642443192164424364566092461990364794426528249626805585662932723454154505223133504126517289109622925732216931363336627325161387322413424782188354693567389513644491011426236242812854398233823216405116523748602223626725153057401514552431215907582326503484343543245585453652477658337667246270282392750290224467612813561667382216411648317659354574148559364624131307601139423363164272592837646746588233795445379795763335562194101711319501429563041430692347784922133738943433213046652867344146350193523632002344344968434509267453578515230295356956656970264132961230904523543431572425682015412550223268301328365218036730543424740299692654533629583623984282175520182920793232805290462441180635519113425850809653489466271627442347605434565555912103124813084156657044455642051333441444221049349683381306664113266463298589325748192428273032967352323550433224727201724533057720433345083348938615273614458562569435358516301810326296564555483465334307465096045451631234857628833344831302847557863641503469395590956642326285343632674204393455844314984023245416843221521387423661126412838802637787444011204021973003314770152575062831212231440453524156424162067084343531342553063362371223856227524359124365293692843255244177691321435376512151401304564523708552253510965360349256973548902836644206322692286234882874075305008643214554224269807724973657083122573975292329143605222957342981127836380521658560251613836011663326775931421125833685047046413195983740<br />
ENCRYPTED &nbsp; &nbsp; &nbsp; = inst1.PASSWORD</div></div>
<p>Obviously security has been increased in FP2 because the password hash is so much longer. Please note that it&#8217;s not forwards compatible either. What I mean by this is that the newer version of the response file will not work with older versions of the code either.</p>
<p>To conclude, the solution in this case is simple. Rerun the installer that comes with DB2 9.7 FP2 and generate a new response file for use with this version. I looked through the DB2 APARs list trying to find the fix that changed the encryption algorithm, but couldn&#8217;t see it. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkwrench.com/2010/10/20/db2-silent-install-error-the-return-value-is-5121/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross platform DB2 backup and restore</title>
		<link>http://www.torkwrench.com/2010/10/18/cross-platform-db2-backup-and-restore/</link>
		<comments>http://www.torkwrench.com/2010/10/18/cross-platform-db2-backup-and-restore/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 04:11:40 +0000</pubDate>
		<dc:creator>Graham</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[cross platform]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[db2load]]></category>
		<category><![CDATA[db2move]]></category>

		<guid isPermaLink="false">http://www.torkwrench.com/?p=280</guid>
		<description><![CDATA[A guide on how to move a DB2 database from one platform to another with special emphasis on migrating from Windows to Linux.  <a href="http://www.torkwrench.com/2010/10/18/cross-platform-db2-backup-and-restore/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>DB2 backups are platform specific. Well, pretty much, <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/topic/com.ibm.db2.udb.admin.doc/doc/c0005960.htm">it&#8217;s a bit complicated.</a> </p>
<p>Recently, someone sent me a Windows DB2 backup for me to look at, and I wanted to move it to a Linux machine. </p>
<p>Here&#8217;s some steps about how you would do this.</p>
<p>1. On the source machine 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">&nbsp;db2look -e -o database.sql -l -d &lt;database name&gt;</div></div>
<p>where <databasename> is the name of the database you want to move.</p>
<p>2. Copy the database.sql to your destination machine.</p>
<p>3. Create a database on the destination machine. You can use the same name, or use a different name and edit first connect statement in the database.sql file to point to the new name.</p>
<p>4. If you look at the database.sql, you will notice that the CREATE TABLESPACE commands will have paths in them. This will probably present a problem, since the paths are unlikely to exist on your destination machine. There are a number of ways you could deal with this, but the easiest in my opinion is to just use DB2&#8242;s automatic storage feature and let DB2 worry about it. To show you what I mean by this, here is a tablespace definition from my source database script, straight from db2look.</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">CREATE REGULAR TABLESPACE &quot;ICMLFQ32&quot; IN DATABASE PARTITION GROUP IBMDEFAULTGROUP PAGESIZE 32768 MANAGED BY SYSTEM <br />
&nbsp; &nbsp; &nbsp;USING ('C:\DB2\NODE0000\SQL00001\ICMLFQ32')<br />
&nbsp; &nbsp; &nbsp;EXTENTSIZE 32<br />
&nbsp; &nbsp; &nbsp;PREFETCHSIZE AUTOMATIC<br />
&nbsp; &nbsp; &nbsp;BUFFERPOOL ICMLSMAINBP32<br />
&nbsp; &nbsp; &nbsp;OVERHEAD 7.500000<br />
&nbsp; &nbsp; &nbsp;TRANSFERRATE 0.060000 <br />
&nbsp; &nbsp; &nbsp;DROPPED TABLE RECOVERY ON;</div></div>
<p>You can see that a Unix/Linux DB2 install would puke on the path in there. Using automatic storage command this 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">CREATE TABLESPACE ICMLFQ32 PAGESIZE 32 K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL ICMLSMAINBP32</div></div>
<p>Much simpler, but you will need to change these tablespace definitions by hand.</p>
<p>5. After fixing up the tablespace paths, try executing:</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;db2 -tvf database.sql</div></div>
<p>I had a problem on my system, doing a Windows -> Linux restore. The database.sql had Windows line endings in it, and so when running it on Linux the command just hung. Running dos2unix database.sql fixed it. (This problem was the actual point of this post, but it seemed hard to explain by itself, so&#8230;. here we are). </p>
<p>6. Now you should have a skeleton database on the destination, with all the tables there just ready to receive data. To copy the actual data, we&#8217;ll be using db2move.<br />
On the source machine, create a new folder and change into it, and then 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">db2move &lt;databasename&gt; export</div></div>
<p>7. This should fill the folder up with .ixf and .msg files . Copy the entire folder to your destination machine.</p>
<p>8. On the destination machine change to the export folder you just copied over and 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">db2move &lt;databasename&gt; load</div></div>
<p>9. db2load temporarily suspends the referential integrity constraints of DB2. This is done so it doesn&#8217;t matter which order you load tables in. But since you have suspended these checks while the data is being loaded in you will need to go and make db2 check each table, to make sure that any referential integrity constraints in the database are valid. If you don&#8217;t, you get back a message like this when accessing any tables that you have loaded:</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">SQL0668N &nbsp;Operation not allowed for reason code &quot;1&quot; on table &quot;&lt;tablename&gt;&quot;.</div></div>
<p>This means &#8211; &#8220;You need to check this table, to make sure it is valid&#8221; . </p>
<p>To do this, you can query the system catalog table to get back a list of all the tables that need checking, and with a little awk, generate a script to run against the database. There&#8217;s probably a prettier way to do this, but it works.</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 connect to &lt;databasename&gt;<br />
db2 -x select &quot;tabschema,tabname from syscat.tables where status = 'C'&quot; | awk '{print &quot;SET INTEGRITY FOR &quot;$1&quot;.&quot;$2 &quot; IMMEDIATE CHECKED;&quot;}' &gt; check.sql<br />
db2 -tvf check.sql</div></div>
<p>Now you&#8217;re done. If you run a simple select statement against one of the tables you have loaded into the database, DB2 should return with the data. It&#8217;s worth noting that this method will work if changing versions of DB2, and will also cover moving from 32 bit versions of DB2 to 64 bit. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkwrench.com/2010/10/18/cross-platform-db2-backup-and-restore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>Updated 28th October, 2010<strong><br />
Newer versions of DB2 address this problem. Read about it <a href="http://www.torkwrench.com/2010/10/28/followup-errorcode-4214-sqlstate28000-from-db2/">here</a>.</p>
<p></strong></p>
<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>7</slash:comments>
		</item>
	</channel>
</rss>

