SQLServer clear LOG log file data

SQL Server storage document

SQL Server stores documents in three categories: .mdf, .ldf, and .ndf

SQL Server storage document definition

.mdf is the database data file, which stores the data information
of the database ; .ldf is the database log file (transaction log), which stores the information of the database operation data, which contains (new data, modify data, delete data, etc.) ;
.Ndf is the secondary data file and contains all data files except the main data file. Some databases may not have secondary data files, while some databases have multiple secondary data files.

Clear the ldf file in SQL Server to 1MB

--切到DATABASENAME_Log的启动项
ALTER DATABASE DATABASENAME SET RECOVERY SIMPLE;  --清空日志
DBCC SHRINKFILE (DATABASENAME_Log, 1);  --收缩数据库到1MB

Guess you like

Origin blog.csdn.net/qq_37697566/article/details/113102463