Wednesday, February 13, 2013

DB2 database setup

Did you ever have to setup DB2 on your local machine? You will find that if you have domain user, things are not as straight forward as they might seam. Here is a little help for DB2 Express 10.


I was using Windows 7 64 bit for this.

If you are logged in domain and what you found on IBM help site does not work, you might try this (You will need to run Command window - Administrator):

1. Create same username as domain username using local account.
2. Create new group DB2ADMNS
3. Add all usernames (domain,local and db2admin) to Administrators and DB2ADMNS
4. Run db2set DB2_GRP_LOOKUP=LOCAL,TOKENLOCAL
5. Run DB2STOP
6. Run DB2 UPDATE DBM CFG USING SYSADM_GROUP DB2ADMNS
7. Run DB2START
8. And now, the important step that I always forget, logoff and logon with your username. You should be able to do administration tasks now.

You can now create database:
attach to db2 user <username>;
create database <dbname>;
connect to <dbname>;
create bufferpool bpool8k size 20000 pagesize 8k;
create tablespace tbsp_8k pagesize 8k bufferpool bpool8k;

That's it. You can use your favorite tools now to create tables and run scripts.

Regards

No comments:

Post a Comment