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