Topic
  • 10 replies
  • Latest Post - ‏2007-08-22T22:23:35Z by SystemAdmin
SystemAdmin
SystemAdmin
5837 Posts

Pinned topic Ubuntu 6.10 and DB2 Express-C

‏2007-01-23T00:04:25Z |
Hi,

I'm putting together the next version of the DB2 for Linux HOWTO, and I have noticed (and tried to answer) a number of questions that seem to keep popping up with regards to installation and running DB2 Express-C 9 on Ubuntu 6.10.

I started this thread for people to track and help others with any Ubuntu 6.10 issues. The majority of the problems seem to arise from the way that Ubuntu handles super-user|root authority tasks, which is a shift from the way that other distributions (Red Hat || SLES) handle the root user.

I've completed my installation testing and have come up with these instructions:

Installation:
  • Running a VMware image of a basic 6.10 desktop installation
  • Downloaded db2exc_91_LNX_x86.tar.gz file from DB2 Express-C website (through IBM's Download Director)
  • Kernel level is 2.6.17-10-generic on an x86 processor
  • To start DB2 install, I opened a terminal window: Applications -> Accessories -> Terminal
  • I extracted the tarball with the command codetar zxvf db2exc_91_LNX_x86.tar.gz[/code]
  • Next, I ran codecd exp/disk1[/code] to get to the installation directory
  • Then, I ran the DB2 setup program, using Ubuntu's sudo command to execute with superuser authority: codesudo ./db2setup[/code]
  • From the DB2 Launchpad, I chose "Install a Product", "Install New"
  • In the DB2 Installer, I picked a "Typical" installation into the /opt/ibm/db2/V9.1 directory
  • For the DAS user, I created a new user: dasusr1, with group dasadm1 (the defaults)
  • I chose to create a DB2 instance, and created a new DB2 instance owner: db2inst1, group db2grp1 (again the defaults)
  • And finally, I created a new DB2 fenced user: db2fenc1, group db2fgrp1 (yup, defaults again)
  • With these options, the DB2 install completed successfully

Applications:
  • As "me" (the current user), when I try to launch the DB2 Control Center (using the 'db2cc' command), I get an error message codedb2cc: command not found[/code]
  • Then, after running codesu - db2inst1[/code] to switch to the instance owner, I find I get this error: codedb2cc: not found:[/code]
  • The thing to note here is that the shell created by default for the newly created users is the plain /bin/sh, not the /bin/bash (Bourne Shell) that DB2 is expecting
  • So, I ran code/bin/bash[/code] to start the Bash shell, and then tried the 'db2cc' command again, but I get this error message:
    codejava.awt.HeadlessException
    No X11 DISPLAY variable was set, but this program performed an operation which requires it. ... ... [/code]While that seems bad, it's actually good -- it means that the db2cc command was (finally) found, and it ran, but smacked up against the X Windows security settings. There's two ways to fix this:
    1. log off as the "me" user, log on as "db2inst1", open a terminal, run the code/bin/bash[/code] to get a Bash shell, and then execute your commands; or
    2. allow the "db2inst1" user access to your X Window, and export the DISPLAY variable for the "db2inst1" user to your desktop. In a separate terminal, as the "me" user, run codexhost +local:db2inst1[/code] then go back to your "db2inst1" user terminal, and type codeexport DISPLAY=:0[/code]and then codedb2cc[/code] and you should get the DB2 Control Center on your "me" desktop
  • Now, running code/bin/bash[/code] is a pain to do every time, so I suggest that you change the default shell permanently for the "db2inst1" user. Run this command (while running as the "db2inst1" user: codechsh -s /bin/bash db2inst1[/code]Now you'll have the Bash shell forever after (though for this first time, you will have to log off and back in for this to take effect).
And that's all I've come across so far in the way of Ubuntu 6.10 issues. Please post any additional issues to this thread so I or one of the other Ubuntu/DB2 geeks enthusiasts out there can help you.

Cheers,

Ian Hakes
IBM DB2 UDB Express Community Facilitator
Download DB2 Express-C 9
Email: db2x@ca.ibm.com
Updated on 2007-08-22T22:23:35Z at 2007-08-22T22:23:35Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    5837 Posts

    Re: Ubuntu 6.10 and DB2 Express-C

    ‏2007-01-24T22:02:21Z  
    Just for imformation purposes. A VMWare image with Ubuntu 6.10 Desktop and DB2 V9.1 is available for download at this address:

    http://www.instantiations.com/VAST/Goodies_Community.htm

    This image was done for VASmalltalk 7.01 (former IBM VisualAge Smalltalk) to help developers to play with both tools (Smalltalk and DB2).

    Marten Feldtmann
  • SystemAdmin
    SystemAdmin
    5837 Posts

    Re: Ubuntu 6.10 and DB2 Express-C

    ‏2007-01-31T22:02:10Z  
    Just for imformation purposes. A VMWare image with Ubuntu 6.10 Desktop and DB2 V9.1 is available for download at this address:

    http://www.instantiations.com/VAST/Goodies_Community.htm

    This image was done for VASmalltalk 7.01 (former IBM VisualAge Smalltalk) to help developers to play with both tools (Smalltalk and DB2).

    Marten Feldtmann
    The link has changed (due to a new version of VASmalltalk):

    http://www.instantiations.com/VAST/more/goodies.html
  • ocgstyles
    ocgstyles
    472 Posts

    Re: Ubuntu 6.10 and DB2 Express-C

    ‏2007-03-24T18:21:53Z  
    Hi Ian,

    I used to use SuSE 10.1, but recently switched to Ubuntu about a month ago. Although I worked out how to get db2cc to work, this tutorial show pretty much exactly what I figured out. Only differences I did was:

    1. Added line to "my" .bashrc
    codexhost +local:dbadmin[/code]

    2. Added line to "dbadmin"'s .bashrc
    codeexport DISPLAY=:0[/code]

    I am a Beryl user (I like my eye candy), I also had another problem with Control Center; it appeared as a blank window (see attached image). I found a few articles out there on a similar problem with another Java app called Frostwire (http://www.linuxmint.com/forum/viewtopic.php?p=2145#2145). It turns out that this fix worked for me too. I appended another line to "dbadmin"'s .bashrc:
    codeexport AWT_TOOLKIT=MToolkit[/code]

    So, only problem now is, Control Center is not showing my local instance(s) or local databases. I would think that CC should show this automatically, right? Can you think of why they aren't showing up by default? If I remember correctly, they did when I was using SuSE...

    • Keith
    Updated on 2007-03-24T18:21:53Z at 2007-03-24T18:21:53Z by ocgstyles
  • igorM
    igorM
    266 Posts

    How to automaticaly start DB2 after reboot of Ubuntu Linux

    ‏2007-04-12T13:47:52Z  
    Hi,
    I have successfully install DB2 v9.1 Express Edition on Ubuntu Linux 6.10 using db2_install script and then follow http://tldp.org/HOWTO/html_single/DB2-HOWTO/#ubuntu510 post install info.

    DB2 is working fine if I start it manually.

    But I just can't find any useful info how to enable autostart of DB2? Any help would be greatly appreciated.

    So far I have test this:
    =========================
    1. run command:
    codedb2iauto -on db2inst1[/code]

    This command set DB2AUTOSTART=YES. As I understand it also put info:
    fmc:2345:respawn:/opt/ibm/db2/V9.1/bin/db2fmcd #DB2 Fault Monitor Coordinator
    into file /etc/inittab

    2. I have created file /etc/init.d/db2 assign privileges (chmod 777 db2) and put following commands into file:
    code#! /bin/sh
    . /home/db2inst1/sqllib/db2profile
    su -c /opt/ibm/db2/V9.1/adm/db2start db2inst1
    [/code]
    3. I have rebooted Linux and DB2 still doesn't start.

    Any idea how to configure DB2 to enable autostart?

    Thanks.
  • ocgstyles
    ocgstyles
    472 Posts

    Re: How to automaticaly start DB2 after reboot of Ubuntu Linux

    ‏2007-04-12T15:34:53Z  
    • igorM
    • ‏2007-04-12T13:47:52Z
    Hi,
    I have successfully install DB2 v9.1 Express Edition on Ubuntu Linux 6.10 using db2_install script and then follow http://tldp.org/HOWTO/html_single/DB2-HOWTO/#ubuntu510 post install info.

    DB2 is working fine if I start it manually.

    But I just can't find any useful info how to enable autostart of DB2? Any help would be greatly appreciated.

    So far I have test this:
    =========================
    1. run command:
    codedb2iauto -on db2inst1[/code]

    This command set DB2AUTOSTART=YES. As I understand it also put info:
    fmc:2345:respawn:/opt/ibm/db2/V9.1/bin/db2fmcd #DB2 Fault Monitor Coordinator
    into file /etc/inittab

    2. I have created file /etc/init.d/db2 assign privileges (chmod 777 db2) and put following commands into file:
    code#! /bin/sh
    . /home/db2inst1/sqllib/db2profile
    su -c /opt/ibm/db2/V9.1/adm/db2start db2inst1
    [/code]
    3. I have rebooted Linux and DB2 still doesn't start.

    Any idea how to configure DB2 to enable autostart?

    Thanks.
    Hi igorM,

    It looks like Ubuntu changed some things in the Edgy Eft release, that being inittab. Search in google for "inittab ubuntu" and you'll see what I'm talking about. So, because of the change, the fault monitor is not being started, hence the databases are not starting either.

    It looks like you are own for now to develop an autostart method until IBM maybe updates something.

    • Keith
  • DataRaptor905
    DataRaptor905
    209 Posts

    Re: Ubuntu 6.10 and DB2 Express-C

    ‏2007-04-13T04:59:07Z  
    Hello,

    since today we have .deb archives in the Ubuntu repositories... this is solving automatically the necessary dependencies. And Ubuntu passed official validation for Db2 9 (not only Express-C).

    Further we tested already informal the new Feisty 7.04 Beta and the archives work and resolve the libraries without a hitch.

    here a link to the press release from Ubuntu:

    http://www.prweb.com/releases/2007/4/prweb518714.htm

    Boris

    Boris Bialek, db2x@ca.ibm.com
    DB2 Community Team
  • rsauer
    rsauer
    1 Post

    Re: Ubuntu 6.10 and DB2 Express-C

    ‏2007-04-13T05:05:29Z  
    My preferred variant is to launch DB2 tools as the current user after updating the local bash's profile via

    codesource /home/db2inst1/sqllib/db2profile[/code]

    After this command, i.e. db2cc is available like a charm.

    To make it even easier I set up an alias definition in my .bashrc

    codealias db2profile="source /home/db2inst1/sqllib/db2profile"[/code]

    Hope that helps,
    Robert
  • igorM
    igorM
    266 Posts

    Re: How to automaticaly start DB2 after reboot of Ubuntu Linux

    ‏2007-04-13T06:59:16Z  
    • ocgstyles
    • ‏2007-04-12T15:34:53Z
    Hi igorM,

    It looks like Ubuntu changed some things in the Edgy Eft release, that being inittab. Search in google for "inittab ubuntu" and you'll see what I'm talking about. So, because of the change, the fault monitor is not being started, hence the databases are not starting either.

    It looks like you are own for now to develop an autostart method until IBM maybe updates something.

    • Keith
    Hi,
    when ever I look into complex solution there is simpler one...

    I did the following:
    1. install Boot Manager GUI tool
    codesudo apt-get install bum[/code]

    2. Start GUI by System | Administration | BootUp-Manager

    3. List of available services are displayed. One of them is "db2". I checked "db2" check box and press "Apply" button.

    4. Reboot Linux and db2 is up and running!

    Thanks,
    IgorM
  • igorM
    igorM
    266 Posts

    Re: How to automaticaly start DB2 after reboot of Ubuntu Linux

    ‏2007-04-13T07:31:04Z  
    • igorM
    • ‏2007-04-13T06:59:16Z
    Hi,
    when ever I look into complex solution there is simpler one...

    I did the following:
    1. install Boot Manager GUI tool
    codesudo apt-get install bum[/code]

    2. Start GUI by System | Administration | BootUp-Manager

    3. List of available services are displayed. One of them is "db2". I checked "db2" check box and press "Apply" button.

    4. Reboot Linux and db2 is up and running!

    Thanks,
    IgorM
    Hi,
    BTW, I forgot to write, before downloading BootUp-Manager I downloaded script file from SuSe Linux for zSeries, saved as "db2" into /etc/init.d dir and assign privileges (chmod 777 db2):
    code
    #!/bin/sh

    case "$1" in
    start)
    /opt/ibm/db2/V9.1/instance/db2istrt
    ;;
    stop)
    kill -9 `ps -efa | grep db2wdog | grep -v grep | cut -c10-15`
    ;;
    *)
    echo $"Usage: $0 {start|stop}"
    exit 1
    esac

    exit 0
    [/code]

    Hope this helps anyone out there.
    Regards,
    IgorM
  • SystemAdmin
    SystemAdmin
    5837 Posts

    Re: How to automaticaly start DB2 after reboot of Ubuntu Linux

    ‏2007-08-22T22:23:35Z  
    • igorM
    • ‏2007-04-13T07:31:04Z
    Hi,
    BTW, I forgot to write, before downloading BootUp-Manager I downloaded script file from SuSe Linux for zSeries, saved as "db2" into /etc/init.d dir and assign privileges (chmod 777 db2):
    code
    #!/bin/sh

    case "$1" in
    start)
    /opt/ibm/db2/V9.1/instance/db2istrt
    ;;
    stop)
    kill -9 `ps -efa | grep db2wdog | grep -v grep | cut -c10-15`
    ;;
    *)
    echo $"Usage: $0 {start|stop}"
    exit 1
    esac

    exit 0
    [/code]

    Hope this helps anyone out there.
    Regards,
    IgorM
    Hi Igor,

    Using a kill -9 command to stop your DB2 processes is quite dangerous. Essentially, this command ends all DB2 activities without allowing the application to properly shut down.

    Here's what I would have for the startup script:

    #!/bin/sh
    #
    1. Script to start DB2 instance on bootup.
    #
    set -e

    . /lib/lsb/init-functions

    case "$1" in
    start)
    /opt/ibm/db2exc/V9.1/instance/db2istrt
    ;;
    stop|restart|reload)
    ;;
    esac

    exit 0


    Save this in the /etc/init.d directory, then give it appropriate permissions with:


    chown root.root
    chmod 755 db2


    This will properly start up all the DB2 instances on Ubuntu (if the DB2AUTOSTART=yes is not working).

    Cheers,
    Ian Hakes
    IBM DB2 UDB Express Community Facilitator
    Download DB2 Express-C 9
    Email: db2x@ca.ibm.com