views:

312

answers:

3

I have a mirrored database and I need to make some changes to it. Mainly, adding a view and some stored procedures. Now I know that if you make schema changes you are supposed to remove mirroring and the mirror database, make your changes to the principal, then backup-restore the principal and restore mirroring. Is this the case for stored procedures and views as well? Can I just make my changes to the Principal, then Failover and make my changes to the mirror as well? What are the possible issues and ramifications from doing something like this? It just seems like a very tedious task to have to do every time we want to make a small change, mainly because the database is over 10 gigs so it takes a little while to back up and restore.

+6  A: 

If you are mirroring, you should be able to apply those changes to the principal and they show up on the mirrored side. If you want there to be schema difference between the two, you can't use mirroring. Are you looking to apply schema changes on just the mirrored database or to both? If both then you don't have to do anything special.

Strommy
It seems I was vastly misinformed. :)
Russ Bradberry
Happens to the best of us. ;-)
Strommy
+1  A: 

We have applied schema changes to both a logshipped and mirrored database and not had to take any special action.
Some forms of replication require special mesaures though.

pipTheGeek
+1  A: 

Now I know that if you make schema changes you are supposed to remove mirroring and the mirror database, make your changes to the principal, then backup-restore the principal and restore mirroring

This is actually wrong. The principal and mirror database are in fact a single database that is stored in two physical locations. Any and every change that occurs in the principal, occurs also in the mirror. They are literarly identical all the time.

So any schema changes, including tables, views, procedures, functions, schemas, database principals, assemblies and so on and so forth occur on both the principal and the mirror.

The only changes that require special attentions are changes that are related to the database but don't occur in the database: Agent jobs (they are in msdb), server principals (logins), replication settings (they are all over the place in database, msdb and distributor.

Remus Rusanu