SQL Server 查看收缩进度,备份进度

发布时间:2021-03-19 20:34 作者:独孤剑 阅读:112

SQL Server 查看收缩进度,备份进度
--查询当前数据库备份进度
SELECT
	DB_NAME(er.[database_id]) [DatabaseName],
	er.[command] AS [CommandType],er.[percent_complete],
	er.start_time,CONVERT(DECIMAL(5, 2),
	er.[percent_complete]) AS [Complete_Percent],
	CONVERT(DECIMAL(38, 2),
	er.[total_elapsed_time] / 60000.00) AS [ElapsedTime_m],
	CONVERT(DECIMAL(38, 2),
	er.[estimated_completion_time] / 60000.00) AS [EstimatedCompletionTime_m]  
FROM
	sys.dm_exec_requests AS er  
WHERE
	er.[command] in ('RESTORE DATABASE', 'BACKUP DATABASE');
 
 
--查看数据库收缩进度
SELECT
	DB_NAME(er.[database_id]) [DatabaseName],
	er.[command] AS [CommandType],
	er.[percent_complete],
	er.start_time,CONVERT(DECIMAL(5, 2),
	er.[percent_complete]) AS [Complete_Percent],
	CONVERT(DECIMAL(38, 2), er.[total_elapsed_time] / 60000.00) AS [ElapsedTime_m],
	CONVERT(DECIMAL(38, 2), er.[estimated_completion_time] / 60000.00) AS [EstimatedCompletionTime_m] 
FROM
	sys.dm_exec_requests as er 
WHERE
	command in ('DbccFilesCompact', 'AUTOSHRINK', 'SHRINKDATABASE');

作者最新文章
如何设置 robots.txt 只允许抓取首页,不允许抓取其他页面
html table 表格样式
html table 设置表格背景图片,背景色
css, js 引用文件禁止缓存的方法
html 页面禁止缓存