如果 VPN 用于数据库会话,如何终止 Firebird (2.1) 附件/连接
我正在使用 VPN(Endpoint Security、Check Point)从计算机上的 IBExpert 建立与 Firebird 2.1 数据库的连接。有时我只是忘记断开与数据库的连接,而仅取消/断开 VPN 会话。
当我再次连接到 VPN 和数据库时,我可以在 mon$attachments 中看到以前的连接/附件仍然存在,并且其未解决的事务正在导致死锁错误(属于以前的附件 - 这可以通过以下方式精确验证)死锁错误的错误消息中报告的事务号)。
因此,VPN 有时会保留会话,而这些 VPN 会话会保留 Firebird 附件的存在。
有什么方法可以(使用 SYSDBA 连接)结束当前 Firebird 会话中的其他 Firebird 附件吗?
我已联系 VPN 管理员取消 VPN 会话,但这需要时间。数据库关闭是不可能的——数据库处于生产模式。因此,使用 SQL 结束 Firebird 附件是我剩下的唯一选择 - 如果这样的选项存在的话?
I am using VPN (Endpoint Security, Check Point) to establish connection to the Firebird 2.1 database from IBExpert on my computer. Sometimes I just forget disconnect from database and I cancel/disonnect VPN session only.
When I am connectiong once more to the VPN and database I can see in the mon$attachments that the previous connection/attachment is still existing and its unresolved transactions are causing deadlock errors (that belong to the previous attachment - this can be verified exactly by the transaction number that is reported in the error message of deadlock error).
So - VPN sometimes retains sessions and those VPN sessions keeps the Firebird attachments in existences.
Is there way how can I (using SYSDBA connection) end those other Firebird attachments from my current Firebird session?
I have contacted the VPN administrator to cancel VPN sessions, but it takes time. Database shutdown is out of the question - DB is in production mode. So, ending Firebird attachments using SQL is the only option left for me - if such option exists at all?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Firebird 2.5 及更高版本中,您可以从
MON$ATTACHMENTS
删除连接以终止连接。据我所知,Firebird 2.1 中的监控表不支持此功能。鉴于 Firebird 2.5 已经停产,而 Firebird 2.1 自 2014 年起也已停产,您确实应该考虑更新。
通常,Firebird 使用 SO_KEEPALIVE 套接字选项来检测死连接,但这可能需要很长时间(取决于您的操作系统配置)。另一种方法可能是将 firebird.conf 中的 dummy_packet_interval 配置为非零值(该值是秒,因此将其设置为合理的(读取,不要太低)值)。
In Firebird 2.5 and later, you can delete a connection from
MON$ATTACHMENTS
to kill a connection. This is not supported with the monitoring tables in Firebird 2.1 as far as I'm aware.Given even Firebird 2.5 is end-of-life, and Firebird 2.1 has been end-of-life since 2014, you should really consider updating.
Normally, Firebird uses the SO_KEEPALIVE socket option to detect dead connections, but this can take a long time (depending on your OS configuration). An alternative might be to configure
dummy_packet_interval
in firebird.conf to a non-zero value (the value is seconds, so set it to a reasonable (read, not too low) value).