viernes, 12 de diciembre de 2014

-Scripts verification  Backup Oracle 12c

oel-2:orcl12:/home/oracle12/rman/$ rman target / @backup_level_0.rmn

....
validation succeeded for archived log
archived log file name=+FRA/ORCL12/ARCHIVELOG/2014_12_12/thread_1_seq_166.409.866121149 RECID=466 STAMP=866121153
validation succeeded for archived log
archived log file name=+FRA/ORCL12/ARCHIVELOG/2014_12_12/thread_1_seq_168.410.866121149 RECID=467 STAMP=866121155
validation succeeded for archived log
archived log file name=+FRA/ORCL12/ARCHIVELOG/2014_12_12/thread_1_seq_169.408.866121469 RECID=468 STAMP=866121469
validation succeeded for archived log
archived log file name=+FRA/ORCL12/ARCHIVELOG/2014_12_12/thread_1_seq_170.400.866121691 RECID=469 STAMP=866121691
Crosschecked 4 objects

released channel: t1

Recovery Manager complete.

Veamos salida del scripts:















Scripts de Verificacion:

--*************************************************
--   Copyright © 2014 by SQL-TECH.
--   Free for non-commercial use!
--   To license, e-mail gerardo.leyton@gmail.com
-- ************************************************

select
j.session_recid, j.session_stamp,
to_char(j.start_time, 'yyyy-mm-dd hh24:mi:ss') "start_time",
to_char(j.end_time, 'yyyy-mm-dd hh24:mi:ss') "end_time",
round((j.output_bytes/1024/1024),0) output_mbytes, j.status, j.input_type,
decode(to_char(j.start_time, 'd'), 0, 'Sunday', 1, 'Monday',
2, 'Tuesday', 3, 'Wednesday',
4, 'Thursday', 5, 'Friday',
6, 'Saturday','Sunday') "dow",
j.elapsed_seconds, j.time_taken_display,
x.cf, x.df, x.i0, x.i1, x.l
--.inst_id output_instance
,max( k.next_change#)  "SCN"
,max( (k.sequence#+1)) "Sequence#"
,decode(x.con_id,0,'CDB',1,decode(c.name,'PDB$SEED','CDB',c.name),'CDB + PDBs') con_id
from v$containers c,V$RMAN_BACKUP_JOB_DETAILS j
left outer join (select
d.session_recid, d.session_stamp,(count(distinct d.con_id) -2 ) con_id, max( d.con_id) max_id,
sum(case when d.controlfile_included = 'YES' then d.pieces else 0 end) CF,
sum(case when d.controlfile_included = 'NO'
and d.backup_type||d.incremental_level = 'D' then d.pieces else 0 end) DF,
sum(case when d.backup_type||d.incremental_level = 'D0' then d.pieces else 0 end) I0,
sum(case when d.backup_type||d.incremental_level = 'I1' then d.pieces else 0 end) I1,
sum(case when d.backup_type = 'L' then d.pieces else 0 end) L
from
V$BACKUP_SET_DETAILS d
join V$BACKUP_SET s on s.set_stamp = d.set_stamp and s.set_count = d.set_count
where s.input_file_scan_only = 'NO'
group by d.session_recid, d.session_stamp
) x
on x.session_recid = j.session_recid and x.session_stamp = j.session_stamp
left outer join (select o.session_recid, o.session_stamp
from V$RMAN_status o
group by o.session_recid, o.session_stamp)
ro on ro.session_recid = j.session_recid and ro.session_stamp = j.session_stamp
        join
          v$backup_redolog k
         on
         to_char(next_time,'yyyy-mm-dd hh24:mi') between TO_CHAR(j.end_time - (1/12), 'yyyy-mm-dd hh24:mi') and TO_CHAR(j.end_time , 'yyyy-mm-dd hh24:mi')
          and ( k.set_stamp,k.set_count) in (select set_stamp,set_count from V$BACKUP_SET_DETAILS kk where  kk.session_recid=j.session_recid and kk.session_stamp=j.session_stamp)
where j.start_time > trunc(sysdate)-30
and decode(x.con_id,1,x.max_id,1)=c.con_id
--inst_id is not null
group by
j.session_recid,
j.session_stamp,
to_char(j.start_time, 'yyyy-mm-dd hh24:mi:ss'),
to_char(j.end_time, 'yyyy-mm-dd hh24:mi:ss') ,
round((j.output_bytes/1024/1024),0),
 j.status,
  j.input_type,
decode(to_char(j.start_time, 'd'), 0, 'Sunday', 1, 'Monday',
2, 'Tuesday', 3, 'Wednesday',
4, 'Thursday', 5, 'Friday',
6, 'Saturday','Sunday'),
j.elapsed_seconds, j.time_taken_display,
x.cf, x.df, x.i0, x.i1, x.l
 , decode(x.con_id,0,'CDB',1,decode(c.name,'PDB$SEED','CDB',c.name),'CDB + PDBs')


saludos
gl










No hay comentarios.:

Publicar un comentario