--Force principal to failover to mirror while in high-safety mode (execute on principal) ALTER DATABASE AdventureWorks2008 SET PARTNER FAILOVER --Force mirror to take over while in high-performance mode (execute on mirror, must not have connectivity with principal) ALTER DATABASE AdventureWorks2008 SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS --Will need to resume mirroring after --Force resume of mirroring ALTER DATABASE AdventureWorks2008 SET PARTNER RESUME --Pause mirroring (puts DB in suspended) ALTER DATABASE AdventureWorks2008 SET PARTNER SUSPEND --Stop mirroring (bring a server online that has lost quorum, disaster situation where mirror and witness are offline) ALTER DATABASE AdventureWorks2008 SET PARTNER OFF --Grant the service account access to the mirroring endpoint GRANT CONNECT on ENDPOINT:: Mirroring TO [INSTANCE\USERNAME] --Adjust mirroring failover timeout to 90 seconds ALTER DATABASE AdventureWorks2008 SET PARTNER TIMEOUT 90 --Mirroring metadata --Mirroring status, role, safety level and witness status. One row for each mirrord DB in this instance. SELECT * FROM sys.database_mirroring --Information about mirroring endpoints SELECT * FROM sys.database_mirroring_endpoints --One row for each witness role in this instance SELECT * FROM sys.database_mirroring_witnesses --Create/Configure mirroring --Update mirroring status table in msdb. EXEC msdb..sp_dbmmonitorupdate --Creates SQL Agent jobs to update MSDB tables with mirroring stats EXEC msdb..sp_dbmmonitoraddmonitoring --Change update interval for SQL Agent job that updates mirroring stats EXEC msdb..sp_dbmmonitorchangemonitoring 1,1 --Returns current update interval (which is set using above) EXEC msdb..sp_dbmmonitorhelpmonitoring --Stops and removes SQL agent job for updating stats EXEC msdb..sp_dbmmonitordropmonitoring --Alternative to database mirroring monitor. Same information, but text based EXEC msdb..sp_dbmmonitorresults 'AdventureWorks2008', 0 , 0 --Check for existing endpoints SELECT name, role_desc, state_desc FROM sys.database_mirroring_endpoints --Endpoints use windows authentication by default --Create endpoint on principal CREATE ENDPOINT mirroring STATE = STARTED AS TCP ( LISTENER_PORT = 7575) FOR DATABASE_MIRRORING (ROLE=PARTNER) --Create mirror server endpoint CREATE ENDPOINT mirroring STATE = STARTED AS TCP ( LISTENER_PORT = 7575 ) FOR DATABASE_MIRRORING (ROLE=PARTNER) --Create witness server endpoint CREATE ENDPOINT mirroring STATE = STARTED AS TCP ( LISTENER_PORT = 7575) FOR DATABASE_MIRRORING (ROLE=WITNESS) --Drop an endpoint DROP ENDPOINT mirroring