Database Reference
In-Depth Information
else
echo "rman backups ran ok"
fi
#--------------------------------------------
crit_var2=$(sqlplus -s <<EOF
/ as sysdba
SET HEAD OFF FEEDBACK OFF
SELECT COUNT(*)
FROM
(
SELECT name
FROM v\$datafile
MINUS
SELECT DISTINCT
f.name
FROM v\$backup_datafile d
,v\$datafile f
WHERE d.file# = f.file#
AND d.completion_time > sysdate - $2);
EOF)
#
if [ $crit_var2 -ne 0 ]; then
echo "datafile not backed up on $1" | mailx -s "backup problem" dkuhn@gmail.com
else
echo "datafiles are backed up..."
fi
#
exit 0
For example, to check if backups have been running successfully within the past 2 days, run the script
(named rman_chk.bsh ):
$ rman_chk.bsh O12c 2
The prior script is basic but effective. You can enhance it as required for your RMAN environment.
Summary
RMAN offers many flexible and feature-rich options for backups. By default, RMAN backs up only blocks that have been
modified in the database. The incremental features allow you to back up only blocks that have been modified since
the last backup. These incremental features are particularly useful in reducing the size of backups in large database
environments, in which only a small percentage of data in the database changes from one backup to the next.
You can instruct RMAN to back up every block in each data file via an image copy. An image copy is a block-for-block
identical copy of the data file. Image copies have the advantage of being able to restore the backup files directly from
the backup (without using RMAN). You can use the incrementally updated backup feature to implement an efficient
hybrid of image copy backups and incremental backups.
RMAN contains built-in commands for reporting on many aspects of backups. The LIST command reports on
backup activity. The REPORT command is useful for determining which files need to be backed up, as dictated by the
retention policy.
After you've successfully configured RMAN and created backups, you are in a position to be able to restore and
recover your database in the event of a media failure. Restore and recovery topics are detailed in the next chapter.
 
Search WWH ::




Custom Search