The method is as follows:1. first, make sure to back up the database to reduce or clear the database with log files) 2. right-click the database, select and open the "properties" window, find the "option" column, and change "complete" in the fault recovery to "simple ". For example: 650) this. width = 650; "alt =" 1 "class =" alignnone size-full wp-image-373 "height =" 514 "src =" http://www.weixianfei.com/wp-content/uploads/2013/05/1.png "width =" 727 "style =" border: none; max-width: 688px; box-shadow: rgb (153,153,153) 1px 1px 3px; "/> select" simple "and click" OK "to close the window. 3. right-click the database and select "shrink Database" from "all tasks", for example, 650) this. width = 650; "alt =" 2 "class =" alignnone size-full wp-image-374 "height =" 404 "src =" http://www.weixianfei.com/wp-content/uploads/2013/05/2.png "width =" 393 "style =" border: none; max-width: 688px; box-shadow: rgb (153,153,153) 1px 1px 3px; "/> 4. click "file" in the lower right corner. In the upper right corner of the window, select "xxxxxx_log" as the database file, for example, 650) this. width = 650; "alt =" 3 "class =" alignnone size-full wp-image-375 "he Ight = "429" src = "http://www.weixianfei.com/wp-content/uploads/2013/05/3.png" width = "447" style = "border: none; max-width: 688px; box-shadow: rgb (153,153,153) 1px 1px 3px; "/> 5. after the xxxxx_log file is selected, keep other options as default. Click "OK" and wait until the Contraction ends. A message is displayed after the end. You can close the window. Return to the directory where the database is stored, and you can see that the log file of the database has obviously become smaller, for example, <size before contraction>: 650) this. width = 650; "alt =" 6 "class =" alignnone size-full wp-image-381 "height =" 56 "src =" http://www.weixianfei.com/wp-content/uploads/2013/05/6.png "width =" 403 "style =" border: none; max-width: 688px; box-shadow: rgb (153,153,153) 1px 1px 3px; "/> <size after contraction>: 650) this. width = 650; "alt =" 4 "class =" alignnone size-full wp-image-376 "height =" 47 "src =" http://www.weix Ianfei.com/wp-content/uploads/2013/05/4.png "width =" 365 "style =" border: none; max-width: 688px; box-shadow: rgb (153,153,153) 1px 1px 3px; "/> check the log file size, indicating that the log file content of the database has been safely cleared !!! ~~ 6. After the contraction operation is completed, you must refer to "Step 2" to change the "fault recovery" model to "complete "! Other optional operations: 1. A database can also be created when a database is created.) it is best to limit the log file size and growth mode in advance, for example, 650) this. width = 650; "alt =" 5 "class =" alignnone size-full wp-image-377 "height =" 489 "src =" http://www.weixianfei.com/wp-content/uploads/2013/05/5.png "width =" 503 "style =" border: none; max-width: 688px; box-shadow: rgb (153,153,153) 1px 1px 3px; "/> the settings here vary greatly depending on the database application, generally, it is appropriate to set the "Maximum file size" of a log file to 1 GB (1024 MB. Of course, there is no fixed standard. In addition, we recommend that you regularly check the size of log files and perform a database contraction operation as needed! This is really a good habit and Operation Method !~
This article is from the "YYJCWXF sanmao)" blog, please be sure to keep this source http://weixianfei.blog.51cto.com/950271/1193300