db2iupdt may not update fixpack level despite DBI1070I is returned - fsmegale/Db2-luw GitHub Wiki

This is a situation a saw and I am sharing here. This is not IBM official.

Problem

You run the db2iupdt to upgrade the fixpack level.

Although the db2iupdt returns the following in the prompt:

" DBI1070I Program db2iupdt completed successfully. "


And the db2iupdt log reports:

" The instance "db2inst1" has been updated successfully. "


But you see in the db2level and db2ilist that the instance wasn't upgraded to the fixpack you want and it was kept in the old fixpack.

Cause

In the situation I saw, the problem was a reference to the db2profile in the /etc/profile.

So, /etc/profile had the following line:

" . /opt/ibm/db2/db2home/sqllib/db2profile "

The /etc/profile makes all users load the libraries pointed there.

But Db2 documantion states the following:

" You must not source the Db2 instance environment for the root user. Running db2iupdt when you sourced the Db2 instance environment is not supported. "

db2iupdt - Update instances command
https://www.ibm.com/docs/en/db2/11.5?topic=commands-db2iupdt-update-instances


db2iupt really was run with success. But the initial expected upgrade of the instance wasn't done because of sourcing the instance environment (even partially) for the root.

Solution

Remove or comment out any reference to Db2 paths from /etc/profile and root's .profile


Example of Reproducing the problem and solving it

hostHADR1:/opt/ibm/db2/V11.5.4.0/instance # su - db2inst3

db2inst3@hostHADR1:~> db2level
DB21085I  This instance or install (instance name, where applicable:
"db2inst3") uses "64" bits and DB2 code release "SQL11054" with level
identifier "0605010F".
Informational tokens are "DB2 v11.5.4.0", "s2006161200", "DYN2006161200AMD64",
and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V11.5.4.0".

=========================================

//Added the following to /etc/profile:


. /home/db2inst3/sqllib/db2profile

----------------------------------------------------------


hostHADR1:/etc # cat profile |grep -i sqllib
. /home/db2inst3/sqllib/db2profile


========================================

hostHADR1:/etc # reboot now


=====================================

hostHADR1:/opt/ibm/db2/V11.5/instance # ./db2iupdt db2inst3
DBI1446I  The db2iupdt command is running.


DB2 installation is being initialized.

 Total number of tasks to be performed: 4
Total estimated time for all tasks to be performed: 309 second(s)

Task #1 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #1 end

Task #2 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #2 end

Task #3 start
Description: Configuring DB2 instances
Estimated time 300 second(s)
Task #3 end

Task #4 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #4 end

The execution completed successfully.

For more information see the DB2 installation log at "/tmp/db2iupdt.log.7846".
DBI1070I  Program db2iupdt completed successfully.


==========================================



//db2level still showing the old version:



hostHADR1:/opt/ibm/db2/V11.5/instance # su - db2inst3

db2inst3@hostHADR1:~> db2level
DB21085I  This instance or install (instance name, where applicable:
"db2inst3") uses "64" bits and DB2 code release "SQL11054" with level
identifier "0605010F".
Informational tokens are "DB2 v11.5.4.0", "s2006161200", "DYN2006161200AMD64",
and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V11.5.4.0".


//db2ilist shows that the instance wasn't upgraded:


hostHADR1:/opt/ibm/db2/V11.5/instance # ./db2ilist   //v11.5.7.0
db2inst1
db2inst2

hostHADR1:/opt/ibm/db2/V11.5.4.0/instance # ./db2ilist
db2inst3


============================================

I removed the following line from  /etc/profile


"
. /home/db2inst3/sqllib/db2profile
"


//Run db2iupdt again:


db2inst3@hostHADR1:~> su - db2inst3
Password:

db2inst3@hostHADR1:~> db2level
DB21085I  This instance or install (instance name, where applicable:
"db2inst3") uses "64" bits and DB2 code release "SQL11054" with level
identifier "0605010F".
Informational tokens are "DB2 v11.5.4.0", "s2006161200", "DYN2006161200AMD64",
and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V11.5.4.0".

db2inst3@hostHADR1:~> exit
logout

hostHADR1:~ # cd /opt/ibm/db2/V11.5/instance

hostHADR1:/opt/ibm/db2/V11.5/instance # ./db2iupdt db2inst3
DBI1446I  The db2iupdt command is running.


DB2 installation is being initialized.

 Total number of tasks to be performed: 4
Total estimated time for all tasks to be performed: 309 second(s)

Task #1 start
Description: Setting default global profile registry variables
Estimated time 1 second(s)
Task #1 end

Task #2 start
Description: Initializing instance list
Estimated time 5 second(s)
Task #2 end

Task #3 start
Description: Configuring DB2 instances
Estimated time 300 second(s)
Task #3 end

Task #4 start
Description: Updating global profile registry
Estimated time 3 second(s)
Task #4 end

The execution completed successfully.

For more information see the DB2 installation log at "/tmp/db2iupdt.log.47147".
DBI1070I  Program db2iupdt completed successfully.


======================================


//db2level and db2ilist shows the instance was upgraded, now:


hostHADR1:/opt/ibm/db2/V11.5/instance # su - db2inst3

[db2inst3@hostHADR1:~> db2level
DB21085I  This instance or install (instance name, where applicable:
"db2inst3") uses "64" bits and DB2 code release "SQL11057" with level
identifier "0608010F".
Informational tokens are "DB2 v11.5.7.0", "s2111221000", "DYN2111221000AMD64",
and Fix Pack "0".
Product is installed at "/opt/ibm/db2/V11.5".

hostHADR1:/opt/ibm/db2/V11.5/instance # ./db2ilist
db2inst1
db2inst2
db2inst3
⚠️ **GitHub.com Fallback** ⚠️