For db2 there is an IDE, IBM Data Studio. After installing it with non-administration privilages, we can encounter some serious problem. After launching it, there is no possibility to create new database from within the IDE. Although in “Getting started with DB2 IBM Data Studio” redbook there is a chapter for this, when trying a connection set, by clicking “Test connection” button nothing happens. After clicking Finish and setting all settings to create new database, there will be propably an error.
The thing is, when you install the db2 as admin (sudo), there will be additional users created. Like db2inst1, dasusr1 and db2fenc1. A profile for db2inst1 (which will be an instance of the DB2) will be created under user db2inst1.
After installing IBM Data Studio the profile launch will not be added to the launching script.
Here is what to do :
- Locate where is db2profile (propably on /home/db2inst1/sqllib/db2profile
- go to your home directory, create dir bin
- $cd ~
- mkdir bin
- create file f.e. ibmdatastudio :
- echo > ibmdatastudio
- change mode to +x :
- chmod +x ibmdatastudio
- edit it with feavourite editor (mine is vim) : vim ibmdatastudio
- And enter following rows :
#!/bin/bash
if [ -f /home/db2inst1/sqllib/db2profile ]; then
. /home/db2inst1/sqllib/db2profile
fi
$HOME/IBM/DS2.2/eclipse -product com.ibm.datastudio.mini.im.product.ide
And now change the command in the IBM Data Studio Menu to $HOME/bin/ibmdatastudio
Should be possible to create new database via IBM Data Studio itself.