SQL Server Express 空闲模式返回部分数据?

发布于 2024-07-09 09:21:13 字数 1456 浏览 10 评论 0原文

我正在尝试帮助我们的网络工程师为我们的一位客户解决问题。 该客户从名副其实的“夫妻店”供应商处购买了销售点系统,并且该供应商推荐 SQL Server Express 2005 作为后端数据库,以避免客户承担额外的许可费用。 (请不要让我开始说这个!)

我们没有编写该应用程序,并且因为它是一个商业应用程序,所以我们没有可用的源代码。 (并不是说如果我们这样做的话会对我们有帮助;这个东西是在 PowerBuilder 中构建的,所以我们没有相应的工具。)我们可以确定,该应用程序不执行自己的日志记录。 我们所要做的就是 SQL Server Express 自己的日志记录。

在该应用程序中,最终用户刷会员卡。 有时(一天几次),滑动不会从数据库返回数据。 屏幕上的消息将显示“未找到成员 123”。 (会员号码实际上是六位数字,“000123”。)随后立即重新扫描将正确返回会员数据。

我们已经消除了扫描仪本身的问题来源——它通常会扫描完整的六位数字。 对 SQL Server Express 日志的扫描表明它正在从空闲状态恢复到联机状态,通常是在扫描时(但也有每天的其他几次)。 (空闲模式是 在此解释。)

我知道按照 SQL Express 的方式分配/解除分配 RAM 是一个耗时的过程,特别是当我们谈论数百兆字节时有一段时间——情况似乎确实如此。

我们不确定的是我们是否取回了部分数据,或者应用程序是否只是无法连接到数据库并显示一般错误消息。 由于一切都是如此不透明,并且客户(出于明显的原因)不愿意付钱给我们坐在他们的设施中大约 8 个小时来亲眼目睹它的发生(也许使用网络监控/数据包嗅探工具),我们有点不知所措。

此时,我们建议将客户端升级到具有 5 个 CAL 的 SQL Server 2005 Workgroup Edition。 但这并不完全适合我作为这个问题的解决方案,因为我有理由确定没有 SQL Server 会返回部分数据 - 如果可以的话无法连接,无法连接。 (也就是说,我仍然推荐它,因为它解决了他们的许多其他问题!)

我对 Express 没有太多经验。 (除了本地开发之外,我从来没有将它用于任何其他用途,而且只在家里使用;我当然从来没有向我的客户推荐过它。)

我对那些可能有 Express 使用经验的人的问题是,您是否见过 SQL Express 返回 < 的实例em>部分数据,而不是应用程序本身造成的? 具体来说,您在从空闲模式返回时是否看到过这种行为?

(就其价值而言,我们倾向于认为该应用程序无法连接,仅显示一般错误消息,在连接时删除会员 ID 上的前导零。这似乎是最合理的答案 - 第三个问题可能是,你们同意这个评估吗?)

I'm attempting to help our network engineers troubleshoot a situation for one of our clients. This client purchased a point-of-sale system from quite literally a "mom-and-pop" vendor, and said vendor recommended SQL Server Express 2005 as the back-end database to save the client from having to incur extra licensing fees. (Please don't get me started on that!)

We didn't write the app, and because it's a commercial app, we have no source code available. (Not that it would help us if we did; the thing was built in PowerBuilder, so we don't have tooling for it.) The app does none of its own logging, that we can ascertain. All we have to go on is SQL Server Express's own logging.

In the application, an end user swipes a membership card. Occasionally (a few times a day), the swipe will not return data from the database. The message on screen will say, "Member 123 not found." (The member numbers are actually six digits, "000123.") A rescan immediately afterward returns the member data correctly.

We've eliminated the scanner itself as a source of issues -- it routinely scans the full six-digit number. A scan of SQL Server Express's log indicates that it is coming back online from being idle, often at the point of the scan (but also at several other times per day). (Idle mode is explained here.)

I understand that allocating/deallocating RAM the way SQL Express does is a time-consuming process, especially if we're talking about hundreds of megabytes at a time -- which appears to be the case.

What we're not sure of is whether or not we're getting back partial data, or if the app is simply failing to connect to the database and displaying a generic error message. Since everything is so opaque, and the client is (for obvious reasons) unwilling to pay us to sit in their facility for 8 hours or so to physically see it happen (perhaps with network monitoring/packet sniffing tools), we're kind of at a loss.

At this point, our recommendation is that the client upgrade to SQL Server 2005 Workgroup Edition, with 5 CALs. But that doesn't completely sit well with me as the solution to this issue, because I'm reasonably certain that no SQL Server ever returns partial data -- if you can't connect, you can't connect. (That said, I still recommend it because it's a solution to a number of their other issues!)

I don't have much experience with Express. (I never use it for anything but local development, and there only at home; I certainly never recommend it to my clients.)

My question to those who might have experience with Express is, have you ever seen an instance of SQL Express return partial data, without the app itself being the cause of it? Specifically, have you seen this behavior when returning from idle mode?

(For what it's worth, we're inclined to believe that the app is failing to connect and merely displaying a generic error message, lopping off leading zeroes on the member ID when it does. That seems the most reasonable answer -- a third question might be, do you guys concur with that assessment?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

温折酒 2024-07-16 09:21:13

我从未听说过或经历过 SQL Server Express 返回部分数据。 它本质上与完整的 SQL Server 具有相同的代码库。

应用程序更有可能由于 SQL Server Express 空闲而遇到超时(默认为 30 秒)。 应用程序可能会收到它没有预料到的超时并且无法很好地处理它。

此论坛主题中讨论了问题和可能的解决方案:http://social.msdn.microsoft.com/forums/en-US/sqlexpress/thread/a8fbf8d6-9949-47a5-a32b-50f8131f1127/

我怀疑你有一个连接字符串看起来像这样:

Data Source=.\SQLEXPRESS; Integrated Security=True;AttachDbFilename=|DataDirectory|\myDatabase.mdf;User Instance=True

来自引用的线程:

此连接字符串将导致
与主设备的初始连接
实例 (.\SQLEXPRESS) 然后
指示主实例生成一个
SQL Server 下的新实例
用户上下文并附加数据库
指定给该新用户实例。
用户实例是一个完整的
单独运行的 SQL 实例
服务器构成主实例
对于用户来说是唯一的
当不再有时关闭
与它的连接。

这完全不同
将数据库附加到主数据库
实例,它始终保持运行
次,除非您手动关闭它
向下。 如果您的问题是关于
主实例进入空闲状态
状态,那么你的问题不是
SQL Express 所独有的,您应该
在数据库中询问这个问题
引擎论坛。 我相信所有版本
的 SQL Server 处于空闲状态并且
另一个论坛是你可以的地方
了解如何影响该行为。

I've never heard of or experienced SQL Server Express returning partial data. It's essentially the same code base as the full SQL Server.

It is more likely that the application is experiencing a timeout (which defaults to 30 seconds) due to SQL Server Express going idle. The application probably receives a timeout that it does not expect and does not handle it well.

The problem and possible solutions are discussed in this forum thread: http://social.msdn.microsoft.com/forums/en-US/sqlexpress/thread/a8fbf8d6-9949-47a5-a32b-50f8131f1127/

I suspect you have a connection string that looks like this:

Data Source=.\SQLEXPRESS; Integrated Security=True;AttachDbFilename=|DataDirectory|\myDatabase.mdf;User Instance=True

From the referenced thread:

This connection string will cause an
initial connection to the main
instance (.\SQLEXPRESS) and then
instruct the main instance to spawn a
new instance of SQL Server under the
user's context and attach the database
specified to that new User Instance.
The User Instance is a completely
separate running instance of SQL
Server form the main instance that is
unique to the user and that will be
shut down when there are no longer any
connections to it.

This is totally different that
attaching a database to the main
instance, which stays running at all
times, unless you've manually shut it
down. If your question is about the
main instance going into an Idle
state, then your question is not
unique to SQL Express and you should
ask this question in the Database
Engine forum. I believe all Editions
of SQL Server have an Idle state and
the other forum would be where you can
find out how to affect that behavior.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文