RMAN备份信息
通过数据字典v$backup_set_details可以查询RMAN的备份信息
查看每天的备份总大小:
SELECT
to_char(start_time,'yyyy-mm-dd') 日期,
round(SUM(
CASE SUBSTR(output_bytes_display,LENGTH(output_bytes_display),1)
WHEN 'G' THEN substr(output_bytes_display,1,LENGTH(output_bytes_display)-1)
WHEN 'M' THEN to_char(to_number(substr(output_bytes_display,1,LENGTH(output_bytes_display)-1)/1024))
WHEN 'K' THEN to_char(to_number(substr(output_bytes_display,1,LENGTH(output_bytes_display)-1)/1024/1024)) END
),2)||'G' 备份大小,
to_char(start_time,'day') 星期
FROM v$backup_set_details GROUP BY to_char(start_time,'yyyy-mm-dd'),to_char(start_time,'day') ORDER BY to_char(start_time,'yyyy-mm-dd') DESC;
查看某天的备份详细信息:
SELECT CASE backup_type WHEN 'D' THEN '数据文件备份' WHEN 'I' THEN '增量备份' WHEN 'L' THEN '归档日志备份' END 备份类型,
CASE CONTROLFILE_INCLUDED WHEN 'YES' THEN '包含控制文件' WHEN 'NO'THEN '不包含控制文件' END 是否包含控制文件,
output_bytes_display 备份大小,
start_time 备份开始时间,
completion_time 备份结束时间,
time_taken_display 所花时间
FROM v$backup_set_details
WHERE to_char(start_time,'yyyy-mm-dd')='2013-09-11'
ORDER BY completion_time;