Ask Me

Scripts for Monitoring RMAN Backup

 Monitor Archive job

********************
#!/bin/ksh

sqlplus -s '/as sysdba'<<EOF

col START_TIME for a11
col END_TIME for a11
col TIME_TAKEN for a11
set lines 200
col START_TIME for a21
col END_TIME for a21
col TIME_TAKEN for a11
set lines 200
col STATUS for a30
set pages 100

select session_stamp, status,
to_char(start_time, 'mm/dd/yyyy hh24:mi:ss') start_time,
to_char(end_time, 'mm/dd/yyyy hh24:mi:ss') end_time,
substr(time_taken_display,1,10) time_taken, input_type
from V\$RMAN_BACKUP_JOB_DETAILS
where input_type = 'ARCHIVELOG'
order by 3;

Monitor FULL job
********************

#!/bin/ksh

sqlplus -s '/as sysdba'<<EOF
col START_TIME for a21
col END_TIME for a21
col TIME_TAKEN for a11
set lines 200
col STATUS for a30
set pages 100
select session_stamp, status,
to_char(start_time, 'mm/dd/yyyy hh24:mi:ss') start_time,
to_char(end_time, 'mm/dd/yyyy hh24:mi:ss') end_time,
substr(time_taken_display,1,10) time_taken, input_type
from V\$RMAN_BACKUP_JOB_DETAILS
where input_type IN ('DB FULL','DB INCR')
order by 3;

Popular Posts