欢迎光临散文网 会员登陆 & 注册

SQL Server常用命令

2023-10-27 12:08 作者:限量版范儿  | 我要投稿


 --重建索引
dbcc dbreindex('表名','',90)

 

--清除数据库日志

use [数据库]

select FILE_ID,name,size,* from sys.database_files --查询数据库及日志名称
alter database [数据库名称] set recovery simple with no_wait
alter database [数据库名称] set recovery simple--简单模式,如果本身是简单模式不用执行

DBCC shrinkfile('日志名称',11,truncateonly)--清除数据

alter database [数据库名称] set recovery full with no_wait
alter database [数据库名称] set recovery full --还原为完全模式,如果本身是简单模式不用执行

转自:www.npqdlp.com

SQL Server常用命令的评论 (共 条)

分享到微博请遵守国家法律