0

I'm unable to connect to db2 server using db2cmd command

db2 connect to mydb user myuser using password

Getting the following message

SQL8002N An attempt to connect to a host failed due to a missing DB2 Connect product or invalid license. SQLSTATE=42968

But I have successfully connected to this database using jdbc and I can view the structure.

Has anybody experienced such issue?

Andrew
  • 51
  • 1
  • 6
  • did u check ur product lisence – Sam Jun 18 '13 at 09:34
  • My local license is fine as I can access another databases. I have issue with this one. The question is why it is allowed to connect using jdbc but not db2cmd. Doesn't jdbc driver use licenses? – Andrew Jun 18 '13 at 10:14

2 Answers2

1

Are you trying to connect to a iSeries o z/390? or just a LUW (Linux, Unix Windows?)

If you are trying to connect to one of the two first, you need a DB2 Connect license, because they use the DRDA architecture, and it uses a special license.

Check the license

db2licm -a

If you are trying to connect to a LUW, you do not need any DB2 connect license, but probably there is a problem in you cataloged databases. Check the

db2 list node diretory
db2 list db directory

Is the database a remote server or is it a local connection?

Also, try to attach to the remote instance, in order to check that the node catalog is right

db2 attach to remoteInstance
AngocA
  • 7,655
  • 6
  • 39
  • 55
  • This is remote db running on z/os. I've added license for DB2 Connect Enterprise Edition V9.5 for Windows(R) as you adviced and it worked. Thanks! – Andrew Jun 19 '13 at 10:20
0

As the error message says, you need DB2 Connect to serve as a gateway for CLI connections. The JDBC driver does not need the gateway, as it implements the required protocol.

mustaccio
  • 18,234
  • 16
  • 48
  • 57