1. Identify your principal and mirror server. Optionally,
you may want a witness server.
2. For practice purposes, the above 3 instances can be on
the same server.
3. Take a full backup of the database on the principal
server.
4. Restore the backup on the mirror server with
"Restore with NoRecovery" option. Please remember the database name
has to be the same.
5. The servers or instances involved in DB mirroring must
trust each other. Each instance login must have rights to connect to the other mirroring
server and to its end points.
6. The next step is to create database mirroring endpoints.
You need admin rights for this. Endpoints need to be created on partner servers
as well as the witness server, if any. You can do this using the Configure Database
Mirroring Security Wizard, which you can invoke by clicking the Configure
Security button on the Mirroring page of the Database Properties dialog. Or
execute the CREATE ENDPOINT command using T-SQL. If you are setting up database
mirroring on a domain, and all SQL Server instances use the same service login
and password, you need not create logins on each server. This applies to
workgroup model as well. If all SQL Server instances use the same service login
and password, you do not need to create logins on the servers. Just leave the
logins blank on the Configure Database Mirroring Security Wizard. Each database
endpoint must specify a unique port on the server. When SQL Server instances
are on separate machines, these port numbers can be the same. The Configure
Database Mirroring Security Wizard will automatically suggest port 5022. If any
of the SQL Server instances are on the same machine, each instance must have a
distinct port and the port numbers must be unique.
7. Once you have set up the servers and the endpoints, you
can start database mirroring. You again need admin rights. This can be done
from Mirroring page of the Database Properties dialog or T-SQL.
Happy Mirroring