跨数据库访问同一服务器上的表
我们有一个庞大的应用程序分布在多个数据库中。在几个地方,我们需要从 DB2 中的存储过程更新 DB1 中表中的数据。到目前为止,我们正在通过 DB2 中创建的视图从 DB1 访问该表。然而,随着时间的推移和数据量的增加,性能开始恶化,并且我们在此过程中遇到了很多死锁。我们已经在 DB1 的表上设置了正确的索引。我们当前使用的是 SQL Server 2008,并且这两个数据库实际上驻留在同一台服务器上。
任何实用的建议将非常感激!
We have a huge application spread across multiple databases. At couple of places we need to update the data in a table in DB1 from a stored proc in DB2. As of now, we are accessing the table from DB1 via a view created in DB2. However, as the time passes by and data volume goes the performance starts to deteriorate and we are getting a lot of deadlocks on this procedure. we have got the right indexes being set on table in DB1. We are currently using SQL Server 2008 and physically both the database reside on the same server.
Any practical advise would be really appreciate !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用同义词而不是视图。;不确定为什么使用视图会导致死锁,但在这种情况下,SYNONYM 提供了更清晰的抽象接口。
Use a SYNONYM instead of a view.; not sure why the use of a view would be causing deadlocks, but in this case a SYNONYM provides a cleaner interface for abstraction.