See RMAN effective use see Rman - Quering catalog
Remember: obsolete means "not needed" expired means "not found" |
select * from V$RMAN_BACKUP_JOB_DETAILs select * from V$RMAN_BACKUP_TYPE; select output from v$rman_output |
!! Perform a "resync catalog" before querying RMAN catalog !! (this update RMAN catalog from controlfile)
Caution! In RMAN catalog structure the minimum field is a backup set.
In this environment i suppose a backup controlfile is performed for each full.
Complete backups summary
Control file
select * from v$backup_set
where backup_type = 'D'
and controlfile_included = 'YES'
order by completion_time desc
Catalog
select * from rc_backup_set
where backup_type = 'D'
and controlfile_included = 'BACKUP'
order by completion_time desc
The minimum archivelog needed
catalog
--select sum(MB) from (
select a.* from (
select sequence#, first_change#, first_time, next_change#, next_time,
to_date('07/04/07 00:47:49', 'dd/mm/yy hh24:mi:ss') backup_start_time,
to_date('07/04/07 04:13:35', 'dd/mm/yy hh24:mi:ss') backup_end_time,
blocks*block_size / 1024/1024 MB
from rc_backup_redolog
) a
where not (first_time < backup_start_time and next_time < backup_start_time)
and not (first_time > backup_end_time and next_time > backup_end_time)
order by first_time desc
--)
|
Monitor progress of a backup
SELECT SID, serial#, CONTEXT, sofar, totalwork,
ROUND (sofar / totalwork * 100, 2) "%_COMPLETE", opname
FROM v$session_longops
WHERE sofar <> totalwork AND totalwork != 0 AND opname LIKE 'RMAN%'
SELECT *
FROM bp
WHERE completion_time BETWEEN (SELECT completion_time
FROM bp
WHERE handle = 'dbaseGEA_PRO_bqhvh8bg')
AND (SELECT completion_time
FROM rc_backup_redolog
WHERE next_change# = 6927237507686)
AND handle LIKE 'arch_%'
ORDER BY start_time |
Usefull functions
See current SCN
select * from (
select status, current_scn,
lead(sequence#, 1, null) OVER (ORDER BY rownum) sequence#,
lead(first_change#, 1, null) OVER (ORDER BY rownum) first_change#,
lead(next_change#, 1, null) OVER (ORDER BY rownum) next_change#
from (
select
status, current_scn,
null sequence#, null first_change#, null next_change# from v$database, v$instance
union all
select
null, null, sequence#, first_change#, next_change#
from v$archived_log
where sequence# = (select max(sequence#) from v$archived_log)
) a
) where not current_scn is null |