I. Objectives
With SQL Server 2008 Enterprise X64, an asynchronous (high-performance) Mirrored database is established, and a witness server is established to automate failover.
Ii. preconditions, limitations and recommendations
2.1, Partners (principal and mirror servers) and witness servers must use the same version of SQL Server
2.2, such as using a witness server, choose to ensure that SQL Server is installed on its system or later
2.3, when creating a mirrored database on the mirror server, be sure to make the same database name with norebovory to restore the theme database backup. In addition, all log backups that were created after the backup was performed must also be applied through the with NORECOVERY. If database mirroring has stopped, all subsequent log backups performed on the principal database must be applied to the mirror database before the mirror can be restarted.
Database mirroring is not supported for 2.4, cross-database transactions, and distributed transactions
2.5, mirrored database path as much as the principal service, if the principal server CPU utilization of more than 50%, choose not to recommend the configuration of automatic failover
2.6, recommended to configure efficient and stable network environment
Iii. Setup Overview
3.1, make sure all database users have logins on the mirror server
3.2, before supplying a database to another server instance, you must establish the environment that the database needs for the new server instance on that server instance
3.3, use NORECOVERY to restore a full backup of the most recent principal database to create a mirrored database. Make sure that the principal database is using the full recovery model when the backup is performed. The mirror database and principal database names must be the same, and they cannot be renamed in the database mirroring session.
3.4, set security, and start the database mirroring session. You can use the Transact-SQL or Database Mirroring Wizard to set up mirroring.
3.5, optionally, adds a witness server to the session.
Iv. Install SQL Server 2008 Enterprise on Windows Server 2008 R2 X64
4.1, SQL Server 2008 requires. NET 3.5 support, so you need to install it before you install it. NET3.5. In the server-managed functional unit, add the. NET Framework 3.5.1 Features
4.2, install, select New SQL Server Standalone installation
4.3, select feature components, note that the installation directory is consistent with other nodes
4.4, using the default instance name, or the same as other nodes
4.5, set up service startup account, configure all, services are started with domain management
4.6, set up a mixed identity login, develop SQL Server administrator
4.7, click Next and wait for installation to complete. Install SQL Server the same way on other nodes
V. Database preparation before configuring database mirroring
5.1, confirm that the database uses the full Recovery model: Open SQL Server Management, right-click on the VIRTUALMANAGERDB database (the database that will be mirrored), and navigate to the Options page. Change the recovery model to "full"
5.2, Backup principal database: Right-click on VIRTUALMANAGERDB Database--task--Backup, backup type selection complete
5.3, copy the backup file to the mirror node and perform the restore. Right-click the database, select Restore Database
Select the backup file, write the restore database name, and note that the database name must be the same as the principal server database name. namely Virtualmanagerdb.
Click on the Options page to check to overwrite the existing database. Select Norecovery mode
5.4, perform a full log backup, execute BACKUP LOG virtualmanagerdb to Disk = ' C:\backup\vlogback.bak '
5.5, similarly, transaction log backups are restored on the mirrored database. On the mirror database, right-click--Task--Restore--transaction log
5.6, select Norecovery in the Restore option, and perform the restore operation.
At the end of the first section, let's start with the configuration mirroring connection!!