使用 SQL Server 镜像时是否会镜像 CLR DLL?

发布于 2024-07-26 08:19:56 字数 162 浏览 4 评论 0原文

我有一个 SQL Server 数据库(2008),其中有一些 SQL 用于各种用途的 CLR DLL。

当我使用 SQL 镜像时,这些 DLL 是否会被镜像? 我们的 DBA 说不是,但我觉得这很疯狂,并且在网上找不到太多相关信息。

是否可以镜像 CLR DLL?

I have a SQL Server database (2008) within which I have some CLR DLLs that SQL uses for various things.

Are these DLLs mirrored when I use SQL Mirroring? Our DBA says not, but I find this crazy and cannot find much info on it online.

Is it possible to mirror the CLR DLLs?

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

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

发布评论

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

评论(2

蓝天白云 2024-08-02 08:19:56

CLR 程序集存储在数据库中,并镜像为数据库的一部分。 每个数据库都有自己的 sys.assemblies 视图,如果您查询 master.sys.assemblies DMV,则不会在 DMV 中找到其他数据库的程序集。 在镜像包含程序集的数据库时,您可能会遇到一些问题。 第一个是,如果您有外部访问或不安全的程序集,并且您使用了 TRUSTWORTY 位来允许数据库中的程序集,则在故障转移时的恢复过程中该功能将被禁用,因此您必须重新启用它。 如果您使用证书对程序集进行签名,则必须手动创建与镜像服务器上的程序集关联的证书和登录名,因为它存储在 master 中,而不是数据库中。 程序集将在那里,您的 SQL 数据库对象也会在那里,但它可能无法运行。 作为故障转移的一部分,您可能还需要更改数据库所有者名称。

http://sqlblog.com/blogs/jonathan_kehayias/archive/2008/03/06/clr-safety-issues-after-database-restore-to-new-server.aspx

如果您想验证我上面说的,备份用户数据库及其上的程序集,然后将其恢复到另一台服务器。 您的程序集将成为数据库的一部分。

CLR Assemblies are stored in the database, and are mirrored as a part of the database. Each database has its own sys.assemblies view, and if you query the master.sys.assemblies DMV, you won't find the assemblies for other databases in the DMV. There are problems that you may encounter with having a database with assemblies in it mirrored. The first being, if you have an External Access or UNSAFE assembly and you used the TRUSTWORTY bit to allow the assembly in your database, this is disabled during the recovery process when you failover, so you have to re-enable it. If you signed the assembly with a certificate you have to create the certificate and login associated with the assembly on the mirrored server manually since this is stored in master, not in the database. The Assembly will be there, and so will your SQL Database Objects, but it may not function. You may also need to change the database owner name as a part of the failover.

http://sqlblog.com/blogs/jonathan_kehayias/archive/2008/03/06/clr-safety-issues-after-database-restore-to-new-server.aspx

If you want to validate what I say above, backup the user database with an assembly on it, and restore it to another server. Your assembly will be a part of the database.

鲜血染红嫁衣 2024-08-02 08:19:56

只是为了补充 Jonathan 所说的显而易见的一点:您的程序集必须部署在镜像应用程序数据库中,而不是部署在 msdb 或其他数据库中。

Just to add the obvious point to what Jonathan said: your assemblies have to be deployed in the mirrored application database, not in msdb or some other database.

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