SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Principal and replica databases
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 09/26/2013 :  05:03:34  Show Profile  Reply with Quote
Hi all

Is there an easy way (or script) that will allow me to ensure that all the indices on the principal database (and all the tables) are in place on the mirror?

We've got several hundred tables to check and I'm looking for the most efficient way of doing it.

Any help gratefully received.

robvolk
Most Valuable Yak

USA
15683 Posts

Posted - 09/26/2013 :  07:06:02  Show Profile  Visit robvolk's Homepage  Reply with Quote
If you're talking about database mirroring or availability groups, you don't need to check the mirror/replica. As long as they are fully synchronized they will be identical.
Go to Top of Page

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 09/26/2013 :  07:35:10  Show Profile  Reply with Quote
That was my unserstanding, but it's not the case.
I've managed to list all the indices on the principal and there a quite a few missing on the mirror (maybe mirror isn't the right term?).
I'm not sure what the setup is but surely this can't be right?
Go to Top of Page

robvolk
Most Valuable Yak

USA
15683 Posts

Posted - 09/26/2013 :  20:16:11  Show Profile  Visit robvolk's Homepage  Reply with Quote
More likely you are using replication. If you were mirroring you wouldn't be able to read the replica as it's in a restoring state. You'd also see "Mirror" in Management Studio next to the database name, plus the status (Synchronized, Synchronizing, Disconnected).

I'd suggest running sp_helppublication, this will list your replication objects if there are any. There's more detail about it here: http://technet.microsoft.com/en-us/library/ms189782.aspx
Go to Top of Page

rmg1
Constraint Violating Yak Guru

256 Posts

Posted - 09/27/2013 :  03:31:27  Show Profile  Reply with Quote
Thanks for that, I'll have a bit more of a dig and see what I can find.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000