Oracle Logbook

March 21, 2013

Monitoring backup through Alert

Filed under: Uncategorized — heliodias @ 4:21 pm

This procedure will write into alert.log when the enviroment doesn´t have backup online working properly.

 

CREATE OR REPLACE PROCEDURE SYS.L3_BACKUP_CHECK
AS
STATUS_ONLINE VARCHAR2(10);
BEGIN
SELECT decode(count(*),0,’FAIL’,’OK’) INTO STATUS_ONLINE
FROM V$RMAN_BACKUP_JOB_DETAILS T1 WHERE START_TIME>SYSDATE-36/24
AND INPUT_TYPE NOT LIKE ‘%ARCHIVE%’;
IF STATUS_ONLINE=’FAIL’ THEN
dbms_system.ksdwrt(2,’ORA-00600: ONLINE BACKUP FAIL, NOT BACKING UP   +36 HOURS’);
END IF;
END;

 

 

Advertisements

Blog at WordPress.com.