DB29501E means a Db2 tool found something wrong with the environment it was started in. In the case IBM documents, on Windows, the text after the message names DB2INSTANCE, and the fix is to set that environment variable to the name of an instance that exists:
db2ilist
setx DB2INSTANCE DB2 /M
db2ilist lists your instances; replace DB2 with one of the names it prints. Open a new command window afterwards, because setx does not change windows that are already open.
What the message says
The full text is:
DB29501E DB2 has detected an inconsistent environment.
Please investigate the following: "DB2INSTANCE -2029059916"
The message is generic. IBM's explanation is that an error in the operating environment was detected, caused by an inconsistent Db2 or operating system environment, and that you should correct the problem named in the message and run the command again. The quoted part is the useful bit: it tells you which setting the tool could not resolve.
When that part reads DB2INSTANCE, IBM's support note for this error gives the cause directly: the DB2INSTANCE environment variable is not set to a valid instance name. The variable is needed to start the Control Center and the Db2 JDBC applet server service on Windows.
If the quoted part names something other than DB2INSTANCE, the steps below do not apply. Investigate the setting it names instead.
Where you will see it today
This message comes from the Java-based administration tools, chiefly the Db2 Control Center. The Control Center was deprecated in Db2 9.7 and removed in Db2 10.1. So:
- On Db2 9.x, you see
DB29501Ewhen opening the Control Center after an install whereDB2INSTANCEwas never set, or was set to an instance that has since been dropped. - On Db2 10.1 and later, the Control Center does not exist. If a Start menu shortcut or script still tries to launch it (
db2cc), it belongs to an older Db2 copy on the machine. Use a current tool instead: the Db2 command line, IBM Data Management Console, or a SQL client such as DBeaver.
On current versions, the same root cause shows up under a different message when you run commands:
