SQL Server database to clear the log method

SQLSERVER database log occupies a lot of space, here are three ways to remove unwanted database log files.

Method One:
1. Open Query Analyzer, enter the command
the BACKUP LOG database_name the WITH NO_LOG
2, then open the Enterprise Manager - Right you want to compress the database - all tasks - shrink database - shrink file - Select the log file - xxm selected to shrink in the contraction mode, the minimum here will give a contract to allow the number m, direct input, it is determined.

Method two:
checkpointing disconnected automatically log

  normal circumstances, SQL database does not shrink greatly reduce the size of the database, its main role is to shrink the log size, it should be done routinely to avoid excessive database log
1, provided database mode to simple mode: open the SQL enterprise Manager, the root directory of the console in turn points to open Microsoft SQL server -> SQL server group -> double click to open your server -> double click to open database directory -> choose your the name of the database (such as user database cwbase1) -> then right click select properties -> options -> select "simple" reduction in the failure mode, then press OK save
2, right click on the current database, see All tasks shrink a database, the default settings generally do not adjust the inside, direct point to determine
3, shrink the database is completed, it is recommended that you reset the database properties as the standard model, methods of operation with the first point, because the log in some unusual circumstances under it is often an important basis for recovery of the database

Guess you like

Origin www.cnblogs.com/chinafly/p/11685017.html