Simplify the DB2 9.7 security model

13:48 on Sat 2010-06-26 by Leons Petrazickis DB2

Starting in DB2 9.7, the DB2 security model was changed. Security administration (SECADM) was split off from database administration (DBADM), and users with SECADM permissions could no longer peek at data, at least not by default. Secure by default is a great practice. It’s fantastic when deploying a production database at a financial institution. However, [...]

Cataloging databases after reinstalling DB2

13:47 by Leons Petrazickis DB2

On Windows, uninstalling DB2 will remove the instance but keep the databases in place. After you reinstall, you’ll want to recatalog these databases. This is fairly straightforward. Find out their names: db2 list db directory on C:   Map each of the databases that you want: db2 catalog db SAMPLE on C:   You can [...]

Going from DB2 Enterprise to DB2 Express-C

13:39 by Leons Petrazickis DB2

Downgrading from DB2 Enterprise to DB2 Express-C is a fairly straightforward process. Stop DB2. db2stop force   Uninstall DB2 Enterprise. sudo su – db2inst1 /opt/ibm/db2/V9.7/install/db2_deinstall -a exit   Install DB2 Express-C without creating any users, etc. sudo ./db2_install   Update the instance with the new edition information. sudo /opt/ibm/db2/V9.7/instance/db2iupdt db2inst1   You might encounter this [...]

Enable NFS services for HADR

13:35 by Leons Petrazickis DB2, Unix

You might need to enable network file system (NFS) services when configuring the High Availability Disaster Recovery (HADR) or Database Partioning (DPF) DB2 features. For example, with HADR, you might want to set up a slave database that shares a backup with the master database through NFS. These commands should enable NFS services on most [...]

Changing the DB2 hostname

09:20 on Fri 2009-07-10 by Leons Petrazickis DB2

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 [...]

DB2 and usernames with spaces

17:23 on Wed 2009-02-04 by Leons Petrazickis DB2

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:   [...]

Install DB2 via the command line

14:00 on Sat 2008-10-04 by Leons Petrazickis DB2

I installed DB2 on an Ubuntu Linux server via SSH and the command line installer this morning. This is not particularly exotic, but is different from using the GUI installer on either platform. Still, I should jot down my steps: SSH to your server. On Windows, use Putty or the OpenSSL package in Cygwin. Open [...]

pureXML in DB2

13:50 on Tue 2008-09-23 by Leons Petrazickis DB2

pureXML is the native XML storage capability in IBM DB2. It allows for whole XML documents to be stored in a DB2 table column, and for them to be easily queried via either SQL or XQuery or some combination of the two. Getting Started with DB2 has a decent introduction to both . There’s also [...]

Rails and DB2 data types

11:20 on Mon 2007-05-28 by Leons Petrazickis DB2, Rails

When creating a table in a Rails migration, you have to specify data types using platform-agnostic names. The mapping of Rails types onto DB2 types is defined in ibm_db_adapter.rb: :primary_key => @servertype.primary_key, :string      => { :name => "varchar", :limit => 255 }, :text        => { :name => "clob" }, :integer [...]

No implementation defined for org.apache.commons.logging.LogFactory

16:05 on Thu 2007-05-03 by Leons Petrazickis DB2, Java

While writing a DB2 stored procedure that invoked a SOAP/WSDL web service using Apache Axis as part of WSIF, I ran into this doozie: org.apache.commons.discovery.DiscoveryException: No implementation defined for org.apache.commons.logging.LogFactory Ultimately, it’s caused by a too restrictive lib/security/java.policy file that ships with DB2. Wrong Solution The standard way to define an implementation is to create [...]