一次执行可能不成功,建议多次执行
---------------------------------收缩---------------------------------------------
BACKUP LOG [dbName] TO DISK='NUL:' WITH RETAINDAYS= 1,COMPRESSION --dbName为数据库名
GO
USE [dbName]
GO
DBCC SHRINKFILE (dbName_log, 1); --收缩数据库日志文件,收到7M
----------------------------------查询--------------------------------------------
SELECT * FROM sys.database_files
SELECT name, physical_name AS CurrentLocation
FROM sys.master_files
WHERE database_id = DB_ID(N'dbName');