--進入需要收縮的資料庫,擷取資料檔案名,日志名,因為這些名字不一定和資料庫名一緻,但執行DBCC的時候又需要
select * from sysfiles
--截斷事務日志,這個地方寫資料庫名,非檔案名
backup log common with no_log
go
--收縮日志檔案
dbcc shrinkfile(bi_log)
--進入需要收縮的資料庫,擷取資料檔案名,日志名,因為這些名字不一定和資料庫名一緻,但執行DBCC的時候又需要
select * from sysfiles
--截斷事務日志,這個地方寫資料庫名,非檔案名
backup log common with no_log
go
--收縮日志檔案
dbcc shrinkfile(bi_log)