If Backup is failed or stop then i will get notification
Steps :
- Open a database target (SNS0910)
- Click on User-Defined-Metrics
- Create
- Metric Name = Last datafile backup
- Type = Number
- Output = Single Value
- SQL Query : the time in hour since the oldest checkpoint time of the newest backup
select (sysdate-min(t))*24 from
(
select max(b.CHECKPOINT_TIME) t
from v$backup_datafile b, v$tablespace ts, v$datafile f
where INCLUDED_IN_DATABASE_BACKUP='YES'
and f.file#=b.file#
and f.ts#=ts.ts#
group by f.file#
)
- Credentials : dbsnmp/*****
- Threshold Operator > Warning 24 Critical 48
- Repeat every 1 hour
- OK
Same for redologs, with a name of Last redolog backup query of
select (sysdate-max(NEXT_TIME))*24 from v$BACKUP_REDOLOG
It is now possible to define alerts.
- Preferences
- Notification Rules
- Create
- Apply to specific targets : Add you productive databases group
- Deselect Availability Down
- Metric: Add : Show all: Check User defined metric : Select : Last datafile backup , Last redolog backup
- Severity : Critical and Clear
- Policy : None
- Method : Email
======================
select
to_char(max(completion_time) ,'DDMMYYHH24MISS') lastbackup
from (SELECT completion_time
FROM v$backup_set
UNION
SELECT completion_time
FROM v$datafile_copy
union
select sysdate-365 from dual
)
Warining 0
Critical 320000000000
===========
SELECT
ELAPSED_SECONDS/60 minutes
FROM V$RMAN_BACKUP_JOB_DETAILS
ORDER BY SESSION_KEY desc;
Warining 30
Critical 60
No comments:
Post a Comment