<?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>ITworks &#187; X11</title>
	<atom:link href="http://itworks.hu/tag/x11/feed/" rel="self" type="application/rss+xml" />
	<link>http://itworks.hu</link>
	<description>Random musings in IT</description>
	<lastBuildDate>Mon, 09 Jan 2012 08:01:21 +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 Express-C 9.5 on Debian</title>
		<link>http://itworks.hu/2007/11/13/db2-express-c-95-on-debian/</link>
		<comments>http://itworks.hu/2007/11/13/db2-express-c-95-on-debian/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 19:23:23 +0000</pubDate>
		<dc:creator>csak</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://itworks.hu/?p=21</guid>
		<description><![CDATA[For our current pet project we&#8217;ve decided to use DB2 Express-C as a database back-end. The choice is made, so our junior developers could practice their art on databases that resemble enterprise databases more than MySQL or Postgres. (We have &#8230; <a href="http://itworks.hu/2007/11/13/db2-express-c-95-on-debian/">Read more <span class="meta-nav">&#187;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For our current pet project we&#8217;ve decided to use DB2 Express-C as a database back-end. The choice is made, so our junior developers could practice their art on databases that resemble enterprise databases more than MySQL or Postgres. (We have already ruled out SAPDB/MaxDB on previous occasions.)</p>
<p><span id="more-21"></span><br />
First off the system I&#8217;m trying to install the server is remotely located, and doesn&#8217;t have any kind of X on it. This rules out all kind of graphical installs, but I never was fond of those anyway.</p>
<p>The system is running a Debian testing, with pretty strict firewall rules.</p>
<p>The install went easy, but with a few glitches. First off I&#8217;ve downloaded the installer from <a href="http://www-306.ibm.com/software/data/db2/express/download.html" target="_blank">IBM</a>. This required my PartnerWorld password, so I guess it&#8217;s not as easy to get as it seems. Then I&#8217;ve unpacked the installer and went on to install as root (this is usual for most installs, but almost mandatory for IBM products) This turned out to be a mistake later, as Express-C is different from other enterprise DB2-s. It&#8217;s preferred to be installed as a DB user, unless you want to run several instances on a given machine (not common for a single-shot pet-project).</p>
<p>The install went on fine with the console mode, and as a nice feature, even the text-mode installer shows a time estimate for each step.</p>
<p>After installing the application several times,  I went to read some documentation, as I couldn&#8217;t find any of the tools I was used to on DB2 EE 8.2. The IBM Infocenter is always a good idea to look up such informations, see the one I looked at <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp" target="_blank">here</a>.</p>
<p>Unfortunately all manuals described the startup  as a simple process, all starting with the usual loading of DB2 profile, and then starting up the db with the db2start command. Unfortunately it always threw an error message, which <a href="http://www.thescripts.com/forum/thread569412.html">turned out</a> to be a problem with the default shared memory size. The simple solution is to add the lines:<br />
<code><br />
kernel.msgmni = 1024<br />
kernel.shmmax = 268435456<br />
</code></p>
<p>to the /etc/sysctl.conf file and then applying the changes with the</p>
<p><code>sysctl -p</code></p>
<p>command.</p>
<p>The db then started up fine, but as it turned out I should not be running the non-root installation, as that only permits local &#8220;APP&#8221; level connections.</p>
<p>So I&#8217;ve created the system users dasadm, db2inst for later use.</p>
<p><code>mkdir /data/db2<br />
adduser --system dasadm --home /data/db2/dasadm<br />
touch </code><code>/data/db2/dasadm/.profile<br />
chown dasadm.nogroup </code><code>/data/db2/dasadm/.profile</code><br />
<code>adduser --system db2inst --home /data/db2/db2inst<br />
</code><code>touch </code><code>/data/db2/</code><code>db2inst</code><code>/.profile<br />
chown </code><code>db2inst</code><code>.nogroup </code><code>/data/db2/</code><code>db2inst</code><code>/.profile</code></p>
<p>Then the entire DB was reinstalled using the root user.</p>
<h4>Creating an admin server</h4>
<p>The admin server is used to monitor, and manage your DB2 instances on a system. To create and start service, issue the commands:</p>
<p><code>chsh dasadm -s/bin/sh<br />
DB2_HOME/instance/dascrt dasadm<br />
</code></p>
<p>There seems to be some error on the current version of DB2, the admin server keeps sending messages like:<br />
<code>The state of instance 'dasadm' gcf module '/opt/ibm/db2/V9.5/das/lib/libdb2dasgcf.so.1' is OPERABLE (OFFLINE).</code><br />
I could not yet locate the actual reason, but to disable this message it&#8217;s great to turn the db2fmd off. That can be achieved by commenting out the respectable lines in the inittab, and then reloading the inittab with:</p>
<p><code>init q</code></p>
<p>I&#8217;ll keep this off until I find some way to work around the current problem.</p>
<h4>Creating a db instance</h4>
<p>The DB2 instance was created and started using the following commands, as root:<br />
<code>DB2_HOME/instance/db2icrt -u db2inst db2inst<br />
</code><code>DB2_HOME/instance/db2istrt -u db2inst db2inst</code><code><br />
</code></p>
<p><code></code>command. When using the command one must make sure the provided ID actually <strong>HAS A SHELL</strong>! Of course it took me quite a while to find that out.</p>
<h4>Getting the  Control Center to work</h4>
<p>First off I thought it would be a good idea to just forward the DB2CC X11 output to my computer.</p>
<p>To get X forwarding on the server I tried doing what I read <a href="http://forums.vpslink.com/archive/index.php/t-1627.html" target="_blank">here</a>. After installing the xauth package I was able to forward my favorite X application (xteddy) through to my desktop. There still seems to be a problem, that the window content is not forwarded, even thought the bear shaped window appears. However when I switch over to another user (root and then to db2inst) it simply fails to forward the X. It turned out that the  xauth must be copied over to the user that is to be authorized using a command like:<br />
<code><br />
xauth -f /home/MYUSER/.Xauthority extract /root/.Xauthority :0<br />
</code></p>
<p>I could not however use this, to extract the xauth from my user directly to the db2inst user.</p>
<p>Cutting the crap, I&#8217;ve got fed up with the xauth, so I just thrown in a shell for the db2inst user, and authorized my user to log-in remotely. Then X11 forwarding worked straight away, and I was able to forward the db2cc without any problem. It&#8217;s quite slow, but what the heck?</p>
<p>The speed problem can be helped a bit by adding a -C (compress) parameter to the ssh. It speeds the connection up almost to the level of running it on the local network through my ADSL connection.</p>
<p><strong>Summarizing</strong></p>
<p>After wasting hours on trying to set things up I got some problem starting up the administrator instance, being unable to trace it down to the root of the problem, I uninstalled the entire installation, wiped the install directory and started up the install in graphical mode as root with copying the X authorization as described above.</p>
<p>The installer was running for about 5 minutes, and created and configured the  basic DB instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://itworks.hu/2007/11/13/db2-express-c-95-on-debian/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

