The first step:
ALTER DATABASE DbName set recovery simple;
Step Two:
DBCC SHRINKFILE (' dbname_log ');
Step Three:
ALTER DATABASE DbName set recovery full;
--------------------------------------------------------------------------------------------------------------- ----------------------------------------------------
Explain:
In general, DBCC SHRINKFILE (' logical name of the log file of the database '); This one sentence can shrink the specified file. In other words, do not use the ALTER DATABASE .... set recovery simple;
This sentence. If you find yourself unable to shrink, then use the three steps above to take the tactics.
The logical name of this log file can be used here to get
Select Db_name (database_id) as dbname,name as [logical name],PHYSICAL_NAME [physical name] from Sys.master_files
where db_name (database_id) = ' db100 ';
Go
DBCC SHRINKFILE (' db100_log '); --Use this statement to shrink the log file for the db100 database.
To shrink a log file