Download DB2 Upgrade DB2

Continuing to work on DB2 support for MediaWiki

August 15th, 2009 by Leons Petrazickis

No fresh download quite yet, but I just made a large commit to the MediaWiki source of the last week’s work. This is going in the trunk — aka MediaWiki 1.16alpha. There are a few bugs I hope to catch this weekend, at which point I’ll put up a fresh archive of working code.

config/index.php:
* Made installation on IBM DB2 more robust
* Replaced E_ALL error reporting mode with E_ALL | E_STRICT

includes/db/DatabaseIbm_db2.php
* Enabled DB2_CASE_LOWER option for all connections and statements
* Enabled DB2_DEFERRED_PREPARE_ON for all statements — delays statement preparation until execution to reduce database load
* Enabled DB2_ROWCOUNT_PREFETCH_ON for all statements — makes db2_num_rows() work correctly
* Cleaned up error handling
* Cleaned up method signatures
* Rewrote insertion to use prepared statements — required for inserting more than 32k of text
* Insertion will never try to insert a NULL value into a primary key
* Now relying on implicit casting in DB2 9.7 — no longer sniffing to see if column is integer or string before adding quotes
* Implemented actual prepared statement handling — required for correct INSERT, UPDATE behaviour
* In install mode, the class will print additional messages to the install bullet scroll
* Added bitwise operation abstraction (BITNOT, BITAND, BITOR)

includes/specials/SpecialAncientpages.php
* Added skeleton DB2 syntax to the database-specific switch statement

maintenance/convertLinks.inc
* Made limit clause database-agnostic

maintenance/ibm_db2/README
* Contents replaced with link to http://www.mediawiki.org/wiki/Manual:IBM_DB2

maintenance/ibm_db2/tables.sql
* Revised types to better match the main schema
* All tables names now the same as MySQL — was using Postgres schema’s names before
* Added some additional indices
* Added the change_tag, tag_summary, valid_tag, user_properties, log_search, and l10n_cache tables
* Added several new columns

maintenance/storage/compressOld.inc
* Made limit clause database-agnostic

Posted in mediawiki | 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 »

Oracle acquires Virtual Iron. Oracle kills Virtual Iron. Oracle acquires MySQL…

June 23rd, 2009 by Leons Petrazickis

Only 5 weeks from acquisition to death. No more licenses for existing customers, either. Harsh.

Posted in oracle | No 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 »

Everything that is, and ever will be, to be improved by Google Wave

May 30th, 2009 by Leons Petrazickis

Find the hour to watch this video. They get everything really, really right. Plus, it looks to integrate well with everything. I look forward to using Google Wave for all my personal communication, as well as using a private install of Google Wave at IBM for all my business communication.

Posted in ajax, video, google, web 2.0 | No Comments »

setTimeout() and setInterval() not working

May 26th, 2009 by Leons Petrazickis

The two javascript functions above are very useful. The first one executes something after a set delay, and the second executes something at regular intervals. The syntax is very similar.

var time = 2000; // 2 seconds
window.setTimeout(function() { alert(‘Yay!’); }, time);
window.setInterval(function() { alert(‘Woo!’); }, time);
 

Unfortunately, they weren’t working for me earlier. It turns out I wasn’t fully-qualifying them. Specifically, I was calling setTimeout() rather than window.setTimeout(). The latter works.

Most examples use the abbreviated form, which consistently doesn’t work for me.

Posted in javascript | No Comments »

Monty Widenius forks MySQL

May 14th, 2009 by Leons Petrazickis

Looks like the original cofounder of MySQL Inc, Monty Widenius, is forking MySQL. He’s going to try to merge with all the other forks, but I suspect that Oracle will not be interested in merging something they just bought with this particular fork. Especially since it will not support InnoDB, an alternate MySQL engine bought by Oracle some time before they bought regular MySQL.

Posted in links, mysql | No Comments »

DB2 links directory at dmoz.org

April 5th, 2009 by Leons Petrazickis

I now edit the Computers: Software: Databases: IBM DB2 category at dmoz.org open directory project.

Directories used to be important in the mid-1990s, as they tended to provide better search results than dumb link crawlers like Altavista. Yahoo started off as a human-edited hierarchical directory of links and adopted the crawler approach later.

However, since Google has come along with a better search algorithm, directories are in decline. dmoz is the only major one left, and this hasn’t escaped the notice of SEO folk, who chase the prestigious linkback and fill the submission queue with a lot of crud.

Feel free to suggest a URL for inclusion.:-)

Posted in dmoz | 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 »

« Previous Entries Next Entries »