<?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>Zen and the Art of Programming &#187; DB2</title>
	<atom:link href="http://programmingzen.com/category/db2/feed/" rel="self" type="application/rss+xml" />
	<link>http://programmingzen.com</link>
	<description>Meditations on programming, startups, and technology</description>
	<lastBuildDate>Wed, 09 May 2012 07:52:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>New Release of the Ruby Driver and Rails Adapter for DB2</title>
		<link>http://programmingzen.com/2012/05/09/new-release-of-the-ruby-driver-and-rails-adapter-for-db2/</link>
		<comments>http://programmingzen.com/2012/05/09/new-release-of-the-ruby-driver-and-rails-adapter-for-db2/#comments</comments>
		<pubDate>Wed, 09 May 2012 07:45:23 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1466</guid>
		<description><![CDATA[The API team at IBM recently released a new update for the ibm_db gem, which includes both the Ruby driver and the Rails adapter for DB2 (and Informix). This coincides with the release of the latest major upgrade to DB2 LUW (Linux/Unix/Windows), which is now up to version 10.1. ibm_db 2.5.10 adds support for Rails [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2009/09/03/installing-the-ruby-driver-for-db2-on-mac-os-x-snow-leopard/' rel='bookmark' title='Installing the Ruby driver for DB2 on Mac OS X Snow Leopard'>Installing the Ruby driver for DB2 on Mac OS X Snow Leopard</a></li>
<li><a href='http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/' rel='bookmark' title='Installing Ruby on Rails and DB2 on Ubuntu 11.04'>Installing Ruby on Rails and DB2 on Ubuntu 11.04</a></li>
<li><a href='http://programmingzen.com/2010/01/21/db2-support-for-rubyrails-turns-2-0/' rel='bookmark' title='DB2 support for Ruby/Rails turns 2.0'>DB2 support for Ruby/Rails turns 2.0</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The API team at IBM recently released a new update for the <a href="http://rubygems.org/gems/ibm_db">ibm_db gem</a>, which includes both the Ruby driver and the Rails adapter for <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2</a> (and Informix). This coincides with the release of the latest major upgrade to DB2 LUW (Linux/Unix/Windows), which is now up to version 10.1.</p>
<p>ibm_db 2.5.10 adds support for Rails 3.2 and fixes a few minor bugs that have been reported by the community. New features such as Time Travel Queries are supported seamlessly.</p>
<p>The biggest news is the simplified installation process. You now only need to set the DB2&#8242;s instance user home, and the gem installation process will take care of determining both which architecture (e.g., 32 vs 64 bit) and libraries to use.</p>
<p>All it really takes now to install ibm_db on a Linux/Unix/Mac box is something along the lines of:</p>
<pre class="highlight">$ sudo -s
$ export IBM_DB_HOME=/home/db2inst1/sqllib
$ gem install ibm_db</pre>
<p>Windows users don&#8217;t even have to worry about setting up the home directory. It will work both on Windows 32 and 64 bit systems, but unlike with *nix systems, Ruby and ibm_db will run in 32 bit mode only.</p>
<p>To try out DB2 with Ruby/Rails, I recommend you download and install <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C</a> for free.</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2009/09/03/installing-the-ruby-driver-for-db2-on-mac-os-x-snow-leopard/' rel='bookmark' title='Installing the Ruby driver for DB2 on Mac OS X Snow Leopard'>Installing the Ruby driver for DB2 on Mac OS X Snow Leopard</a></li>
<li><a href='http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/' rel='bookmark' title='Installing Ruby on Rails and DB2 on Ubuntu 11.04'>Installing Ruby on Rails and DB2 on Ubuntu 11.04</a></li>
<li><a href='http://programmingzen.com/2010/01/21/db2-support-for-rubyrails-turns-2-0/' rel='bookmark' title='DB2 support for Ruby/Rails turns 2.0'>DB2 support for Ruby/Rails turns 2.0</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2012/05/09/new-release-of-the-ruby-driver-and-rails-adapter-for-db2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DB2 Express-C 10 is now out</title>
		<link>http://programmingzen.com/2012/05/02/db2-express-c-10-is-now-out/</link>
		<comments>http://programmingzen.com/2012/05/02/db2-express-c-10-is-now-out/#comments</comments>
		<pubDate>Wed, 02 May 2012 16:31:59 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Industry News]]></category>
		<category><![CDATA[IT Business]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1461</guid>
		<description><![CDATA[IBM has just released version 10.1 of DB2 Express-C for Linux, Unix, and Windows. This is a major upgrade that boasts a number of additions and improvements. The already excellent performance has been improved further (including XML performance), and the free edition now takes advantage of up to 4 GB of RAM (but you can [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2011/11/21/download-db2-express-c-9-7-5/' rel='bookmark' title='Download DB2 Express-C 9.7.5'>Download DB2 Express-C 9.7.5</a></li>
<li><a href='http://programmingzen.com/2011/05/09/download-db2-express-c-9-7-4/' rel='bookmark' title='Download DB2 Express-C 9.7.4'>Download DB2 Express-C 9.7.4</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>IBM has just released version 10.1 of <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C</a> for Linux, Unix, and Windows. This is a major upgrade that boasts a number of additions and improvements.</p>
<p>The already excellent performance has been improved further (including XML performance), and the free edition now takes advantage of up to 4 GB of RAM (but you can have as much RAM on the server as you wish). As usual, there are no limits on database size, number of users, etc — unlike other free versions of commercial databases that are offered by Microsoft and Oracle.</p>
<div align="center">
<table style="text-align: left; width: 620px;" border="2" cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td style="font-weight: bold; background-color: #ffff00;">FEATURE</td>
<td style="font-weight: bold; text-align: center; background-color: #ffff00;">DB2 Express-C 10.1</td>
<td style="font-weight: bold; text-align: center; background-color: #ffff00;">SQL Server 2012 Express</td>
<td style="font-weight: bold; text-align: center; background-color: #ffff00;">Oracle 11g Express Edition</td>
</tr>
<tr>
<td><span style="font-weight: bold;">Max CPUs</span></td>
<td style="text-align: center;">1 (Up to 2 Cores)</td>
<td style="background-color: #33cc00; text-align: center;"><strong>1 (Up to 4 Cores)<strong></strong></strong></td>
<td style="text-align: center;">1</td>
</tr>
<tr>
<td><span style="font-weight: bold;">Max RAM</span></td>
<td style="background-color: #33cc00; text-align: center;"><strong>4 GB</strong></td>
<td style="text-align: center;">1 GB</td>
<td style="text-align: center;">1 GB</td>
</tr>
<tr>
<td><span style="font-weight: bold;">Max DB Size</span></td>
<td style="background-color: #33cc00; text-align: center;"><strong>Unlimited</strong></td>
<td style="text-align: center;">10 GB</td>
<td style="text-align: center;">11 GB</td>
</tr>
<tr>
<td><span style="font-weight: bold;">32/64 bit</span></td>
<td style="background-color: #33cc00; text-align: center;"><strong>32/64 bit</strong></td>
<td style="background-color: #33cc00; text-align: center;"><strong>32/64 bit</strong></td>
<td style="text-align: center;">32 bit</td>
</tr>
<tr>
<td><span style="font-weight: bold;">Supported OS</span></td>
<td style="background-color: #33cc00; text-align: center;"><strong>Windows/Linux/Unix &amp; Mac*</strong></td>
<td style="text-align: center;">Windows only</td>
<td style="text-align: center;">Windows/Linux only</td>
</tr>
</tbody>
</table>
</div>
<p>By buying a completely <a href="http://www-01.ibm.com/software/data/db2/express/support.html">optional subscription for $2,150 a year</a>, DB2 Express-C FTL (Fixed Term License) will use up to 8 GB of memory, 4 cores (as opposed to the 2 cores used by the free edition), adds 24/7 support, and a bunch of high-end features such as HADR (High-Availability and Disaster Recovery), row, column, and label access control, etcetera.</p>
<p>Among the numerous new features present within the free edition, you&#8217;ll find:</p>
<ul>
<li>Support for historical reporting through Time Travel Query. In a nutshell, this cool new feature allows you to query the database at the state it was in at a given time or within a given period in the past.</li>
<li>Compatibility with Oracle is now up to 98%, which means that you can easily switch most applications without running into any headaches.</li>
<li>Support for SPARQL and RDF has also been baked in, allowing DB2 to act as a NoSQL storage solution.</li>
<li>Control Center has been discontinued in favor of the much more powerful IBM Data Studio.</li>
</ul>
<p>You can read a detailed list of what&#8217;s new in <a href="http://www.ibm.com/developerworks/data/library/techarticle/dm-1204db2expressc/index.html">Leon Katsnelson&#8217;s article</a> on developerWorks.</p>
<p>Before you ask, no DB2 Express-C 10.1 is not currently available for Mac OS X. (That&#8217;s why you see an * in the table above.) However, Mac users who reported issues with Lion, will be happy to know that a recent version aimed at addressing such issues has been released as well. It&#8217;s still DB2 Express-C 9.5.2, but it&#8217;s an out-of-beta release that should make things much smoother.</p>
<p>If you&#8217;d like to learn more about DB2, I invite you to check out the courses available for free on <a href="http://bigdatauniversity.com/courses/">Big Data University</a>.</p>
<p><a href="http://db2express.com/download/?S_TACT=ACDB201">Download DB2 Express-C</a> for your OS now and give it a shot. Alternatively or in addition, you can also try DB2 Express-C<a href="http://www.c3octeam.com/2012/05/getting-started-with-db2-express-c-101.html"> in the cloud through RightScale</a>.</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2011/11/21/download-db2-express-c-9-7-5/' rel='bookmark' title='Download DB2 Express-C 9.7.5'>Download DB2 Express-C 9.7.5</a></li>
<li><a href='http://programmingzen.com/2011/05/09/download-db2-express-c-9-7-4/' rel='bookmark' title='Download DB2 Express-C 9.7.4'>Download DB2 Express-C 9.7.4</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2012/05/02/db2-express-c-10-is-now-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download DB2 Express-C 9.7.5</title>
		<link>http://programmingzen.com/2011/11/21/download-db2-express-c-9-7-5/</link>
		<comments>http://programmingzen.com/2011/11/21/download-db2-express-c-9-7-5/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 20:56:56 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[IT Business]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1433</guid>
		<description><![CDATA[IBM recently released a new edition of DB2 Express-C, the free edition of their powerful commercial database. You can grab DB2 Express-C 9.7.5 for Linux, Unix, and Windows here. This new version includes support for Oracle compatibility (which was previously only available for commercial editions), and a few other features, including an enhanced db shell [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2011/05/09/download-db2-express-c-9-7-4/' rel='bookmark' title='Download DB2 Express-C 9.7.4'>Download DB2 Express-C 9.7.4</a></li>
<li><a href='http://programmingzen.com/2007/10/31/db2-express-c-95-is-available-for-download/' rel='bookmark' title='DB2 Express-C 9.5 is available for download'>DB2 Express-C 9.5 is available for download</a></li>
<li><a href='http://programmingzen.com/2010/06/01/ibm-releases-db2-express-c-9-7-2/' rel='bookmark' title='IBM releases DB2 Express-C 9.7.2'>IBM releases DB2 Express-C 9.7.2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-1434" title="Download DB2 Express-C 9.7.5" src="http://programmingzen.com/wp-content/uploads/2011/11/download-db2-express-c.png" alt="Download DB2 Express-C 9.7.5" width="600" height="148" />IBM recently released a new edition of DB2 Express-C, the free edition of their powerful commercial database. You can grab <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C 9.7.5</a> for Linux, Unix, and Windows <a href="http://db2express.com/download/?S_TACT=ACDB201">here</a>.</p>
<p>This new version includes support for Oracle compatibility (which was previously only available for commercial editions), and a few other features, including an enhanced db shell known as CLP+.</p>
<p>If you downloaded DB2 in the past, take this new edition for a spin and let us know what you think. If you haven&#8217;t, now would be a great time to try out DB2 Express-C in its enhanced incarnation.</p>
<p>It&#8217;s entirely free of charge and there are no limits on the amount of data you can store in development, testing, or production.</p>
<p>In a future post I will also explain why, contrary to what some may believe, it&#8217;s an excellent choice for startups that are looking for a solution that goes beyond the relational paradigm.</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2011/05/09/download-db2-express-c-9-7-4/' rel='bookmark' title='Download DB2 Express-C 9.7.4'>Download DB2 Express-C 9.7.4</a></li>
<li><a href='http://programmingzen.com/2007/10/31/db2-express-c-95-is-available-for-download/' rel='bookmark' title='DB2 Express-C 9.5 is available for download'>DB2 Express-C 9.5 is available for download</a></li>
<li><a href='http://programmingzen.com/2010/06/01/ibm-releases-db2-express-c-9-7-2/' rel='bookmark' title='IBM releases DB2 Express-C 9.7.2'>IBM releases DB2 Express-C 9.7.2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/11/21/download-db2-express-c-9-7-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speeding up queries by a factor of 100 or more with DB2 Text Search</title>
		<link>http://programmingzen.com/2011/07/19/getting-started-with-db2-text-search/</link>
		<comments>http://programmingzen.com/2011/07/19/getting-started-with-db2-text-search/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 17:11:42 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1397</guid>
		<description><![CDATA[During a recent Rails project at IBM we had to deal with a large table consisting of customers. The table is made up of legacy enterprise data, and contains close to a million records. Among many other fields, the table Customers includes a column name defined as VARCHAR. name is used to store company names. [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>
	During a recent Rails project at IBM we had to deal with a large table consisting of customers. The table is made up of legacy enterprise data, and contains close to a million records.
</p>
<p>
	Among many other fields, the table <code>Customers</code> includes a column <code>name</code> defined as <code>VARCHAR</code>. <code>name</code> is used to store company names.
</p>
<p>
	One of the requirements for the project was to implement a Google Suggest-like feature. That is, when the user enters a few characters for the customer&#8217;s name, they should be prompted, via AJAX, with a list of possible suggestions containing that string (or at least beginning with that string.)
</p>
<p>
	The naive approach would be to use a simple <code>LIKE</code> predicate, to generate queries such as:
</p>
<div class="highlight">
<pre><span class="k">SELECT</span> <span class="n">name</span>
<span class="k">FROM</span>   <span class="n">Customers</span>
<span class="k">WHERE</span>  <span class="n">name</span> <span class="k">LIKE</span> <span class="s1">&#39;%micro%&#39;</span>
<span class="k">ORDER</span>  <span class="k">BY</span> <span class="n">name</span>
</pre>
</div>
<p>
	One of the main problems with this approach is performance. Using <code>LIKE</code> this way doesn&#8217;t allow us to take advantage of indexes that are defined on the column <code>name</code>.
</p>
<p>
	Unsurprisingly, on a modest server, such a query takes about 25 seconds. A UI that isn&#8217;t able to respond for 25 seconds will feel like an eternity for the end user, of course, so a simple query like this obviously cannot be seen as a viable solution.
</p>
<p>
	Enter DB2 Text Search. You may be familiar with other full text search engines such as Ferret, Lucene, or Sphinx. <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 V9.7.4</a> ships with an extremely powerful full text search engine that has plenty of useful features, including excellent integration with native XML columns.
</p>
<p>
	Using the <a href="http://db2express.com/download/?S_TACT=ACDB201">free edition of DB2</a> (DB2 Express-C) which includes Text Search, we were able to implement the autocomplete functionality we were after in a heartbeat, thanks to a query like the following:
</p>
<div class="highlight">
<pre><span class="k">SELECT</span> <span class="n">name</span>
<span class="k">FROM</span>   <span class="n">Customers</span>
<span class="k">WHERE</span>  <span class="k">CONTAINS</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="s1">&#39;micro&#39;</span><span class="p">)</span> <span class="o">=</span> <span class="mi">1</span>
<span class="k">ORDER</span>  <span class="k">BY</span> <span class="n">name</span>
</pre>
</div>
<p>
	This query was executed in mere fractions of a second for most searches, and behaved exactly as needed. In fact, not only did we match strings that began with the searched token, but also ones that contained it elsewhere (e.g., <code>micro</code> would match both <code>Microsoft</code> and <code>Sun Microsystems</code>.) The results where ordered alphabetically, but could have easily been ordered by relevance via the <code>SCORE</code> function, also available via DB2 Text Search.
</p>
<p>
	As usual, it&#8217;s a matter of using the right tool for the right job, and DB2 Text Search was created exactly for these kind of scenarios.</p>
<p>
	Let&#8217;s briefly look at how you can also go about setting up and playing with it on Linux.
</p>
<h3>Installing DB2 Text Search</h3>
<p>
	To start with, you&#8217;ll need to have a 64bit Linux distro, and then follow these simple steps.
</p>
<p>
	Download <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C</a>. Make sure you grab the <code>db2exc_974_LNX_x86_64.tar.gz</code> file and not the Light edition.
</p>
<p>
	Next, install DB2 by following <a href="http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/">these steps</a> (the <em>Installing DB2</em> section in particular.) Make sure you select a custom installation, and that you select everything including DB2 Text Search (which is not checked by default).
</p>
<p>
	After you&#8217;ve started DB2 with <code>db2start</code> via the instance user (e.g., <code>db2inst1</code>,) launch the text search server by running:
</p>
<pre class="highlight">
db2ts start for text
</pre>
<p>
	To enable text search for an existing database, run:
</p>
<pre class="highlight">
db2ts enable database for text connect to mydb
</pre>
<p>
	Next, you&#8217;ll need to create a text search index and populate it. For example:
</p>
<pre class="highlight">
db2ts "create index customer_name for text on customers(name) connect to mydb"
db2ts "update index customer_name for text connect to mydb"
</pre>
<p>
	That&#8217;s it. From now on you&#8217;ll be able to use functions such as <code>CONTAINS</code> to quickly search for your data.
</p>
<p>
	Such a function can also be easily invoked in Rails:
</p>
<div class="highlight">
<pre><span class="no">Customer</span><span class="o">.</span><span class="n">where</span><span class="p">(</span><span class="s2">&quot;CONTAINS(name, ?) = 1&quot;</span><span class="p">,</span> <span class="nb">name</span><span class="p">)</span>
</pre>
</div>
<p>
	Or wrapping it a little in a model:
</p>
<div class="highlight">
<pre><span class="k">class</span> <span class="nc">Customer</span> <span class="o">&lt;</span> <span class="no">ActiveRecord</span><span class="o">::</span><span class="no">Base</span>
  <span class="c1"># ... </span>
  <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">search</span><span class="p">(</span><span class="nb">name</span><span class="p">,</span> <span class="n">max_res</span> <span class="o">=</span> <span class="mi">10</span><span class="p">)</span>
    <span class="n">where</span><span class="p">(</span><span class="s1">&#39;CONTAINS(name, ?) = 1&#39;</span><span class="p">,</span> <span class="nb">name</span><span class="p">)</span><span class="o">.</span>
    <span class="n">order</span><span class="p">(</span><span class="s1">'name'</span><span class="p">)</span><span class="o">.</span>
    <span class="n">limit</span><span class="p">(</span><span class="n">max_res</span><span class="p">)</span>
  <span class="k">end</span>
<span class="k">end</span>
</pre>
</div>
<p>
Which can then be invoked as follows:
</p>
<div class="highlight">
<pre>
<span class="no">Customer</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="s2">&quot;micro&quot;</span><span class="p">)</span>
</pre>
</div>
<p>
	(Technically we wouldn&#8217;t have needed <code>limit</code>, so long as we passed <code>RESULTLIMIT</code> to the <code>CONTAINS</code> function.)
</p>
<p>
	You can read more about <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=/com.ibm.db2.luw.admin.ts.doc/doc/c0051296.html">DB2 Text Search</a> at the Information Center.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/07/19/getting-started-with-db2-text-search/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IBM is Looking for a University Student with PHP skills in Toronto</title>
		<link>http://programmingzen.com/2011/06/08/ibm-is-looking-for-a-university-student-with-php-skills-in-toronto/</link>
		<comments>http://programmingzen.com/2011/06/08/ibm-is-looking-for-a-university-student-with-php-skills-in-toronto/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 23:18:47 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[IT Business]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1386</guid>
		<description><![CDATA[My team is looking for a student for a paid internship, which will last for up to 18 months. The candidate should be legally permitted to work in Canada, as the location for this internship will be the IBM Toronto Software Lab in Markham, Ontario. PHP is a required skill for this position. If you [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>My team is looking for a student for a paid internship, which will last for up to 18 months. The candidate should be legally permitted to work in Canada, as the location for this internship will be the IBM Toronto Software Lab in Markham, Ontario.</p>
<p>PHP is a required skill for this position. If you have experience with cloud computing (Amazon EC2), relational databases, open source contribution, and/or Moodle, that would be great. Part of your internship responsibilities will involve contributing to open source projects.</p>
<p>If you are interested, please get in touch by email at: <strong>Y2FuZ2lhbm9AY2EuaWJtLmNvbQ==</strong> (Base 64 encoded.)</p>
<p align="center" style="margin-top: 20px;"><a href="http://www.flickr.com/photos/christopherlord/514316263/"><img src="http://programmingzen.com/wp-content/uploads/2011/06/torolab.png" alt="IBM Toronto Software Lab" title="IBM Toronto Software Lab" width="633" height="386" class="alignright size-full wp-image-1387" /></a><small>Image used with the permission of <a href="http://www.flickr.com/photos/christopherlord/514316263/">Christopher Lord</a>.</small></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/06/08/ibm-is-looking-for-a-university-student-with-php-skills-in-toronto/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing Python, Django, and DB2 on Ubuntu 11.04</title>
		<link>http://programmingzen.com/2011/05/12/installing-python-django-and-db2-on-ubuntu-11-04/</link>
		<comments>http://programmingzen.com/2011/05/12/installing-python-django-and-db2-on-ubuntu-11-04/#comments</comments>
		<pubDate>Fri, 13 May 2011 09:06:58 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1375</guid>
		<description><![CDATA[Note: This is the Python version of the Ruby guide I just published. In this brief tutorial I’ll show you how to create a complete Python and Django setup for DB2 on Ubuntu. By following my step-by-step instructions, you’ll be able to install the following components: Python easy_install Django DB2 Express-C 9.7.4 The official Python [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p><em>Note: This is the Python version of the <a href="http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/">Ruby guide</a> I just published.</em></p>
<p>In this brief tutorial I’ll show you how to create a complete Python and Django setup for DB2 on Ubuntu. By following my step-by-step instructions, you’ll be able to install the following components:</p>
<ul>
<li>Python</li>
<li>easy_install</li>
<li>Django</li>
<li><a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C 9.7.4</a></li>
<li>The official <a href="http://code.google.com/p/ibm-db/">Python driver, dbi module, and Django adapter</a> for DB2</li>
</ul>
<h3 id="installing_python_and_easy_install">Installing Python and easy_install</h3>
<p>Technically Python is already installed on Ubuntu, so we don’t have to install it. However, we need the <code>python-dev</code> package in order to build the DB2 driver from source. We’ll also need easy_install which is included in the <code>python-setuptools</code> Ubuntu .deb:</p>
<pre class="highlight">$ sudo apt-get install python-dev python-setuptools</pre>
<p></p>
<h3 id="installing_django">Installing Django</h3>
<p>Now that we have easy_install available, we can easily install Django by running:</p>
<pre class="highlight">$ sudo easy_install django</pre>
<p>You can verify the installed version by running:</p>
<pre class="highlight">$ python</pre>
<p>And then executing the following snippet in the REPL:</p>
<pre class="highlight">>>> import django
>>> django.VERSION
(1, 3, 0, 'final', 0)</pre>
<p>At this time, version 1.3.0 should get installed as shown above.</p>
<h3 id="installing_db2">Installing DB2</h3>
<p>We can now download and install DB2 Express-C 9.7.4. <a href="http://db2express.com/download/?S_TACT=ACDB201">Download the .tar.gz file</a> to a location that’s convenient for you. Then proceed to unpack it:</p>
<pre class="highlight">$ cd ~/Downloads/
$ tar xvfz db2exc_974_LNX_x86.tar.gz
$ cd expc</pre>
<p>We’ll install one required library and then proceed with the setup:</p>
<pre class="highlight">$ sudo apt-get install libaio1
$ sudo ./db2setup</pre>
<p>Follow the GUI wizard on screen to continue with the installation. Pay close attention to two steps:</p>
<ul>
<li>When prompted <strong>select a custom installation</strong>, and when choosing the components, select all of them. We’ll need the <strong>Application Development Tools</strong> in order to build the Python driver later on (and these are unchecked by default).</li>
<li>When asked if you’d like to <strong>create an instance user</strong>, go with that option. It greatly simplifies the setup process.</li>
</ul>
<p>When the setup of DB2 is completed, you should receive a confirmation message informing you about the successful installation</p>
<p>For good measure, add the following line to your <code>~/.bashrc</code> file:</p>
<pre class="highlight">. /home/db2inst1/sqllib/db2profile</pre>
<p>This ensures that even your regular, non-DB2, user will be able to connect and interact with the database.</p>
<h3>Installing the Python driver and Django adapter</h3>
<p>The last step we need to take is to install the <code>ibm_db</code> Python driver and the <code>ibm_db_dbi</code> module, as well as the Django adapter for DB2. These are all IBM supported, open source releases.</p>
<p>Open a new shell and run:</p>
<pre class="highlight">$ sudo -s
$ export IBM_DB_DIR=/home/db2inst1/sqllib
$ export IBM_DB_LIB=/home/db2inst1/sqllib/lib
$ . /home/db2inst1/sqllib/db2profile
$ easy_install ibm_db ibm_db_django
$ exit</pre>
<h3 id="a_quick_sanity_test">A quick sanity test</h3>
<p>To ensure that all is well with your setup, run the following command:</p>
<pre class="highlight">$ django-admin.py startproject db2test
$ cd db2test</pre>
<p>Now edit <code>settings.py</code> so ENGINE is set to <code>ibm_db_django</code>, NAME to a database like <code>db2test</code>, USER to <code>db2inst1</code>, PASSWORD to the same password you specified for the db2inst1 user during the installation of DB2. Use <code>localhost</code> for the HOST, and <code>50000</code> as the port number:</p>
<pre class="highlight">DATABASES = {
    'default': {
        'ENGINE': 'ibm_db_django',
        'NAME': 'db2test',
        'USER': 'db2inst1',
        'PASSWORD': 'secret',
        'HOST': 'localhost',
        'PORT': '50000',
    }
}</pre>
<p>Create the database <code>db2test</code> by running:</p>
<pre class="highlight">$ su - db2inst1
$ db2start
$ db2 create db db2test
$ exit</pre>
<p>Depending on your hardware specs, the infrequent operation of creating a database can take a bit of time (e.g., several minutes).</p>
<p>We will now run the actual test:</p>
<pre class="highlight">$ python manage.py test</pre>
<p>Unless exceptions are raised during this last step, you should be all set to use Django with DB2.</p>
<h3 id="if_you_need_help">If you need help</h3>
<p>IBM is the only database vendor to officially provide and support its Python driver and Django adapter. While commercial DB2 support is available and relatively <a href="http://www.db2teamblog.com/2010/12/treat-yourself-to-db2-this-holiday.html">inexpensive</a>, your first line of defense is posing your questions in the <a href="http://groups.google.com/group/ibm_db?pli=1">support forum</a> over at Google. Alternatively, if the question is DB2-specific and not related to Python/Django, you can use the <a href="http://www.ibm.com/developerworks/forums/forum.jspa?forumID=805">DB2 Express-C forum</a> over at developerWorks instead.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/05/12/installing-python-django-and-db2-on-ubuntu-11-04/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing Ruby on Rails and DB2 on Ubuntu 11.04</title>
		<link>http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/</link>
		<comments>http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/#comments</comments>
		<pubDate>Wed, 11 May 2011 21:10:56 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1372</guid>
		<description><![CDATA[In this tutorial I&#8217;ll show you how to create a complete Ruby on Rails setup for DB2 on Ubuntu. Following my step-by-step instructions, you&#8217;ll be able to install the following components: Ruby 1.8.7 Rubygems Ruby on Rails DB2 Express-C 9.7.4 The official Ruby driver and Rails adapter for DB2 Installing Ruby We are going to [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2007/11/11/installing-db2-95-on-ubuntu-710/' rel='bookmark' title='Installing DB2 9.5 on Ubuntu 7.10'>Installing DB2 9.5 on Ubuntu 7.10</a></li>
<li><a href='http://programmingzen.com/2007/12/26/installing-django-with-postgresql-on-ubuntu/' rel='bookmark' title='Installing Django with PostgreSQL on Ubuntu'>Installing Django with PostgreSQL on Ubuntu</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I&#8217;ll show you how to create a complete Ruby on Rails setup for DB2 on Ubuntu. Following my step-by-step instructions, you&#8217;ll be able to install the following components:</p>
<ul>
<li>Ruby 1.8.7</li>
<li>Rubygems</li>
<li>Ruby on Rails</li>
<li><a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C 9.7.4</a></li>
<li><a href="https://rubyforge.org/projects/rubyibm/">The official Ruby driver and Rails adapter for DB2</a></li>
</ul>
<h3 id="installing_ruby">Installing Ruby</h3>
<p>We are going to install Ruby 1.8.7 using the Debian packages that are available in the default repositories:</p>
<pre class="highlight">$ sudo apt-get install ruby-full</pre>
<p>Next we&#8217;ll build Rubygems from scratch, so as to obtain a recent version and be able to update it to the latest one via the gem system itself:</p>
<pre class="highlight">$ cd /tmp/
$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
$ tar xvfz rubygems-1.7.2.tgz
$ cd rubygems-1.7.2
$ sudo ruby setup.rb
$ sudo gem update --system</pre>
<p>You can now verify that Rubygems is correctly installed:</p>
<pre class="highlight">$ gem -v
1.8.1</pre>
<p>Note: If you plan to have multiple versions of Ruby, you&#8217;ll probably want to look into RVM.</p>
<h3 id="installing_rails">Installing Rails</h3>
<p>We are not going to install the Rails package that ships with Ubuntu, because this is also quite obsolete at this stage. Instead, we&#8217;ll use the newly installed gem command:</p>
<pre class="highlight">$ sudo gem install rails</pre>
<p>(Add the <code>--no-rdoc --no-ri</code> flags if you don&#8217;t care about the local documentation. This will speed up the installation process.)</p>
<p>You can verify the installed version by running:</p>
<pre class="highlight">$ rails -v
Rails 3.0.7</pre>
<p></p>
<h3 id="installing_db2">Installing DB2</h3>
<p>We can now download and install <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C 9.7.4</a>. <a href="http://db2express.com/download/?S_TACT=ACDB201">Download the .tar.gz installation file</a> to a location that&#8217;s convenient for you. Then proceed to unpack it:</p>
<pre class="highlight">$ cd ~/Downloads/
$ tar xvfz db2exc_974_LNX_x86.tar.gz
$ cd expc</pre>
<p>We&#8217;ll install one required library and then proceed with the setup:</p>
<pre class="highlight">$ sudo apt-get install libaio1
$ sudo ./db2setup</pre>
<p>Follow the GUI wizard on screen to continue with the installation. Pay close attention to two steps:</p>
<ul>
<li>When prompted <strong>select a custom installation</strong>, and when choosing the components, select all of them We&#8217;ll need the <strong>Application Development Tools</strong> in order to build the Ruby driver later on. (And these are unchecked by default.)</li>
<li>When asked if you&#8217;d like to <strong>create an instance user</strong>, go with that option. It greatly simplifies the setup process.</li>
</ul>
<p>When the setup of DB2 is completed, you should receive a confirmation message informing you about the successful installation.</p>
<p>For good measure, add the following line to your <code>~/.bashrc</code> file:</p>
<pre class="highlight">. /home/db2inst1/sqllib/db2profile</pre>
<p>This ensures that even your regular, non-DB2, user will be able to connect and interact with the database.</p>
<h3 id="installing_the_ibm_db_gem">Installing the ibm_db gem</h3>
<p>The last step we need to take is to install the ibm_db gem, which includes the IBM released (and supported) open source driver for Ruby, as well as the adapter for Rails. You&#8217;ll need these in order to use Rails with DB2.</p>
<p>Open a new shell and run:</p>
<pre class="highlight">$ sudo -s
$ export IBM_DB_INCLUDE=/home/db2inst1/sqllib/include
$ export IBM_DB_LIB=/home/db2inst1/sqllib/lib
$ . /home/db2inst1/sqllib/db2profile
$ gem install ibm_db
$ exit</pre>
<p>At the time of writing, this installs ibm_db-2.5.6.</p>
<h3 id="a_quick_sanity_test">A quick sanity test</h3>
<p>To ensure that all is well with your setup, run the following command:</p>
<pre class="highlight">$ rails new db2test -d ibm_db
$ cd db2test</pre>
<p>Now, edit <code>config/database.yml</code> so that the development section uses the same password you specified for the <code>db2inst1</code> user during the installation of DB2. Change the database name to something like <code>db2test</code>. The section should look like the example below:</p>
<pre class="highlight">development:
	adapter: ibm_db
	username: db2inst1
	password: secret
	database: db2test</pre>
<p>Create the database <code>db2test</code> by running:</p>
<pre class="highlight">$ su - db2inst1
$ db2start
$ db2 create db db2test
$ exit</pre>
<p>Depending on your hardware specs, the infrequent operation of creating a database can take quite a long time (e.g., minutes).</p>
<p>We will now install/attach the required gems for this project:</p>
<pre class="highlight">$ bundle install</pre>
<p>For the sake of a quick example, we&#8217;ll use scaffold to generate some super-basic code. We&#8217;ll then run migrations, and the built-in web server:</p>
<pre class="highlight">$ rails g scaffold Subject name:string
$ rake db:migrate
$ rails s</pre>
<p>Visit <code>http://localhost:3000/subjects</code> and you should see a scaffold interface you can use to create, edit, show, and destroy subjects, as I&#8217;ve done in the screenshot below.</p>
<p align="center"><a href="http://programmingzen.com/wp-content/uploads/2011/05/subjects-sample.png"><img src="http://programmingzen.com/wp-content/uploads/2011/05/subjects-sample.png" alt="subjects-sample" title="subjects-sample" width="401" height="349" class="aligncenter size-full wp-image-1373" /></a></p>
<p>Note: As you develop, you&#8217;ll probably want to use a better web server such as mongrel, unicorn, or thin. You can easily do so by editing your <code>Gemfile</code> and installing the gem via <code>bundle</code>.</p>
<h3 id="if_you_need_help">Getting help</h3>
<p>IBM is the only database vendor to officially provide and support its Ruby driver and Rails adapter. While commercial 24/7 DB2 support is certainly available and relatively inexpensive (i.e., <a href="http://www.db2teamblog.com/2010/12/treat-yourself-to-db2-this-holiday.html">cheaper than MySQL</a>), your first line of defense is posing your questions in the <a href="https://rubyforge.org/forum/forum.php?forum_id=9503">support forum</a> over at Rubyforge. Alternatively, if the question is DB2-specific and not related to Ruby or Rails, you can use the <a href="http://www.ibm.com/developerworks/forums/forum.jspa?forumID=805">DB2 Express-C forum</a> over at developerWorks instead.</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2007/11/11/installing-db2-95-on-ubuntu-710/' rel='bookmark' title='Installing DB2 9.5 on Ubuntu 7.10'>Installing DB2 9.5 on Ubuntu 7.10</a></li>
<li><a href='http://programmingzen.com/2007/12/26/installing-django-with-postgresql-on-ubuntu/' rel='bookmark' title='Installing Django with PostgreSQL on Ubuntu'>Installing Django with PostgreSQL on Ubuntu</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/05/11/installing-ruby-on-rails-and-db2-on-ubuntu-11-04/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Download DB2 Express-C 9.7.4</title>
		<link>http://programmingzen.com/2011/05/09/download-db2-express-c-9-7-4/</link>
		<comments>http://programmingzen.com/2011/05/09/download-db2-express-c-9-7-4/#comments</comments>
		<pubDate>Mon, 09 May 2011 20:27:56 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Industry News]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1369</guid>
		<description><![CDATA[Last week IBM released DB2 Express-C 9.7.4. This new version of the free flagship database by IBM mostly focuses on enhancements rather than new features, as you can read in this developerWorks article by my colleague Raul, &#8220;What&#8217;s new with DB2 Express-C 9.7.4&#8220;. What&#8217;s more interesting to me is that IBM has implemented a completely [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2007/10/31/db2-express-c-95-is-available-for-download/' rel='bookmark' title='DB2 Express-C 9.5 is available for download'>DB2 Express-C 9.5 is available for download</a></li>
<li><a href='http://programmingzen.com/2008/12/19/download-db2-on-mac/' rel='bookmark' title='Download DB2 on Mac'>Download DB2 on Mac</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Last week IBM <a href="http://www.db2teamblog.com/2011/05/db2-express-c-974-released.html">released DB2 Express-C 9.7.4</a>. This new version of the free flagship database by IBM mostly focuses on enhancements rather than new features, as you can read in this developerWorks article by my colleague Raul, &#8220;<a href="http://www.ibm.com/developerworks/data/library/techarticle/dm-1006db2expressc972/index.html">What&#8217;s new with DB2 Express-C 9.7.4</a>&#8220;.</p>
<p>What&#8217;s more interesting to me is that IBM has implemented a completely new full text search engine known as DB2 Text Search, which will probably be available to the public as an add-on in a week or so. We had a couple of different text search engines in the past, but IBM decided to focus on just one and make it as good as it gets. I look forward to playing with it, and reporting here on the blog about its capabilities in a future article.</p>
<p>For the time being, I encourage you to <a href="http://db2express.com/download/?S_TACT=ACDB201">download DB2 Express-C 9.7.4</a>. As a reminder, it&#8217;s free, and you can use in production without having to pay a fee.</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2007/10/31/db2-express-c-95-is-available-for-download/' rel='bookmark' title='DB2 Express-C 9.5 is available for download'>DB2 Express-C 9.5 is available for download</a></li>
<li><a href='http://programmingzen.com/2008/12/19/download-db2-on-mac/' rel='bookmark' title='Download DB2 on Mac'>Download DB2 on Mac</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/05/09/download-db2-express-c-9-7-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running Radiant CMS on DB2 in the Cloud</title>
		<link>http://programmingzen.com/2011/04/04/running-radiant-cms-on-db2-in-the-cloud/</link>
		<comments>http://programmingzen.com/2011/04/04/running-radiant-cms-on-db2-in-the-cloud/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 07:07:06 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[DB2]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1332</guid>
		<description><![CDATA[In this article I will show you how to set up and run Radiant CMS on DB2 Express-C in the Cloud. Before getting started, let’s define each of these components: Radiant CMS is a popular, easy to use open source Content Management System (CMS) that’s written in Ruby on Rails. DB2 Express-C is a fully [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>In this article I will show you how to set up and run Radiant CMS on DB2 Express-C in the Cloud. Before getting started, let’s define each of these components:</p>
<ul>
<li><a target="_blank" href="http://radiantcms.org/">Radiant CMS</a> is a popular, easy to use open source Content Management System (CMS) that’s written in Ruby on Rails.</li>
<li><a target="_blank" href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C</a> is a fully functional, free edition of DB2 which can be used in production for commercial purposes.</li>
<li>Cloud, in this particular context, refers to Amazon Web Services (AWS) that are managed with the aid of <a target="_blank" href="http://rightscale.com">RightScale</a> (an excellent Cloud management platform).</li>
</ul>
<h3 id="prerequisites">Prerequisites</h3>
<p>In order to run Radiant and DB2 in the Cloud and follow this tutorial, you’ll need to register with both Amazon Web Services and RightScale. You will also need to explicitly provide your AWS credentials to RightScale in order to manage Amazon’s services. If you haven’t taken these steps already, you can follow this <a target="_blank" href="http://vimeo.com/16093026">short screencast</a> to learn how to do so now.</p>
<div align=”center”><iframe src="http://player.vimeo.com/video/16093026?portrait=0&amp;color=c9ff23" width="600" height="323" frameborder="0"></iframe></div>
<p></p>
<h3 id="introduction_to_servertemplates">Introduction to RightScale ServerTemplates</h3>
<p>Rather than setting up the whole deployment stack from scratch, when using RightScale you can use special templates called RightScale ServerTemplates. These will take care of installing the required stack for you, thereby saving you time &#8211; and a possible headache, too.</p>
<p>IBM provides a RightScale ServerTemplate for your convenience called &#8220;Radiant CMS on IBM DB2 Express-C&#8221;, which installs Apache, Rails, Radiant, and DB2 on CentOS. Thanks to this template, it&#8217;s possible to have a Radiant and DB2 stack running in the Cloud in just a few minutes. This tutorial will show you how.</p>
<h3 id="creating_a_security_group">Creating a security group</h3>
<p>Before adding a server to our deployment we need to create a security group. This is a set of firewall rules that are used to define which ports are open on the server, as well as which IPs are accepted.</p>
<p>A security group is created within a specific geographical Cloud. For our particular ServerTemplate, the currently supported Clouds are US-East, US-West, EU, and AP-Singapore. AP-Tokyo is likely to be added in the upcoming weeks.</p>
<p>Select a Cloud of your choice (the closest one to you will do) and create a new security group from the Clouds menu as shown in the figure below.</p>
<p align="center">
<div id="attachment_1333" class="wp-caption aligncenter" style="width: 595px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/security-group.png" alt="Creating a security group" title="Creating a security group" width="585" height="299" class="size-full wp-image-1333" />
<p class="wp-caption-text">Creating a security group</p>
</div>
<p>You&#8217;ll be asked to provide a name for the group. It’s best to call it something meaningful, such as DB2 Public Access or Default Web Access. When prompted, you should open port 80 (for the web server) and port 50000 (for DB2), but you may want to enable port 22 as well for SSH access (admittedly not quite a best practice, but let&#8217;s keep things simple and standard), and any other port you think you may need. In the input mask, use 0.0.0.0/0 to indicate that all IPs are accepted for such ports.</p>
<p align="center">
<div id="attachment_1334" class="wp-caption aligncenter" style="width: 608px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/add-port-e1301983797980.png" alt="Opening port 80" title="Opening port 80" width="598" height="157" class="size-full wp-image-1334" />
<p class="wp-caption-text">Opening port 80</p>
</div>
<p></p>
<h3 id="adding_a_server_to_a_deployment">Adding a server to a deployment</h3>
<p>The first step will be importing IBM&#8217;s template in our RightScale account from the RightScale public Library. You can always find a link to said library by clicking on the Design menu and then on Library. There you&#8217;ll be able to search and browse all of the available templates. For your convenience, here’s a link you can click to bring you directly to the <a target="_blank" href="https://my.rightscale.com/library/server_templates/Radiant-CMS-on-IBM-DB2-Express/16950">Radiant CMS on IBM DB2 Express-C</a> template.</p>
<p>Click import and you&#8217;ll be prompted with a DB2 Express-C licensing agreement. Read it through (cough) and if you agree with the terms, click the accept check box and then Finish. The ServerTemplate will be imported for you, as shown in figure below.</p>
<p align="center">
<div id="attachment_1335" class="wp-caption aligncenter" style="width: 619px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/imported-server.png" alt="An imported server" title="An imported server" width="609" height="680" class="size-full wp-image-1335" />
<p class="wp-caption-text">An imported server</p>
</div>
<p>At this point, you can click Add To Deployment and select one of the available Clouds that are close to you (e.g., AWS US-East). Select the same Cloud you picked when creating a security group and then click Continue.</p>
<p>In the new popup dialog, you can select several parameters like Deployment, MultiCloud Image, Nickname, and so on. You can leave all the defaults on, but you should specify an Instance Type and Security Group(s). The former indicates what type of EC2 instance you need for your server (e.g., a micro instance), while the latter should be the security group (or groups) you created earlier on.</p>
<p>Keep in mind that Amazon will charge you based on an hourly basis, as well as depending on the instance type and Cloud you chose. A micro instance on the US-East Cloud as per this example is the cheapest solution. (Amazon even allows new customers to obtain a micro instance <a target="_blank" href="http://aws.amazon.com/free/">for free for the first year</a>.)</p>
<p>You will be redirected to the deployment you specified or that was selected by default (the default is unsurprisingly called Default). From this deployment you&#8217;ll be able to administer your instance of the server. (Note: You can always access your deployments from the Manage -> Deployments menu link.)</p>
<p>From within the Default deployment, start the server by clicking the triangular blue launch icon on the right side of the screen, which is located on the same line as your server&#8217;s nickname.</p>
<p align="center">
<div id="attachment_1336" class="wp-caption aligncenter" style="width: 610px"><img src="http://programmingzen.com/wp-content/uploads/2011/04/launch-server-e1301984230933.png" alt="Launching a server" title="Launching a server" width="600" height="58" class="size-full wp-image-1336" />
<p class="wp-caption-text">Launching a server</p>
</div>
<p>On the new page that appears, click the Launch button. The server will boot and you&#8217;ll be brought back to your deployment. While the server boots, you should see several status update messages that will help keep you in the loop regarding the status of the server.</p>
<p>If all goes well, and depending on your Cloud/instance choices, you should have the server up and running (i.e., the status will be operational) in five minutes or less.</p>
<p>You can now click on the nickname of the server (e.g., Radiant CMS on IBM DB2 Express-C), where you&#8217;ll find a clickable link corresponding to the &#8220;Public DNS name&#8221;. If you click on this link a Radiant CMS installation should appear.</p>
<p align="center"><img src="http://programmingzen.com/wp-content/uploads/2011/04/radiant-e1301984520960.png" alt="Radiant on DB2" title="Radiant on DB2" width="599" height="481" class="aligncenter size-full wp-image-1337" /></p>
<p>Append /admin to that URL, and you&#8217;ll be able to login with the default username (admin) and password (radiant). From there you can experiment and change things as you wish in order to make the site yours. Your changes will be persisted in the database, even if you reboot your instance.</p>
<p>To learn more about how to use Radiant as you play around with it in the Cloud, feel free to consult the <a target="_blank" href="https://github.com/radiant/radiant/wiki/">official Radiant documentation</a>.</p>
<p>That&#8217;s it. Enjoy Radiant CMS and DB2 in the Cloud.</p>
<h3 id="important_notes">Important notes</h3>
<p>Remember to stop your server if you are not using it in production or if you were just experimenting with it and you don&#8217;t need it at the moment. Keep in mind that Amazon will charge you for the time you have the server up (unless of course you took advantage of the <a target="_blank" href="http://aws.amazon.com/free/">AWS Free Usage Tier</a>). You can stop a server from the deployment or by clicking the Stop button from the server information page where you found the public DNS name.</p>
<p>If you plan on keeping the server running, you must change your Radiant CMS admin password to a stronger and more secure one. You can do so from /admin, by clicking on the Users link at the top of the page, and then on Administrator.</p>
<p>At this time the ServerTemplate doesn&#8217;t allow you to change the password for DB2 users. You must do so manually from the console. It&#8217;s important that you change the password for the database/system users db2inst1, dasusr1, and db2fenc1 from &#8216;password&#8217; to more secure ones. If you don’t take this step, you run the risk of having your server hacked in no time. When you update the password for these three users, you also need to update the /opt/www/blog/config/database.yml file with the password you just changed for the database/system user db2inst1.</p>
<p>You can access a root SSH console for your server from the deployment area (when the server is running a small console icon is visible). Click on this icon, then select the type of console that you want to operate (OpenSSH or Mindterm), and accept the RSA key fingerprint that you’re presented with. As root you can fully manage the server, including changing passwords for users (e.g., passwd db2inst1).</p>
<p>Of course, if you are just demoing or experimenting for 15 minutes, you can probably ignore these password related steps (which are quick, but admittedly more tedious).</p>
<p>If you have any questions, please feel free to ask in the comment section or via email.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/04/04/running-radiant-cms-on-db2-in-the-cloud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Try the next version of DB2 today</title>
		<link>http://programmingzen.com/2011/02/24/try-the-next-version-of-db2-today/</link>
		<comments>http://programmingzen.com/2011/02/24/try-the-next-version-of-db2-today/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 21:55:08 +0000</pubDate>
		<dc:creator>Antonio Cangiano</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[Industry News]]></category>

		<guid isPermaLink="false">http://programmingzen.com/?p=1303</guid>
		<description><![CDATA[IBM has been working hard to create a new, substantial upgrade of DB2. Thanks to the Early Experience program, you can now test drive the recently released Alpha 4 in the cloud for free. Despite its name, it&#8217;s a pretty solid release, so I wholeheartedly invite you to try it out. To apply for the [...]
Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2008/10/06/free-version-of-ruby-in-steel/' rel='bookmark' title='Free version of Ruby in Steel'>Free version of Ruby in Steel</a></li>
<li><a href='http://programmingzen.com/2010/05/14/the-most-important-programming-language-today/' rel='bookmark' title='The most important programming language today'>The most important programming language today</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://freedb2.com/db2-early-experience-program-on-the-cloud/"><img class="aligncenter size-full wp-image-1304" title="DB2 Early Experience Program" src="http://programmingzen.com/wp-content/uploads/2011/02/db2-early-experience.png" alt="DB2 Early Experience Program" width="635" height="93" /></a></p>
<p>IBM has been working hard to create a new, substantial upgrade of DB2. Thanks to the Early Experience program, you can now test drive the recently released <a href="http://freedb2.com/2011/02/23/alpha-4-of-the-next-version-of-db2-quietly-slips-out-in-to-the-wild/">Alpha 4</a> in the cloud for free. Despite its name, it&#8217;s a pretty solid release, so I wholeheartedly invite you to try it out.</p>
<p>To apply for the early experience program, all you have to do is <a href="http://freedb2.com/db2-early-experience-program-on-the-cloud/">fill out this form</a>. If you&#8217;d like to run DB2 on your own machine, you can get the current edition of <a href="http://db2express.com/download/?S_TACT=ACDB201">DB2 Express-C</a> here (it&#8217;s also free).</p>
<p>Possibly related posts:<ol>
<li><a href='http://programmingzen.com/2008/10/06/free-version-of-ruby-in-steel/' rel='bookmark' title='Free version of Ruby in Steel'>Free version of Ruby in Steel</a></li>
<li><a href='http://programmingzen.com/2010/05/14/the-most-important-programming-language-today/' rel='bookmark' title='The most important programming language today'>The most important programming language today</a></li>
<li><a href='http://programmingzen.com/2009/09/10/installing-and-configuring-db2-express-c-9-7-on-ubuntu-9-04-server/' rel='bookmark' title='Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server'>Installing and configuring DB2 Express-C 9.7 on Ubuntu 9.04 Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://programmingzen.com/2011/02/24/try-the-next-version-of-db2-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

