SQLSERVER2012收缩数据库

作者:admin 时间:2016/10/24 0:59:38 访问量:345

USE [master]
GO
ALTER DATABASE  UPS_MASTER SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE  UPS_MASTER SET RECOVERY SIMPLE   --简单模式
GO
USE  UPS_MASTER
go
declare @name varchar(100) 
 
select top 1 @name = name from sysfiles where status = 1048642
 
DBCC SHRINKFILE (@name , 11, TRUNCATEONLY)
GO
USE [master]
GO
 
ALTER DATABASE UPS_MASTER SET RECOVERY FULL WITH NO_WAIT
 
GO
 
ALTER DATABASE  UPS_MASTER SET RECOVERY FULL  --还原为完全模式
 
GO
返回顶部