Download DB2 Upgrade DB2

DB2 Express-C 9.7.1

December 4th, 2009 by Leons Petrazickis

At work, we’ve just put out the 9.7.1 refresh of DB2 Express-C. By all accounts, it’s a solid release. There’s a changelog here, and you can discuss it in the forum.

I recommend picking it up if you are running the free edition of DB2.

Posted in db2 | No Comments »

CASCON 2009 Workshop - Deploying MediaWiki on IBM DB2 in the Cloud

November 4th, 2009 by Leons Petrazickis

I’m hosting a workshop today at CASCON. The resources for it are below.

Materials

Resources

Downloads

Posted in db2, mediawiki | No Comments »

Easy OLTP scaling with DB2 pureScale

October 14th, 2009 by Leons Petrazickis

OLTP is a database use where there are lots and lots of simple transactions or queries. For example, a typical website uses a database in the OLTP way. This is in contrast to a data warehouse, where there is usually only a few complex queries for generating reports.

IBM just announced DB2 pureScale, a way of easily scaling up the number of transactions a database can handle. The scaling is horizontal, in the sense that it’s accomplished by adding more servers rather than making the servers bigger.

DB2 pureScale is:

  • Transparent. Client applications don’t need to know how many database servers there are or which one they are accessing.
  • Easy. Adding a new machine is a matter of running two commands.
  • Resilient. If one node goes down, the other nodes take over and there is virtually no data loss.

There is an upcoming Chat with the Lab about it:

DB2 pureScale: Scaling Databases without Limits
Event Date: 10/21/2009
Event Time: 11:30 - 13:00 EDT (GMT-04:00)
Hosted By: Rav Ahuja (IBM)
Presented By: Sal Vella (IBM), Matt Huras (IBM), Aamer Sachedina (IBM)

Register now

Posted in db2 | No Comments »

Moving DB2 from one hostname to another

July 10th, 2009 by Leons Petrazickis
SQL6031N  Error IN the db2nodes.cfg file at line number "1".  Reason code "10".

DB2 caches your machine’s hostname in several places. If your machine is changing its hostname, or if you are somehow moving an existing installation to a machine with a different hostname, you will need to adjust the hostname stored by DB2. Hostname change is common in virtual and cloud environments, so even better than adjusting it would be writing a script that adjusts it for you.

Here’s my rudimentary stab at a such a script:

#!/bin/sh
echo -n "Discovering the new hostname "
UNAME_CACHE=$(uname -n)

echo -n "Adjusting hostname list for unconfigured database partitioning feature "
# this may need to be changed if DPF preconfigured
if [ -e /home/db2inst1/sqllib/db2nodes.cfg ]; then
    chmod 666 /home/db2inst1/sqllib/db2nodes.cfg
    su - db2inst1 -c "cp /home/db2inst1/sqllib/db2nodes.cfg /home/db2inst1/sqllib/db2nodes.cfg.old"
    su - db2inst1 -c "echo 0 $UNAME_CACHE 0 > /home/db2inst1/sqllib/db2nodes.cfg"
fi

echo -n "Making registry writable "
chmod 666 /var/db2/*

echo -n "Adjusting the DB2 hostname "
UNAME_CACHE=$(uname -n)
/opt/ibm/db2/V9.7/adm/db2set -g db2system=$UNAME_CACHE

echo -n "Updating DAS configuration "
# todo
# db2 uncatalog node <old_hostname>
db2 catalog admin tcpip node $UNAME_CACHE remote $UNAME_CACHE system $UNAME_CACHE
db2 update admin cfg using DB2SYSTEM $UNAME_CACHE
db2 update admin cfg using SMTP_SERVER $UNAME_CACHE
 

This doesn’t cover all cases. For example, if you use extended operating system security, you may also need to set the db2accountname and db2instowner parameters. A quick check with db2set -all should tell you if this applies in your case — if there is something that looks like a hostname in those parameters already, you need to change them.

I may also have missed other necessary changes. Please let me know if I did.:-)

References

Edit: Revised to use proper authorities, incorporate official instructions

Posted in db2 | 2 Comments »

DB2 data movement tool

June 23rd, 2009 by Leons Petrazickis

The DB2 data movement tool sounds like an excellent way to move stuff from, say, MySQL to DB2. I should see if I can use it to move a MediaWiki database.

Speaking of MediaWiki, I swear I’ll have a patched zip of 1.15 ready any day now.:-)

Posted in db2, mysql, mediawiki | No Comments »

Fastest sheep-counter in the West

June 5th, 2009 by Leons Petrazickis

My buddy Antonio investigated what today’s busy android should use to count electric sheep.

Turns out it’s DB2. Heh.:-)

Posted in db2, mysql | No Comments »

Express-C download experience

March 13th, 2009 by Leons Petrazickis

One thing I just did at work was use SurveyMonkey to put together a quick survey about the DB2 Express-C download experience.
DB2 Express-C Download Experience Survey
I do wish they offered a prefilled dropdown with a list of countries, though.

Another SurveyMonkey limitation I just encountered is the need to pony up some dough in order to have more than three trackable links to a survey.

Still, the site seems to be fairly rugged. I am happy with its reporting capabilities from past experience.

Posted in db2, work | No Comments »

Upgrade to DB2 9.5 before May 2009

March 13th, 2009 by Leons Petrazickis

One thing I recently did at work was put together the Upgrade to DB2 9.5 site.

Upgrade site screenshot

End of base support is coming for DB2 8.2 on April 30, 2009. There are several reasons to move to DB2 9.5 before — both business and technical.

The thing is, IBM doesn’t sell a release of DB2 — it sells DB2. If you’ve bought one release of DB2, you’ve bought them all for as long as your support holds out. You might as well be running as the best, most performant release — and that release is DB2 9.5. It’s cheaper, smarter, more secure, and more performant than DB2 8.2 or virtually anything else out there.

DB2 for z/OS folks will want to upgrade any copies of DB2 Connect to 9.5.

If you’ve seen IBM sites before, this one looks a bit different. There are some pretty strict guidelines for what can go on ibm.com, and we got to push the letter of them to limit. This got us a site that is clean, focused, and visually appealing.

My team has also put together a media pack for anyone who’d like to raise awareness about the end-of-support for DB2 8.2. Feel free to use any of these graphics on your blogs, personal sites, and similar endeavours:

Upgrade iconUpgrade iconUpgrade iconUpgrade icon

(As usual, this blog contains my own opinions and doesn’t represent IBM in any official capacity.)

Posted in db2, work | 2 Comments »

DB2 and usernames with spaces

February 4th, 2009 by Leons Petrazickis

DB2 v9.5 uses the Windows username as the default schema. Unfortunately, it does not support spaces in schema names. Accordingly, usernames - e.g. “Jane Smith” — that have a space can make DB2 unhappy.

I recently helped someone resolve an issue with this command:

db2sampl -force -name SAMPLE
 

Which brought up this error:

  Creating DATABASE "SAMPLE"
  Connecting TO DATABASE "SAMPLE"
  Creating TABLES AND DATA IN schema "JANE SMITH"

–ERROR—-
  SQLSTATE = 42601
  Native Error Code = -443

[IBM][CLI Driver][DB2/NT64] SQL0443N  Routine "*L_SAMPLE" (specific name "") has  returned an error SQLSTATE WITH diagnostic text "SQLSTATE 42601: A character,  token, or clause is invalid or". SQLSTATE=42601

  Creating TABLES WITH XML COLUMNS AND XML DATA IN schema "JANE SMITH"

–ERROR—-
  SQLSTATE = 42601
  Native Error Code = -443

[IBM][CLI Driver][DB2/NT64] SQL0443N  Routine "*L_SAMPLE" (specific name "") has  returned an error SQLSTATE WITH diagnostic text "SQLSTATE 42601: A character,  token, or clause is invalid or". SQLSTATE=42601

  ‘db2sampl’ processing complete.
 

The full routine name is CREATE_SQL_SAMPLE. It tries to create tables for Jane Smith, fails, and blazes bravely on. Interestingly, an empty database results.

The workaround is to log in as a user without a space, such as “db2admin”, run db2sampl, and then log back in as yourself.

For running future queries, you can specify a different schema:

SET SCHEMA=db2admin;
 

And, of course, you can always explicitly specify a schema in your queries:

SELECT * FROM db2admin.tablename;
 

Posted in db2 | No Comments »

DB2 contests happenning

December 8th, 2008 by Leons Petrazickis

On Dec 1, three DB2-related contests launched in various bits of the world:

  • The Query Contest has us play a detective using the mighty power of SQL in an online query console.
  • The Ported App Contest has us port or clone an app or a utility so that it now uses DB2 for stuff.
  • The XML Programming Contest has us write a new app that uses the pureXML stuff in DB2.

Prizes include an iPod Touch, a Wii, and oodles of USB keys. I am, alas, ineligible.

Posted in db2 | No Comments »

« Previous Entries