SQL Server常用命令
?--重建索引
dbcc dbreindex('表名','',90)
?
--清除數(shù)據(jù)庫(kù)日志
use [數(shù)據(jù)庫(kù)]
select FILE_ID,name,size,* from sys.database_files --查詢數(shù)據(jù)庫(kù)及日志名稱
alter database [數(shù)據(jù)庫(kù)名稱] set recovery simple with no_wait
alter database [數(shù)據(jù)庫(kù)名稱] set recovery simple--簡(jiǎn)單模式,如果本身是簡(jiǎn)單模式不用執(zhí)行
DBCC shrinkfile('日志名稱',11,truncateonly)--清除數(shù)據(jù)
alter database [數(shù)據(jù)庫(kù)名稱] set recovery full with no_wait
alter database [數(shù)據(jù)庫(kù)名稱] set recovery full --還原為完全模式,如果本身是簡(jiǎn)單模式不用執(zhí)行
轉(zhuǎn)自:www.npqdlp.com
標(biāo)簽: