views:

179

answers:

2

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?

+2  A: 

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.

Jonathan Kehayias
A: 

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.

Remus Rusanu