db2 update to version 9.5 crashes existing installation

Bug #189538 reported by Norbert Munkel
8
Affects Status Importance Assigned to Milestone
db2exc (Ubuntu)
Fix Released
Undecided
Brian Thomason
db2exc-amd64 (Ubuntu)
Fix Released
Undecided
Brian Thomason

Bug Description

If you have already installed DB2 Version 9.0 and upgrade to Version 9.5 you will encounter some problems with your existing installation:

Reason: 9.5 is a full point release, not just a fixpack. This differs from previous Versions of DB2 (e.g. Versions 7 and 8). Migration of existing Data is needed.

What happens?

1. The existing instance "db2inst1" created during the installation of 9.0 will stop operating. All symbolic links in ~db2inst1/sqllib are inoperative as the target directory "/opt/ibm/db2/V9.0/ is removed by the update.

2. A new instance (user) "db2inst2" is created by the script. This instance is fully operational.

I find this behaviour kind of critical as running production databases might be affected.

The following workaround can help with getting the instance db2inst1 up and running again:

# kill all processes of user db2inst1 or reboot first
# then

su - db2inst1
rm -rf sqllib
exit
sudo /opt/ibm/db2/V9.5/instance/db2icrt -u db2inst1 db2inst1
su - db2inst1
#
db2 update dbm cfg using svcename <portname>
db2start
db2 catalog database sample (repeat for other datbases)
db2 migrate database sample

Another way to recover would be restoring a previous backup image to the newly created instance.

I would highly recommend to change the update skript in respect of this changed db2 behaviour. 9.0 will be supported with separate Fixpacks by IBM. However, 9.5 offers really great new features and would be my recommended choice over 9.0. A working upgrade/migration script should be feasible. Youre welcome to get back to me if I can be of any help.

I have just tested this with db2exc-amd64 but this should be a problem on all platforms.

description: updated
Revision history for this message
Antony Jones (wrh) wrote :

I would like to agree that this is a very serious problem.

I use db2 for work and have just encountered (after upgrading to 9.5 as suggested by ubuntu update) all my existing databases not working, I can't reinstall, I can't remove, I'm completely stuck now.

Preparing to replace db2exc 9.5.0-1gutsy1 (using .../db2exc_9.5.0-1gutsy1_i386.deb) ...
Unpacking replacement db2exc ...
dpkg: warning - old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
dpkg: error processing /var/cache/apt/archives/db2exc_9.5.0-1gutsy1_i386.deb (--unpack):
 subprocess new post-removal script returned error exit status 1
dpkg: error while cleaning up:
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/db2exc_9.5.0-1gutsy1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I would like to revert back to 9.1.2 or even stick with 9.5, but instead I'm stuck completely...

Revision history for this message
Norbert Munkel (norbert-munkel) wrote : Re: [Bug 189538] Re: db2 update to version 9.5 crashes existing installation

Have you tried my suggested method? If you at least remember the names
of your databases you should be able to get access to your databases
with the installed 9.5 version. db2's automatic crash recovery should
hopefully do the rest.

Not very funny indeed.

Antony Jones schrieb:
> I would like to agree that this is a very serious problem.
>
> I use db2 for work and have just encountered (after upgrading to 9.5 as
> suggested by ubuntu update) all my existing databases not working, I
> can't reinstall, I can't remove, I'm completely stuck now.
>
> Preparing to replace db2exc 9.5.0-1gutsy1 (using .../db2exc_9.5.0-1gutsy1_i386.deb) ...
> Unpacking replacement db2exc ...
> dpkg: warning - old post-removal script returned error exit status 1
> dpkg - trying script from the new package instead ...
> dpkg: error processing /var/cache/apt/archives/db2exc_9.5.0-1gutsy1_i386.deb (--unpack):
> subprocess new post-removal script returned error exit status 1
> dpkg: error while cleaning up:
> subprocess post-removal script returned error exit status 1
> Errors were encountered while processing:
> /var/cache/apt/archives/db2exc_9.5.0-1gutsy1_i386.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> I would like to revert back to 9.1.2 or even stick with 9.5, but instead
> I'm stuck completely...
>

Revision history for this message
Antony Jones (wrh) wrote :

Upon installing 9.5 and getting a 'database directory not found' message I immediately tried to remove the package, intending to revert back to the older one.

Of course I can't, because of the errors listed above. I'd love to use your method Norbert, but it isn't possible with my system in its current state.

Revision history for this message
Norbert Munkel (norbert-munkel) wrote :

Antony,

nothings really lost yet. In your case I would suggest to get the free
db2-express-c package directly from IBM and install it using the
commandline tool "db2_install" instead of the graphical "db2setup". This
will only copy the files to /opt/ibm/db2/V9.5 without changing any
instance-settings. You should then be able to go on with my method.

regards,

Norbert

Antony Jones schrieb:
> Upon installing 9.5 and getting a 'database directory not found' message
> I immediately tried to remove the package, intending to revert back to
> the older one.
>
> Of course I can't, because of the errors listed above. I'd love to use
> your method Norbert, but it isn't possible with my system in its current
> state.
>

Revision history for this message
Jordi Mallach (jordi) wrote :

Regarding the postrm failure you people are seeing, you can have a look at the patch I just sent to bug #191656

Changed in db2exc:
assignee: nobody → brian-thomason
Changed in db2exc-amd64:
assignee: nobody → brian-thomason
Revision history for this message
Antony Jones (wrh) wrote :

This problem has plagued me before and now - upgrading to Ubuntu 8.04 has done it again!

db2exc - can't remove it or install it. I'm using 9.2 version because db2exc 9.5 is VERY, VERY different than 9.2 and is innapropriate for my work.

Anyway it's killed my upgrade and now my laptop is ruined (again) - i'm having to manually hack stuff to remove db2exc. What a painful experience!

Revision history for this message
Antony Jones (wrh) wrote :

Okay I finally fixed it. How I did it was this:

edited /var/dpkg/info/db2exc.prerm

commented out the line:

dasUser=$instDir/instance/daslist

then ran dpkg -r db2exc

I ran the daslist command myself a few times but there was no output. No idea why it was failing, but it was. The scripts for removing db2 need to be a lot less fragile I think.

Revision history for this message
Brian Thomason (brian-thomason) wrote :

This has been fixed in 9.5 for Hardy.

Changed in db2exc:
status: New → Fix Released
Changed in db2exc-amd64:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.