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.
5 replies Latest Post - 2013-04-04T14:47:44Z by SystemAdmin
Pinned topic db2 & cygwin
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-04-04T14:47:44Z at 2013-04-04T14:47:44Z by SystemAdmin
Re: db2 & cygwin2006-08-03T21:17:45Z in response to SystemAdminHi,
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
Suggestion from DB2 development team2006-08-03T22:04:48Z in response to SystemAdminHi,
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:44Z in response to SystemAdminSorry to bring up such an old thread again, but I have almost exactly the problem described here. I am using DB2 Express C 9.7.5 on 32-bit Windows 7 as a local client to connect to various DB2 servers of type DB2/NT64 9.7.5 (development systems) and DB2/AIX64 9.7.5 (test and production).
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