Shrinking logs after SQL Server 2005 mirroring

Source: Internet
Author: User

The site of a database log file has reached the point of 150 g, the data file is dozens of m, through the normal operation to shrink the log:> database right → task → shrink → file, in the popup window, file type select "Log", shrink option Select Second, fill in a small number


Execution is complete quickly, but the log file size does not change.
There are two ways to complete the contraction: * Detach the database, delete the log file, and then attach the database * Modify the recovery mode of the database to * * * *, and then repeat the initial Shrink database operation (because the transaction is not truncated, so the size of the contraction in full mode is limited), after the completion of the recovery mode changed to * * Full**

After clicking OK, an error pops up:

Because it is an image server, you cannot do this, you can only fracture the mirror first, and then do the first step.

After canceling mirroring, the first step of shrinking the database operation, the log size successfully changed to about 2M, the contraction succeeds. Change the recovery mode to # #完整 # #
However, the mirror cannot be restarted because the host's database log and the standby database log do not agree.
The operation at this time is:>-the full backup database on the host-Copy the backup file to the standby, cancel the image of the standby machine, then restore the database, in the options, select**Do not perform any operations on the database ...**


After the host executes the ' SQLALTER DATABASEShishanSETPARTNER= 'tcp://192.168.1.2:5022';
```if the execution fails, the"SQL" for standby executionALTER DATABASEShishanSETPARTNER= 'tcp://192.168.1.1:5022';
After successful execution, you will:



Shrinking logs after SQL Server 2005 mirroring

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.