我想看看我所有的备份是否都压缩了。我运行了下面的查询来检查,但没有得到好的结果:
select top(10) database_name,
case when backup_size = compressed_backup_size then 'Compressed'
else 'Not compressed'
end as Compression,
backup_finish_date
from msdb.dbo.backupset
where database_name ='MyDAtabase'
order by backup_start_date desc我正在使用:
Microsoft 2008 R2 (SP2) - 10.50.4000.0 (X64) Jun 28 2012 08:36:30版权(c) Windows NT 6.1上的微软Corporation标准版(64位) (Build 7601: Service Pack 1)
默认情况下,我们设置了压缩,但是一旦我运行了这个查询,我得到的结果数据库就不会被压缩。
发布于 2017-01-05 16:00:52
你的案例陈述是错的。现在,如果值是相同的,那么它显示压缩,而您希望它显示,而不是压缩。
select top(10) database_name,
case when backup_size = compressed_backup_size then 'Not compressed'
else 'Compressed'
end as Compression,
backup_finish_date
from msdb.dbo.backupset
where database_name ='MyDAtabase'
order by backup_start_date deschttps://dba.stackexchange.com/questions/160075
复制相似问题