DUMP TRANSACTION [databasename ] WITH NO_
LOGBACKUP LOG [databasename ] WITH NO_LOG
DBCC SHRINKDATABASE([databasename])
BackupLog DNName with no_log
godumptransaction DNName with no_log
go
USE DNName
DBCC SHRINKFILE (2)
Go
USE[
master]
GO
ALTERDATABASE DNName
SET RECOVERY SIMPLE WITH NO_
WAIT GO
ALTERDATABASE DNName SET RECOVERY SIMPLE --简单模式
GO
USE DNName
GO
DBCC SHRINKFILE (N'DNName_Log' , 11, TRUNCATEONLY)
GO
USE[master]
GO
ALTERDATABASE DNName SET RECOVERY FULLWITH NO_WAIT
GO
ALTERDATABASE DNName SET RECOVERY FULL --还原为完全模式
GO