Pausing or Removing Database Mirroring

After configuring database mirroring, you can pause, resume, or remove database mirroring. If database mirroring impacts your applications performance, you may want to pause a database mirroring session and improve the performance. Pausing a database mirroring session causes the mirroring state to change to suspended. During this time the principal does not send any transactions to the mirror, and its principal database's transaction log keep growing, even if you schedule transaction log backups. The transaction log is not be truncated because it has to send the transactions to the mirror after the database mirroring session resumes.

To pause a database mirroring session using SQL Server Management Studio, follow these steps:

1. In the Object Explorer on the principal server in SQL Server Management Studio, right-click the principal database, and select Properties.
2. On the Mirroring page, as shown in Figure 27.8, click the Pause button.
3. You will be prompted for confirmation. Click Yes to confirm. This pauses the database mirroring session and changes the Pause button to Resume.
4. Click the Resume button to resume the database mirroring session.

To pause the database mirroring session for the AdventureWorks database in code, connect to either the principal or mirror server and execute the following:

ALTER DATABASE AdventureWorks SET PARTNER SUSPEND;

To resume the database mirroring session for the AdventureWorks database in code, ...

Get Microsoft SQL Server 2012 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.