SQLSERVER 2008数据库压缩

压缩数据库:

DBCC SHRINKDATABASE  ( 'cqgpublic_prd' ,1); 

 

压缩数据库文件:

declare @name varchar(500)

select @name=name from sys.database_files ;

print @name

dbcc shrinkfile(@name,1);

 

A. 重建某个索引

下例使用填充因子 80 重建 pubs 数据库中 authors 表上的 au_nmind 聚集索引。

DBCC DBREINDEX ('pubs.dbo.authors', UPKCL_auidind, 80)  
B. 重建所有索引

下例使用填充因子值 70 重建 authors 表上的所有索引。

DBCC DBREINDEX (authors, '', 70) 

 

参考:

http://www.cnblogs.com/downmoon/archive/2009/12/13/1623004.html

猜你喜欢

转载自steveoyung.iteye.com/blog/1772701