DB mirroring Database mirroring how-to topics - MSDN Database mirroring best practices and performance considerations Alerting on Database Mirroring Events Setting up Database Mirroring - MSDN Database Mirroring FAQ - TechNet small test DB endpoints: security, encryption select * from sys.tcp_endpoints select * from sys.database_mirroring_endpoints port 5022 - default firewall blocking ports prepare the mirror: restore with norecovery, restore TX log structural changes to DB adding a file if the mirror doesn't have identical drive letters, mirror will have to be re-done start with async, move to sync, move to sync with witness database snapshot ----------------------------------- Failover can only occur if synchronized, not if catching up after the mirror has been off high availability if the principal loses conntectivity with the mirror and the witness, it will stop serving the DB the mirror could have been in contact with the witness and been promoted to principal Failure: 10 network pings missed database page failed checksum and was rolling back: suspect DB, quick failover ---------------------------------- T-SQL commands CREATE ENDPOINT Mirroring STATE=STARTED AS TCP(LISTENER_IP=?, LISTENER_PORT=5022) FOR DATABASE_MIRRORING(ENCRYPTION=SUPPORTED, ROLE= WITNESS | PARTNER | ALL) GRANT CONNECT ON ENDPOINT::Mirroring TO ALTER DATABASE < > SET SAFETY ON ALTER DATABASE < > SET WITNESS ON ALTER DATABASE < > SET PARTNER = ALTER DATABASE < > SET WITNESS = select * from sys.database_mirroring ------------------------------------ WMI alerts and/or Event Notifications DATABASE_MIRRORING_STATE_CHANGE event Transparent client redirect connection string: Server=Sql1; Failover Partner=Sql2; Master and MSDB not propagated Send Queue - Unsent Log, Redo Queue - Unrestored Log