I have always used cygwin interface on windows
upto v9 never had a problem
since I installed V9 there is something strange
db2 connect to xxx <<-- ok
db2 list tables for schema <<--- no database connection
in db2 command window I don't have this problem
this only occures with V9 and not with V7 or V8
tried it on different machines and same problem
Any idea ?
Thanks for all help/info
Best Regards, Guy Przytula
This topic has been locked.
Pinned topic db2 & cygwin
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Re: db2 & cygwin2006-08-03T21:17:45ZThis is the accepted answer. This is the accepted answer.Hi,
In DB2 9, since you can install multiple DB2 products on the same system, there have been some changes in the way command line works. I have cygwin on one of my test boxes, and I don't usually work in it, but I just tried it and this is what I saw:
- if I start up a bash shell within a normal CMD window, then try and connect to the sample db, I get "DB21061E Command line environment not initialized."
- if I start a bash shell from within a DB2 command window, I can connect to sample db without problems.
Try opening a DB2 Command Window from the start menu and then start your bash shell from in there, this should take care of the problem.
We use the db2cw.bat file from sqllib\bin to open a command window, so you might also be able to take a look in that batch file to see what env vars are being set to do the same thing in your bash window without running db2cw.bat. I have not tried this though.
DB2 Express Community team
sorry, spoke too soon2006-08-03T21:21:06ZThis is the accepted answer. This is the accepted answer.
Suggestion from DB2 development team2006-08-03T22:04:48ZThis is the accepted answer. This is the accepted answer.Hi,
A friend on the DB2 development team had this to say about your problem:
DB2 v9 has a different mechanism to figure out the PPID for a process. Have them try the following in their bash shell:
then run their DB2 commands
DB2 Express Community team
Re: Suggestion from DB2 development team2013-04-04T14:47:44ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Under Cygwin (settings below), I find that the persistent DB2 connection established with "db2 connect to ..." is preserved only for 5 seconds; that is, as long as successive db2 commands follow each other with less than 5 seconds in between, the connection is preserved; but when there is a break of more than 5 seconds, I get "SQL1024N A database connection does not exist. SQLSTATE=08003".
Is there a way to preserve the connection without such a short timeout, as under Unix and in the Windows command shell? This would help greatly to make admin scripts compatible between Cygwin and Unix/Linux.
Environment settings (1320 is the pid of the Cygwin bash shell):
$ set | grep DB2
$ type -a db2
db2 is /c/app/DB2_Express_9.7.5/bin/db2
Marcusyef 270006TGP41 Post
Re: Suggestion from DB2 development team2016-03-31T14:28:16ZThis is the accepted answer. This is the accepted answer.