locked
SMO- how to identify a server is a PrincipleServer/mirror server/witness server? RRS feed

  • Question

  • how to identify a server is a PrincipleServer/mirror server/witness server? 

    thanks, eric

    • Changed type Iric Wen Friday, March 2, 2012 7:04 AM
    Friday, February 24, 2012 11:59 AM

Answers

All replies

  • or maybe it is on the DB level,How? 

    thanks, eric

    Friday, February 24, 2012 11:59 AM
  • Hi

    you can get all the necessary info using below statement

    SELECT  @@servername as [Server Name],D.name as [Database Name],M.mirroring_partner_instance,M.*

    from msdb.sys.database_mirroring  M

    inner join sys.databases D on M.database_id=D.database_id

    where M.mirroring_partner_instance is not null


    Javier Villegas | @javier_villhttp://sql-javier-villegas.blogspot.com/

    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

    • Marked as answer by Iric Wen Friday, March 2, 2012 7:04 AM
    Friday, February 24, 2012 12:21 PM
  • Here's a good article on that with some options through the GUI and also using the sp_dbmmonitorresults stored proc: http://www.sqlserver-training.com/how-to-monitor-database-mirroring-sql-server/-

    • Marked as answer by Iric Wen Friday, March 2, 2012 7:04 AM
    Tuesday, February 28, 2012 8:01 PM