IBM DB2 Connector Core 的 iSeries 连接错误 [英] iSeries connection error with IBM DB2 Connector Core

查看:72
本文介绍了IBM DB2 Connector Core 的 iSeries 连接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们从 .NET 框架迁移到 .NET 核心时,我们不得不将 iSeries 连接字符串的格式从使用 Server= 更改为使用 Data source= 和包括端口#,但我们也必须包括 Database= 因为没有它,由于无效参数",连接字符串无法分配给连接.例外.对于数据库来说绝对是任何东西,我们总是得到一个统一的错误消息:

When we migrated from .NET framework to .NET core, we had to change the format of our iSeries connection string from using Server= to using Data source= and to include port#, but also we had to include Database= because without it the connection string could not be assigned to a connection due to an "Invalid argument" exception. With absolutely anything for a database, we always get a uniform error message:

ERROR [08004] [IBM] SQL30061N  The database alias or database name "QSYS              " was not found at the remote node.

(注意数据库名称中的额外空格)

(Notice extra spaces in the DB name)

无论我们为数据库提供什么,错误总是一样的.我们尝试了类似于DSPLIBQSYS 等报告的app0123 的实际库名称.

No matter what we supply for a database, the error is always the same. We tried our actual library name similar to app0123 that is reported by DSPLIB or QSYS etc.

我们还尝试了由 DSPRDBDIRE 报告的与 IHST0123 类似的数据库,但在这种情况下,错误是不同的:

We also tried databases reported by DSPRDBDIRE named similarly to IHST0123 but in this case the error was different:

ERROR [42968] [IBM] SQL1598N 由于许可问题,尝试连接到数据库服务器失败.

ERROR [42968] [IBM] SQL1598N An attempt to connect to the database server failed because of a licensing problem.

我们知道服务器不存在许可问题,因为 Java 和 C# 中的许多应用程序都连接到我们的生产环境.

We know that there is no licensing problem with the server because it is our production environment that many applications in Java and C# connect to.

我们通常的做法是,如果一个应用App1连接,它使用app1用户名和app01app02 等模式,app01 是默认模式.因此,我们在连接字符串中只有像 IHST01 这样的 iSeries 主机名,并且我们通过连接字符串生成器添加了用户 ID 和密码.

Our usual practice is that if an application App1 connects, it uses app1 user name and app01, app02 etc schemas, app01 being the default one. Therefore, we only ever had the iSeries host name like IHST01 etc in the connection string, and we added user ID and password through the connection string builder.

我们通过 .NET 核心连接器连接到 DB2 LUW 没有任何问题,因为其上的数据库非常明显和明确.由于我们从来不必在 .NET 框架下指定 iSeries 数据库,因此不清楚它必须是什么.有人知道吗?

We are having no issues connecting through .NET core connector to DB2 LUW since database on it is very apparent and unambiguous. Since we never had to specify an iSeries database under .NET framework, it is not clear what it has to be. Does anybody know?

推荐答案

库(又名架构)名称不是数据库名称.

The library (aka schema) name is not the database name.

DSPRDBDIRE 中的 *LOCAL 条目应该是您的数据库名称.

The *LOCAL entry in DSPRDBDIRE should be your DB name.

更好的工具是 IBM Access Client Soultions (ACS)数据库 --> 模式";具有如下 UI 的工具:

A better tool is IBM Access Client Soultions (ACS) "Database -->Schemas" tool which has a UI like so:

在连接的服务器(ut29p63.rch.stglabs.ibm.com)上,(至少)有两个数据库:

On the connected server (ut29p63.rch.stglabs.ibm.com), there are (at least) two databases:

  • ut29p63
  • 数据库测试

我很惊讶您认为 .NET Framework 或 Java 不需要数据库名称,因为我一直需要它们.如果您的 IBM i 上只有一个数据库(这在较小的机器上很常见),则 DB 名称可能与系统名称匹配.

I'm surprised you don't think the DB name was needed for .NET Framework or Java as I've always needed them. If you've only got one database on your IBM i, as is common for smaller boxes, it's possible the DB name matches the system name.

从许可错误消息来看,您正在连接.

Judging from the license error message, you are getting connected.

但是,.NET Core nuget 包使用 IBM Db2 Connect 驱动程序.此驱动程序包含在 Db2 for LUW 中,并具有适当的可选许可证,允许连接到 IBM Db2 for i 或 IBM Db2 for z/OS.

However, the .NET Core nuget packages use the IBM Db2 Connect driver. This driver is included for Db2 for LUW, and with an appropriate and optional license allows connecting to IBM Db2 for i or IBM Db2 for z/OS.

换句话说,Db2 Connect 驱动程序始终可以连接到 Db2 LUW,但您必须支付增强的许可证才能连接到 IBM i 或 IBM z/OS.请参阅 IBM Db2 Connect 许可类型 您需要一个 Enterprise许可证或 System i 的无限版.

In other words, the Db2 Connect driver can always connect to Db2 LUW but you'll have to pay for an enhanced license to connect to IBM i or IBM z/OS. See IBM Db2 Connect License Types You'll need an Enterprise license or an Unlimited Edition for System i.

如果您为 .NET Framework 使用 Db2 Connect 驱动程序,则相同的许可证将适用于 .NET Core(假设 Db2 Connect 版本匹配).

If you were using Db2 Connect driver for your .NET Framework, the same license will work for .NET Core (assuming the Db2 Connect versions match).

但是,如果您使用的是 .NET Framework 的免费 ODBC/OLEDB/ADO 驱动程序,那么您将需要 .NET Core 的 Db2 Connect 许可证.

However, if you were using the free ODBC/OLEDB/ADO driver for .NET Framework, then you'll need the Db2 Connect license for .NET Core.

这篇关于IBM DB2 Connector Core 的 iSeries 连接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆