Article ID: 937531 - View products that this article applies to.
When you use database mirroring in Microsoft SQL Server 2005, SQL Server automatically propagates any changes on the principal database to the mirror database. However, if you run the DBCC SHRINKDATABASE statement or the DBCC SHRINKFILE statements to shrink the principal database, the shrink operation is not duplicated on the mirror database.
Database mirroring will change the physical file sizes only after a checkpoint.
Method 1To work around this problem, run the following statements to create a new stored procedure in the master database. Then, use this stored procedure to shrink the principal database instead of running the DBCC SHRINKDATABASE statement or the DBCC SHRINKFILE statement.
For example, if you want to shrink the mydb database, run the following statement.
Method 2Issue a manual checkpoint after shrinking the files on the principal.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Article ID: 937531 - Last Review: May 12, 2010 - Revision: 2.0
Contact us for more help
Connect with Answer Desk for expert help.