0
点赞
收藏
分享

微信扫一扫

在sqlserver2008中收缩日志文件

—先备份数据库(含日志文件) 
use myhis
go
backup database myhis to disk=’d:\myhis_rzbak’
go
—设为简单恢复模式
use [master]
go
alter database myhis set recovery simple with no_wait
go
alter database myhis set recovery simple
go
—收缩数据库日志文件为8M
use myhis
go
dbcc shrinkfile(myhis_log,8)
go
—重新设为完整恢复模式
use master
go
alter database myhis set recovery full with no_wait
go
alter database myhis set recovery full go

举报

相关推荐

0 条评论