Table of Contents

DB2 initialization fails with Error 302

Symptom

The database format and initialization fails with an Error 302, the /var/tivoli/tsm/dsmicfgx.trc shows something like this:

Tue Nov 24 07:27:03 CET 2020 com.tivoli.dsm.ServerConfig.ServerDB.createDb2Instance(): Stdout: DB2 installation is being initialized.

The host name "h13-212" is invalid. Specify a valid host name.

A major error occurred during the execution that caused this program to 
terminate prematurely. If the problem persists, contact your technical service 
representative.

For more information see the DB2 installation log at 
"/tmp/db2icrt.log.21316".
DBI1446I  The db2icrt command is running.

DBI1446I  The db2icrt command is running.


DBI1264E  This program failed. Errors encountered during execution were
      written to the installation log file. Program name:
      db2icrt. Log file name: /tmp/db2icrt.log.21316.

Explanation: 

This message is returned when some processes and operations have failed.
Detailed information about the error was written to the log file.

User response: 

Contact IBM support to get assistance in resolving this issue. Keep the
log file intact as this file is an important reference for IBM support.

Tue Nov 24 07:27:03 CET 2020 com.tivoli.dsm.ServerConfig.ServerDB.createDb2Instance(): Stderr: 
Tue Nov 24 07:27:03 CET 2020 com.tivoli.dsm.ServerConfig.ServerDB.createDb2Instance(): exit, rc 302
Tue Nov 24 07:27:03 CET 2020 com.tivoli.dsm.ConfigWizard.DoFormatPanel.signalEvent(): enter, event=createInstanceDone, rc=302
Tue Nov 24 07:27:03 CET 2020 com.tivoli.dsm.ServerConfig.ServerDB$FormatThread.run(): exit

Explanation

As well the user ID as the hostname must follow some special rules:

Due to https://techiessite.com/error-occurred-creating-database-manager-instance-302-232/: Check ID of database user:

  1. User ID must be in lowercase(a-z)
  2. User ID can contain 0-9 numbers
  3. User ID can contain Underscores(_)
  4. User ID must be 30 Characters or less
  5. User ID should not start with ibm, sql, sys or numerals
  6. User ID or group name should not be any of these names user, admin, guest, public, local or any sql reserved words

Also check $hostname for the same rules, especially a hyphen (“-” ) is NOT allowed in the hostname!

Workaround

Check Prerequisites mentioned above and change.