Thursday, February 3, 2011

DB2

Download

                        

                                 To download DB2 trial visit here click here and select: IBM DB2 9.5 Data Server trial. Then you have to sign in (create an account if not already created) in order to download. Choose either of the following:
  • DB2 9.5 data server trial for Linux(R) on AMD64 and Intel(R) EM64T systems (x64)
  • DB2 9.5 data server trial for Linux(R) on System z
Then answer questions and click 'I confirm' at the bottom. Finally click 'I confirm' button to start downloading.
Alternately, visit hereand select: IBM DB2 9.5 Express-C. Then choose DB2 Express-C 9.5 for Linux and click continue. Then answer questions and click 'I confirm' at the bottom. Finally select either of the following:
  • DB2 Express-C for Linux operating system, 32-bit architecture
  • DB2 Express-C for Linux operating system, 64-bit architecture
click 'I confirm' button to start downloading.



Installing DB2



Option 1:
                Download and install in one step. DB2 Express-C data server This is available from the Ubuntu repositories and requires Ubuntu 7.10 or newer to run. Enable the Ubuntu Partner Repository and install the server with the following command:


sudo apt-get install db2exc
 
 
Option 2:
               I choose 'DB2 Express-C for Linux operating system, 32-bit architecture' to demonstrate how to install. If you have chosen a different version, make necessary changes accordingly. Let's assume the downloaded file is on your home directory. Then do the following:

tar -xf db2exc_950_LNX_x86.tar.gz
cd ~/exp
sudo apt-get install libaio1
sudo apt-get install libstdc++5
sudo ./db2setup
Select 'Install a Product' from the left side of the generated window  and click 'Install New'. Another window will be opened. Then following  the instructions to complete the installation. You are encouraged to  create new user and groups (dasusr1/dasadm1, db2inst1/db2iadm1,  db2fenc1/db2fadm1) during installation.




Uninstalling DB2



                                       If you have installed with all default settings (as mentioned above) then just running the following commands would remove the db2 completely. In case you have changed something during installation, then make appropriate changes accordingly.

cd /opt/ibm/db2/V9.5
./instance/db2ilist
sudo instance/db2idrop db2inst1
You may also have DAS (DB2 Administration Server) installed. If so  when you issue the db2_deinstall command you will see the following  error: "The DB2 installer detects that the DAS is using the current DB2 copy to  be uninstalled. The deinstallation process can not continue." To uninstall DAS issue the following:

./instance/daslist
sudo instance/dasdrop dasusr1
Continue with the deinstallation.

sudo install/db2_deinstall -a
cd && sudo rm -r /opt/ibm/db2
sudo userdel -r dasusr1
sudo userdel -r db2fenc1
sudo userdel -r db2inst1
sudo groupdel dasadm1
If you get this error: "groupdel: cannot remove user's primary  group." You will need to go to the /home directory and see what other  db2 users are created there. For example you could have dasusr2,  dasusr3, db2fenc2, db2fenc3, db2inst2, db2inst3, etc. Issue the "sudo  userdel -r username" command where username is the db2/das username in  your home directory until all the usernames have been deleted. Once this  is done you will now be able to successfully re-issue the groupdel  commands.

sudo groupdel db2fadm1
sudo groupdel db2iadm1
 
Before running those commands, please make sure: 
  • Make sure, db2 is not running.
  • Identify DB2 installation directory (E.g /opt/ibm/db2/V9.5)
  • Identify DB2 instances (using db2ilist command, see the second command)
  • Drop each and every instances (using db2idrop command, third command)
  • If you have other IBM softwares in /opt/ibm then remove only /opt/ibm/db2 directory.
  • Delete user and group accounts that you have created for db2.

1 comment:

  1. The download link you are referring to is broken. The best place to download FREE DB2 is http://www-01.ibm.com/software/data/db2/express/download.html?S_TACT=LKFREE000&S_CMP=ECDDWW01

    ReplyDelete