清除数据库日志方法
语法
USE DATABASENAME; GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE DATABASENAME SET RECOVERY SIMPLE;
GO
-- Shrink the trun cated log file to 1 MB.
DBCC SHRINKFILE (DATABASENAME_Log, 1); GO
-- Reset the database recovery model.
ALTER DATABASE DATABASENAME SET RECOVERY FULL; GO
示例:
USE ZL_GETDATA
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE ZL_GETDATA SET RECOVERY SIMPLE
GO
-- Shrink the trun cated log file to 1 MB.
DBCC SHRINKFILE (ZL_DB_log, 1)
GO
-- Reset the database recovery model.
ALTER DATABASE ZL_GETDATA SET RECOVERY FULL
GO
select * from sys.database_files
该文章经过本人整理所得,欢迎转载,转载时请加上本文地址;本文基于署名 2.5 中国大陆许可协议发布,请勿演绎或用于商业目的,但是必须保留本文的署名张志涛(包含链接如您有任何疑问或者授权方面的协商,请给我留言。