1

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 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

4
  • 1
    One clue would be in the error message, which you chose not to disclose.
    – mustaccio
    Commented Apr 14, 2023 at 12:51
  • Well, you cannot connect to a database if the instance is not started. Make sure you are running the commands (what you want is db2start, not db2stop) from the DB2 Command Window.
    – mustaccio
    Commented Apr 14, 2023 at 15:47
  • With db2start I get same error message of db2stop (SQL1390C The environment variable DB2INSTANCE is not defined or is invalid.) Commented Apr 14, 2023 at 17:12
  • Do you run these commands from the db2cwadmin.bat with elevated privileges? What appears in the db2diag.log file? Commented Apr 14, 2023 at 19:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.