Sorry I haven’t posted in a little while. October was a 250 hour month with a critical customer project and the IBM Information OnDemand Conference (IOD – you know all about IOD from Kim). My VP of Biz Dev is all about trying to make her “number”, so it’s been busy.
The Fillmore Group is an IBM Authorized Training Partner (ATP) so we use a product called Acronis to create a single image of our student lab machines and then deploy that image to multiple PCs. Since these are Windows XP PCs running DB2 9 for Linux, Unix, Windows Fixpack (FP) 2, the computer name must be unique within the domain. However, once you change the computer name, DB2 stops working. The common error is SQL1042C. Here’s how to fix that problem.
First, there is a file in each DB2 instance subdirectory (e.g. “c:\Program Files\IBM\SQLLIB\DB2”) called db2nodes.cfg; in this post we’re only going to address single-node (i.e. not Data Partitioning Feature or DPF) databases. Open this file for each DB2 instance on the server – I use WordPad – and change the imbedded hostname to the current computer name for that PC. The same hostname will be repeated twice on a single line in the db2nodes.cfg file. Change both. This used to be all you needed to do to fix the problem. Now, there are a few more steps.
If you installed using the extended operating system security option, you likely will now receive an SQL1652N file I/O error. In DB2 9.1 FP 2, support was added for domain userids and groups. Use the db2extsec command to correct the authorities for the installation-defined groups DB2ADMNS and DB2USERS. For example, let’s say the PC image was created using a computer name of TFGXP01. We’ve deployed this image to another PC and changed the Windows computer name to TFGXP02. Enter the command:
db2extsec -a TFGXP02\DB2ADMNS -u TFGXP02\DB2USERS
The last step involves correcting the DB2 registry variables. Use the db2set -all command to examine the current registry variables. In our example, you likely will have seen three variables with TFGXP01 as part of the value. Issue the following commands:
db2set db2accountname=TFGXP02\db2admin
db2set db2instowner=TFGXP02
db2set db2system=TFGXP02
At this point, you should be able to start the DB2 instances.
Very useful, thanks much.
Has this been updated for 9.5? I don’t see a db2nodes.cfg file to change, nor do I have a db2extsec executable, it seems…
Adam – I am not sure they have been updated…I will check with Frank and ask him to post an update if needed. Time flies…
Hi, I need to change the hostname of my DB2 Server 9.5, I tried to run his procedure, but I’ve have problems:
1. I don’t find the db2nodes.cfg file.
2. I run the commands “db2set” and db2extsec,
old_hostname: SIETE2003
new_Hostname: VS3K-MONBANCO1
->cmd
->db2cmd
->db2admin stop
->db2stop
->db2set -g DB2SYSTEM=VS3K-MONBANCO1
->db2set -g DB2_EXTSECURITY=NO
->db2set –all
->db2 list admin node directory show detail
->db2 uncatalog node SIETE200
->db2 catalog admin tcpip node VS3KMONB remote VS3K-MONBANCO1 system VS3K-MONBANCO1
->db2 update admin cfg using DB2SYSTEM VS3K-MONBANCO1
->db2 update admin cfg using SMTP_SERVER VS3K-MONBANCO1
–>change the hosstname
->cmd
->db2cmd
->db2admin stop
->db2extsec -a VS3K-MONBANCO1\DB2ADMNS -u VS3K-MONBANCO1\DB2USERS
->db2admin start
->db2start
And when finish I have in “Control Center DB2” two systems, SIETE2003 with the Instance, and VS3K-MONBANCO1 without instances.
How do you can to my current instances work on new system VS3K-MONBANCO1?
Thanks for your help.
I have the same problem as Diana. In local control center (im on windows machine) i can see two systems now: the old and new one. However the old system doesnt exists anymore if you do the node list. Nor you can find it VIA remote database administration tool, everything discovers and adds fine with that new name. Databases work fine for my applications as well.
I just can’t run any commands for my databases on that local machine because both CLP and the Control Center thinks all instances are still belong to that old system and hostname 😐
Don’t you know what this could be? Thank you very much in advance.
I am having a similar problem. There does not appear to be a db2nodes.cfg file on the db2 server anywhere.
I used acronis to grab an image of our live server and put it on an identical machine(with less memory). When disconnected from our domain, due to the duplicate computer name, There are some expected authentication issues since the DC cannot be contacted. If I change the server’s name and reconnect to our network, I receive the SQL1042C error you mentioned.
Just for those who find this site first:
Windows XP and 2003 running DB2 v9.5:
Documents and Settings\All Users\Application Data\IBM\DB2\\DB2\db2nodes.cfg
Resource:
http://www-01.ibm.com/support/docview.wss?uid=swg21258834
I am facing “SQL1652N File I/O error occurred” when doing DB2START. This problem occured after server crash. Any help would be appreciated.. Thanks
Brilliant. This saved me big time, as I had tried a million other things without success. Thanks so much for posting this!!!!
Hello,
I can neither find the db2nodes.cfg nor do any of the commands posted by Diana Moreno work on my WinXP, DB29.5 env. When I enter any of the db2set commands in the commandline, I just get an error dialog saying it will close.
Any suggestions?
Confirmed all steps with DB2 v9.7 FP1 and FP2 (x64) on Windows 2008 SP1 (x64).
The reason you can’t find db2nodes.cfg on a windows server is that it doesn’t have any file associations for .cfg files. Use the findstr command to find files with the old hostname in it: findstr /i /m /s “” :\*.*
I have installed DB2-9 suucessfully.
Can you tell me how to start DB@ through cmd.
DB2 V9.7 FP5
Windows 7 Professional
1. My db2nodes.cfg was in a different location:
C:\ProgramData\IBM\DB2\DB2COPY1\DB2\db2nodes.cfg
I made the recommended edits there.
2. I only had two variables that had the old hostname / machine-name in there:
db2set db2instowner=
db2set db2system=
After those minor differences, DB2 started correctly, and no longer gets the SQL1042C error, and works correctly. Thanks!
I couldn’t find db2nodes.cfg on Windows 7 Enterprise. On further searching found:
C:\ProgramData\IBM\DB2\DB2COPY1\DB2\db2nodes.cfg