Thursday, 20 November 2014

DB2 - Still 8 characters after all these years ...

So I'm more than familiar with systems that are "limited" to 8 characters, but I didn't expect DB2 to have the same limitation, leastways not in 2014 :-)

This came up using DB2 Enterprise Server Edition 10.1.0.3 on AIX, but I've since recreated it using DB2 on Red Hat Enterprise Linux 6.6 as well.

The problem occurs when I tried to create a DB2 instance against an Unix user ID that's 9 characters long.

This is because I'm hosting 10 instances on one OS - db2inst1 through db2inst10.

Therefore, all are the same length APART from db2inst10 which is: -

db2inst10
^^^^^^^^^
|||||||||
123456789

9 characters in length.

When I try and create the 10th instance: -

/opt/ibm/db2/V10.1/instance/db2icrt -a SERVER -u db2fenc10 db2inst10

I get: -

DBI1446I  The db2icrt command is running, please wait.

DB2 installation is being initialized.
 
DBI1131E  The user ID db2inst1 is invalid.

Explanation: 

An attempt to access the given user ID failed. One of the following
situations has occurred: 
*  This user ID does not exist on the system.
*  The home directory of this user is not set up properly.
*  One of the user attributes needed by DB2 is unset.
*  The UID of this user is 0

User response: 

Make sure a valid user ID with valid home directory, shell, primary
group and secondary group has been used. Create a new user if necessary.

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.2716".
DBI1264E  Errors were encountered in running db2icrt. Please
      refer to the installation log file /tmp/db2icrt.log.2716 for more
      information.

Explanation: 

All processed and failed operations have been saved into this log file.

User response: 

Do not modify this file in any way. This file is for IBM Technical
Support reference.

Note that the exception has truncated the user ID to 8 characters :-(

Just for the record, here's my two 9-character user IDs; fenced user and instance owner.

cat /etc/passwd

...
db2fenc10:x:503:504::/home/db2fenc10:/bin/bash
db2inst10:x:504:505::/home/db2inst10:/bin/bash
...

In the case of the AIX environment, I already had db2inst1 created: -

/opt/ibm/db2/V10.1/instance/db2ilist 

db2inst1

so I instead see this: -

DBI1446I  The db2icrt command is running, please wait.

DB2 installation is being initialized.

 The instance "db2inst1" already exists. Specify a new instance 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.12179".
DBI1264E  Errors were encountered in running db2icrt. Please
      refer to the installation log file /tmp/db2icrt.log.12179 for more
      information.

Explanation: 

All processed and failed operations have been saved into this log file.

User response: 

Do not modify this file in any way. This file is for IBM Technical
Support reference.


Bottom line, I appear to be stalled if I want to use a 9-character instance name, so I'm now reduced to using hexadecimal ( Base 16 ), giving me db2insta instead of db2inst10.

Which is nice :-)

No comments: