IBM Support

[Db2] Setup.exe might fail to upgrade existing Db2 copy with the error "The upgrade of the instance "<instance>" has failed."

Troubleshooting


Problem

Upgrade of an existing Db2 copy might fail due to disk full on the drive where your temporary directory is located, even if you have plenty of free space on the disk.
Db2val command shows the upgrade of the Db2 copy is successfully, however upgrade of one or more Db2 Instances are failing.

Symptom

1. Free space on the drive where the temporary directory is located will rapidly decrease while setup.exe is running.
2. Error message pops up when the drive becomes full.
setuperror1.png
The following error appears in the middle of the setup log. 
Action 18:45:21: DB2CustomAction. Configuring DB2 instances
1: ERROR:The upgrade of the instance "DB2_01" has failed. The return value is "1".
 
1: ERROR:An error occurred while configuring the instance "DB2_01".
 
Action 18:48:24: DB2CustomAction. Configuring DB2 instances
1: Configuring DB2 instances:.......Failure 
1: WARNING: A minor error occurred while installing "DB2 Server Edition - DB2COPY1" on this computer. Some features may not function correctly. 
Setup log can be found under "C:\Users\Administrator\Documents\DB2LOG" by default, which name is something like "DB2-SERVER-Mon Jun 13 14_13_42 2022.log".

3. db2val -a command reports successful.
DBI1343I The db2val command completed successfully. For details, see the log file C:\Users\Administrator\DOCUME~1\DB2LOG\db2val-Mon Jun 13 15_00_25 2022.log.
4.  Database manager configuration release level in get dbm cfg output remains unchanged.
For example, the following output shows release level 0x1400, which indicates the instance is still in V11.1. This should be 0x1500 if the upgrade to V11.5 was successful.
c:\Work>db2 get dbm cfg

          Database Manager Configuration

     Node type = Database Server with local and remote clients

 Database manager configuration release level            = 0x1400
...

 

Cause

The command db2iupgrade.exe invoked by the Db2 setup wizard (setup.exe) back up all the files and folders under db2instprof\instance_name to the installation user's temporary directory.
Here, db2instprof is the path stored in the DB2INSTPROF registry variable, and instance_name is the name of your Db2 Instance.
(By default, db2instprof\instance_name and installation user's temp directory are "C:\ProgramData\IBM\DB2\DB2COPY1\DB2" and "C:\Users\Administrator\AppData\Local\Temp" respectively.)

For this reason, if you have large files under db2instprof\instance_name directory, the upgrade might take longer than expected, and it can even fail if the installation user's temporary directory becomes full.
This is likely the case when you have Local database directory and db2instprof on the same directory.
In the following example, our instance name is "DB2_01", and we have the path "F:\" in variable DB2INSTPROF. 
We also have the Local database directory under "F:\", so both Local database directory and db2instprof\instance_name share the same path "F:\DB2_01". 
In this case, all the files under the Local database directory will be copied into the user's temporary directory, and cause the disk full.
C:\Program Files\IBM\SQLLIB\BIN>set DB2INSTANCE=DB2_01 <-- Our Instance name is "DB2_01".

C:\Program Files\IBM\SQLLIB\BIN>db2set -all
[e] DB2PATH=C:\Program Files\IBM\SQLLIB
[i] DB2INSTOWNER=WIN-LLM41VO9H4D
[i] DB2PORTRANGE=60006:60009
[i] DB2INSTPROF=F:\ <-------------------- db2instprof of the instance.
[g] DB2_EXTSECURITY=YES
[g] DB2_COMMON_APP_DATA_PATH=C:\ProgramData
[g] DB2SYSTEM=WIN-LLM41VO9H4D
[g] DB2PATH=C:\Program Files\IBM\SQLLIB
[g] DB2INSTDEF=DB2
[g] DB2ADMINSERVER=DB2DAS00

C:\Program Files\IBM\SQLLIB\BIN>echo %TMP%
C:\Users\ADMINI~1\AppData\Local\Temp <--- Installation user's temporary directory.

C:\Program Files\IBM\SQLLIB\BIN>echo %TEMP%
C:\Users\ADMINI~1\AppData\Local\Temp <--- Installation user's temporary directory.
C:\Program Files\IBM\SQLLIB\BIN>db2 list db directory

 System Database Directory

 Number of entries in the directory = 9

Database 1 entry:

 Database alias                       = SAMPL1
 Database name                        = SAMPL1
 Local database directory             = F: <--------
 Database release level               = 14.00
 Comment                              =
 Directory entry type                 = Indirect
 Catalog database partition number    = 0
 Alternate server hostname            =
 Alternate server port number         =
Following is the directory structure under "F:\".
Here, the files and directories under "F:\DB2_01\NODE0000" are associated with the Local database directory.
All the other files and directories under "F:\DB2_01" contains the instance level information related to the instance "DB2_01". 
C:\Program Files\IBM\SQLLIB\BIN>tree F:
Folder PATH listing
Volume serial number is 00000250 16DD:B42D
F:\
├───DB2_01
│   ├───cfg
│   ├───ctrl
│   ├───DIAG0000
│   │   ├───clientrecords
│   │   ├───events
│   │   └───stmmlog
│   ├───hmonCache
│   │   └───DB2_01
│   │       └───0
│   │           └───ossipcres
│   ├───log
│   ├───NODE0000
│   │   ├───SAMPL1
│   │   │   ├───T0000000 <--- Tablespace ID 0.
│   │   │   ├───T0000001 <--- Tablespace ID 1.
│   │   │   │   └───C0000000.TMP
│   │   │   ├───T0000002 <--- Tablespace ID 2.
│   │   │   ├───T0000003 <--- Tablespace ID 3.
│   │   │   └───T0000004 <--- Tablespace ID 4.
...
│   │   ├───SQL00001
│   │   │   ├───HADR
│   │   │   │   ├───LOGSPOOL
│   │   │   │   └───TAKEOVER
│   │   │   ├───LOGSTREAM0000
│   │   │   └───MEMBER0000
│   │   │       ├───DB2EVENT
│   │   │       │   └───db2detaildeadlock
│   │   │       └───HADR
│   │   │           ├───LOGSPOOL
│   │   │           └───TAKEOVER
...
│   │   └───SQLDBDIR <------ Local database directory
│   ├───security
│   │   └───auditdata
│   ├───SQLDBDIR <---------- System database directory
│   ├───TMP
│   └───UIF
└───function
    └───unfenced

Resolving The Problem

Plan A.
Drop and re-create the Instance that failed to upgrade.
 
1. Start "DB2 Command Window - Administrator" and set DB2INSTANCE to the instance name that failed to upgrade.
C:\Program Files\IBM\SQLLIB\BIN>set DB2INSTANCE=DB2_01
2. Back up the configurations of this instance and databases, clients, by using db2cfexp.exe.
C:\Program Files\IBM\SQLLIB\BIN>db2cfexp C:\Work\db2cfexp.out backup
3. Drop the instance.
C:\Program Files\IBM\SQLLIB\BIN>db2idrop DB2_01
4. Create the instance. Change the db2profile path to avoid the problem in the future. (Use the option "/p:")
C:\Program Files\IBM\SQLLIB\BIN>db2icrt DB2_01 /s:ese /u:db2admin,password /p:"C:"
5. Edit the db2cfexp.exe output, and change the path in the variable DB2INSTPROF and DIAGPATH. (CF_DIAGPATH is for Unix & Linux only)
C:\Program Files\IBM\SQLLIB\BIN>type C:\Work\db2cfexp.out
;Use BINARY file transfer

[FILE_DESCRIPTION]
APPLICATION=DB2/NT64 1.5.8
FILE_CONTENT=DB2 CCA Exported Data Sources
FILE_TYPE=CommonServer
FILE_FORMAT_VERSION=2.0
Platform=23
DB2SYSTEM=WIN-LLM41VO9H4D
Instance=DB2_01

[REGISTRY_GLOBAL]
DB2_EXTSECURITY=YES
DB2_COMMON_APP_DATA_PATH=C:\ProgramData
DB2SYSTEM=WIN-LLM41VO9H4D
DB2PATH=C:\Program Files\IBM\SQLLIB
DB2INSTDEF=DB2
DB2ADMINSERVER=DB2DAS00

[REGISTRY_LOCAL]
DB2INSTOWNER=WIN-LLM41VO9H4D
DB2PORTRANGE=60006:60009
DB2INSTPROF=F:\ <-- Change this path. eg. C:\
DB2COMM=TCPIP

[DBM_CONFIG]
NODETYPE=4
RELEASE=0x1400
DIAGLEVEL=3
ALTERNATE_AUTH_ENC=255
RQRIOBLK=65535
AUTHENTICATION=0
DIR_CACHE=1
DISCOVER=2
TP_MON_NAME=
DIAGPATH=F:\DB2_01\ $m <-- Change this path. eg. C:\DB2_01\ $m
...
CF_DIAGLEVEL=2
CF_DIAGPATH=F:\DB2_01\DIAG0000\ <-- Change this. eg. C:\DB2_01\DIAG0000\
CF_TRANSPORT_METHOD=0
COMM_EXIT_LIST=
6. Apply the modified db2cfexp.exe output by using db2cfimp.exe.
C:\Program Files\IBM\SQLLIB\BIN>db2cfimp C:\Work\db2cfexp.out
Plan B.
Change the location of the installation user's temporary directory to a drive large enough to copy all the files under db2instprof\instance_name, and run the db2iupgrade command manually.
1. To change the installation user's temporary directory, follow the steps below.
  1. From the Windows Start menu click System.
  2. Click Advanced system settings on the left panel.
  3. Click the advanced tab.
  4. Click the button labeled Environment Variables.
  5. Change both TMP and TEMP under "User variables for installation user".
  6. Restart Window for the new value to take effect.
2. Start "DB2 Command Window - Administrator" and set DB2INSTANCE to the instance name that failed to upgrade.
C:\Program Files\IBM\SQLLIB\BIN>set DB2INSTANCE=DB2_01
3. Run db2cfexp.exe to back up the configurations.
C:\Program Files\IBM\SQLLIB\BIN>db2cfexp C:\Work\db2cfexp.out backup
4. Write out the configurations to files by using CLP.
db2set -all > db2set_all_1.txt
db2 get dbm cfg > get_dbm_cfg_1.txt
db2 list user odbc data sources > list_user_odbc_data_sources_1.txt
db2 list system odbc data sources > list_system_odbc_data_sources_1.txt
db2 get cli cfg > get_cli_cfg_1.txt
db2 list db directory > list_db_directory_1.txt
db2 list dcs directory > list_dcs_directory_1.txt
db2 list node directory > list_node_directory_1.txt
5. Run db2iupgrade.exe manually against the Db2 instance that failed to upgrade.
C:\Program Files\IBM\SQLLIB\BIN>db2iupgrade -install -forcecn /u:<user>,<password> <instance_name> /p:"<db2instprof>"
eg.
C:\Program Files\IBM\SQLLIB\BIN>db2iupgrade -install -forcecn /u:db2admin,password DB2_01 /p:"F:"
DB20000I  The DB2IUPGRADE command completed successfully.
6. Compare the new configurations with the old configurations. 
db2set -all > db2set_all_2.txt
db2 get dbm cfg > get_dbm_cfg_2.txt
db2 list user odbc data sources > list_user_odbc_data_sources_2.txt
db2 list system odbc data sources > list_system_odbc_data_sources_2.txt
db2 get cli cfg > get_cli_cfg_2.txt
db2 list db directory > list_db_directory_2.txt
db2 list dcs directory > list_dcs_directory_2.txt
db2 list node directory > list_node_directory_2.txt

fc /1 db2set_all_1.txt db2set_all_2.txt
fc /1 get_dbm_cfg_1.txt get_dbm_cfg_2.txt
fc /1 list_user_odbc_data_sources_1.txt list_user_odbc_data_sources_2.txt
fc /1 list_system_odbc_data_sources_1.txt list_system_odbc_data_sources_2.txt
fc /1 get_cli_cfg_1.txt get_cli_cfg_2.txt
fc /1 list_db_directory_1.txt list_db_directory_2.txt
fc /1 list_dcs_directory_1.txt list_dcs_directory_2.txt
fc /1 list_node_directory_1.txt list_node_directory_2.txt
The following output shows the instance is now V11.5.
C:\Program Files\IBM\SQLLIB\BIN>db2 get dbm cfg

          Database Manager Configuration

     Node type = Enterprise Server Edition with local and remote clients

 Database manager configuration release level            = 0x1500 <------ V11.5
...
You can restore the old configurations if necessary by using db2cfimp command.
C:\Program Files\IBM\SQLLIB\BIN>db2cfimp C:\Work\db2cfexp.out

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PknAAE","label":"Install\/Migrate\/Upgrade"}],"ARM Case Number":"TS009500130","Platform":[{"code":"PF033","label":"Windows"}],"Version":"11.5.0"}]

Document Information

Modified date:
05 December 2022

UID

ibm16614407