1. Environment Preparation
confirm that two machines have a stable intranet environment with enough bandwidth to have the same version of Windows and SQL Server.
Verify that the SQL Server ports for the two machines are open in the firewall and can access each other, and that both SQL Server (MSSQLSERVER) and SQL Server Agent (MSSQLSERVER) services are started automatically.
SQL Server mirroring needs to be recognized with a computer name, so you need to add the domain name resolution of the computer name to the Hosts file by:
View the computer name in the system, for example, in the computer named "Bw-crawlerdbbak", this machine has an IP of 192.168.1.26.
650) this.width=650; "border=" 0 "width=" 797 "height=" 516 "src="/e/u261/themes/default/images/spacer.gif "alt=" CID: image001.png@01ce9812.1da1f670 "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") no-repeat center;border:1px solid #ddd; "/>
You need to add the domain name resolution for both machines for the two C:\Windows\system32\drivers\etc\hosts files that are mirroring, for example, add the following two columns:
168.1.22 Bw-crawlerdb
168.1.26 Bw-crawlerdbbak
D) establish a Windows user on both machines, the user name and password on both machines need to be identical, generally using the user name bw_db_mirror_user, password bw_10 group. This user does not need to belong to any additional Windows user groups.
e) the SQL Server (MSSQLSERVER) service that sets up two machines is started with the Windows user established above, and the SQL Server service requires a restart of two machines after the setup is complete.
SQL Server Database Mirroring essay