Following are the step by step configuration guide of mirroring.
Activity Task:
Steps to Configure :
Step 1- First take two servers- principal & mirror
The following dmv is used to check the database is involved in mirroring and to check the mirroring endpoint.
Mirror:
Step 2- create new database and table on principal server.
Step 4- now restore database at mirror server with norecovery option.
5. Drop and Create New Endpoints on Principle and Mirror Server.
Step 6- now start mirroring , first go created database on principal server, right click- >task->mirror
Step 9-now select mirror server name & click next.
Step10- leave this option blank at it is and click on next.
Step 7- No to the witness server
Step 8- Confirm endpoints & the principle server then Select Next
Step10- leave this option blank at it is and click on next.
Step11- now finish job and you can see there all three jobs status success, now click on close.
Step 12-now you can see there start mirroring pop up, click start mirroring.
Step13- Check the Database States on both server.
Step 14- if mirroring is successful then you can see there failover option, when your principal server does not working that time witness server help failover occur, in this situation principal become mirror, and mirror become principal.
Advantages of Database Mirroring:
- Database Mirroring architecture is more robust and efficient than Database Log Shipping. It can be configured to replicate the changes synchronously to minimized data loss.
- It has automatic server failover and client failover mechanism.
- Configuration is simpler than log shipping and replication, and has built-in network encryption support (AES algorithm).
- Because propagation can be done asynchronously, it requires less bandwidth than synchronous method (e.g. host-based replication, clustering) and is not limited by geographical distance with current technology.
- Database mirroring supports full-text catalogs.
- Do not need any singular hardware.
Disadvantages of Database Mirroring:
- Data loss is possible,if it is in asynchronous operation mode.
- User operation is not possible in the mirror server/database.
- Late delay possibilities can occur during data transfer.
- Delay possibilities can only be prevented with a good hardware.
- SQL Server database mirroring can only be possible in full recovery mode.