Installing DB2 Express-C on Windows
IBM makes available a free version of their flagship DB2 database called DB2 Express-C. It is a competitor to Oracle Express, Microsoft SQL Server Express and MySQL. It is ideal for a development environment or a small pilot project, and it can be updated to a fully supported licensed version at any time. Cognos 8 Business Intelligence supports reporting off this database and using it as the content store. This tutorial will step through the installation of DB2 Express-C on Windows.
Download DB2 Express-C from the IBM website: http://www-306.ibm.com/software/data/db2/express/download.html
Extract the files, and double click setup.exe to get started. On Windows Vista or Windows 2008 Server, right click the setup.exe and select ‘Run as Administrator’.

On the left hand sidebar menu, click Install a Product.

Click Install New. The installer program will start. Click next.

Accept the license agreement and click Next.

Choose the installation type.

Click the View Features button to see what features will be installed with the Typical or Compact installation. For this tutorial, I will be installing the typical installation.

Choose a location for the database. By default, it will install to c:\program files\IBM\SQLLIB.

Provide a user account or select LocalSystem account. For this tutorial, I will use an account I created for the DB2 database called db2admin.

The name of the DB2 instance that will be created appears.

Click the configure button to see options for this instance.


A summary page will appear. Click the Finish button to continue the installation.

The installation starts by copying over the files. If you are running Vista, you will be prompted to allow the installer to continue.

After the files have been copied over, the post installation page appears. Click the Finish button to continue.

The DB2 first steps menu comes up.

Select Database Creation on the left hand sidebar menu. Click Create SAMPLE Database to test your installation and to install the sample database.

Once complete, open up the DB2 Control Center. Click on Database Administration, Start DB2 Control Center. It can also be launched from the Windows Start menu, Programs, IBM DB2, instance name, General Administration tools.

The sample database will be visible in the DB2 Control Center.

DB2 installs six services. In this screen capture, DB2COPY1 is the instance name.

If you need to return to the First Steps menu, there is a short cut placed in the Windows Start Menu, under Programs, IBM DB2, <instance name>, Setup Tools.
Test connectivity to DB2
Once installed, test connectivity to the database with the following steps:
Open up a command prompt and run db2cwadmin.bat
A new window will open. Enter ‘DB2′ at the prompt. This will start the DB2 command line client (CLI).
Connect to the database with this command:
CONNECT TO sample USER <userid> USING <password>

Run a simple SQL command as another test: select * from curried.sales where region = ‘Quebec’

Troubleshooting

On Windows Vista, the following error occurs when DB2 starts if the installer was run with administrator priveleges: DB2JAVIT : RC = 9505.
This forum posting has some details: http://www.ibm.com/developerworks/forums/thread.jspa?threadID=165035
Upon reboot and logging in after the installation, this error might appear: SQL5005C System Error.

To resolve this problem, add your user to the DB2ADMNS or the DB2USERS group. This is done through the Computer Management console, under Users and Groups. Note that this console does not exist on all editions of Windows Vista, but users and groups can be managed using the NET command on all Windows editions.
NET LOCALGROUP – retrieve a listing of all local groups
NET USERS – returns a list of all local users
NET LOCALGROUP db2admns curried /add – add user ‘curried’ to the local group ‘db2admns’
NET LOCALGROUP db2admns – returns a list of users who belong to the group ‘db2admns’
Additional DB2 Resources:
DB2 Express-C home page: http://www-306.ibm.com/software/data/db2/express/
DB2 Express-C download page: http://www-306.ibm.com/software/data/db2/express/download.html
DB2 Express-C developer handbook: http://www.redbooks.ibm.com/abstracts/sg247301.html
Directory of IBM and 3rd party resources: http://www.db2express.com/
Comments
Leave a Reply








