Tuesday, January 28, 2014

Script to monitoring the RMAN Jobs in Oracle

vim rman_backup_job.sh


#!/bin/bash

clear scr


echo "******************************************************************************"
echo "********************** Monitoring the RMAN Backup Jobs ***********************"
echo "******************************************************************************"
echo -e "\n"

sqlplus -S / as sysdba <<EOF

SELECT SID, SERIAL#, CONTEXT, SOFAR, TOTALWORK,
ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
FROM V\$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK
/
EOF



OUTPUT.

******************************************************************************
********************** Monitoring the RMAN Backup Jobs ***********************
******************************************************************************



       SID    SERIAL#    CONTEXT      SOFAR  TOTALWORK %_COMPLETE
---------- ---------- ---------- ---------- ---------- ----------
        68       4949          1     125944    4432972       2.84

No comments:

Post a Comment