Sql Server 压缩数据库日志文件的方法(压缩sql日志文件步骤是什么)深度揭秘

随心笔谈2年前发布 admin
193 0 0

文章摘要

本文介绍了如何通过SQL命令对数据库进行恢复操作。作者展示了如何设置恢复点目标(RPO)为11分钟,并将日志文件删除。此外,还详细说明了如何将恢复策略从“简单”切换为“完整”,并使用`dbcc shrinkfile`命令优化数据库文件。文章重点围绕恢复点目标的设置、回滚策略的切换以及数据库操作步骤展开,强调了这些操作对提升数据库性能和恢复效率的重要性。

use [master]
go
alter database [dbname] set recovery simple with no_wait
go
alter database [dbname] set recovery simple
go

use [dbname]
go
dbcc shrinkfile (N’dblogname’,11,truncateonly)
go

use [master]
go
alter database [dbname] set recovery full with no_wait
go
alter database [dbname] set recovery full
go

© 版权声明

相关文章