0

I have installed an Enterprise version of DB2 on my local Windows 11 pro laptop for some development tasks. Installation proceeded without errors but, it seems I cannot connect using TCP. If I try to stop/start from the admin console, it says I do not have set the environment variables even if I try to printout it works.

This is what I can see with db2set -all

C:\Windows\System32>db2set -all
[e] DB2PATH=C:\Program Files\IBM\SQLLIB
[i] DB2INSTOWNER=LAPTOP-HBU9NEC4
[i] DB2PORTRANGE=20000:20005
[i] DB2INSTPROF=C:\PROGRAMDATA\IBM\DB2\DB2COPY1
[i] DB2COMM=TCPIP
[g] DB2_EXTSECURITY=YES
[g] DB2_COMMON_APP_DATA_PATH=C:\ProgramData
[g] DB2SYSTEM=LAPTOP-HBU9NEC4
[g] DB2PATH=C:\Program Files\IBM\SQLLIB
[g] DB2INSTDEF=DB2
[g] DB2ADMINSERVER=DB2DAS00

When I try to stop (and start) the DB I get

C:\> db2stop
SQL1390C  The environment variable DB2INSTANCE is not defined or is invalid.

I tried to print the DB2INSTACE and I get this:

C:\>echo %DB2INSTANCE%
DB2

This is what I get if I try to create a sample DB

C:\>db2 create database TEST001
SQL1032N  No start database manager command was issued.  SQLSTATE=57019

Any clue? Thanks

Andrea Girardi
  • 366
  • 3
  • 6
  • Db2 doesn't play nice in MS Windows if you already have another client runtime or another Db2 version installed. BTW, which version did you installed? – adamitj Apr 14 '23 at 17:43
  • As long as you have a "currently supported" version of Db2-server installed on Windows-11, it will work just fine. Your question does not indicate the version, you should use the `db2level` command to give the complete version. Your errors happen because you need to run any db2 command in a special window that gets opened when you run the command `db2cwadmin.bat` (which opens an elevated cmd.exe type window in which you can use `db2` commands). – mao Jun 02 '23 at 14:18

1 Answers1

0

Not sure if this will fix your problem without knowing the Db2 Version you installed neither if you already have other versions and editions of the Db2 database installed in the same workstation.

However, try to update the default Db2 instance, there's a program under Db2 application folder (old Start Menu folder). Then select the last version you installed (even if there is only 1 entry) and go Next Next Finish till the end.

(I don't have Windows here to test, but I know it is there).

adamitj
  • 113
  • 4