清理SQLServer数据库日志
程序员文章站
2022-04-12 19:57:46
手动清理: D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log
语句清理: ALTER...
手动清理: D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log
语句清理: ALTER DATABASE 数据库 SET RECOVERY SIMPLE ALTER DATABASE 数据库 SET RECOVERY FULL DBCC SHRINKDATABASE (数据库, 0)
Tempdb事务日志满了之后,可以在没有回话占用tempdb的时候,使用下面的语句收缩日志
use tempdb
go
dbcc shrinkfile (tempdev, 'target size in MB')
go
-- this command shrinks the primary data file
dbcc shrinkfile (templog, 'target size in MB')
go
-- this command shrinks the log file, look at the last paragraph.
语句清理: ALTER DATABASE 数据库 SET RECOVERY SIMPLE ALTER DATABASE 数据库 SET RECOVERY FULL DBCC SHRINKDATABASE (数据库, 0)
Tempdb事务日志满了之后,可以在没有回话占用tempdb的时候,使用下面的语句收缩日志
use tempdb
go
dbcc shrinkfile (tempdev, 'target size in MB')
go
-- this command shrinks the primary data file
dbcc shrinkfile (templog, 'target size in MB')
go
-- this command shrinks the log file, look at the last paragraph.
上一篇: 无人驾驶汽车的昨天、今天和明天
下一篇: 魅族也要进军VR领域 兴建未来实验室