#!/bin/sh # # Script: rmancrosscheck.shl # # Purpose: Perform an RMAN crosscheck on all control files, # RMAN backups, and archivelogs for all of the active databases # on this server so that any of them that were manually deleted # (through an O/S command) don't cause any errors in the RMAN # backups. This should be run before the rmanbackup.shl script. # # Author: Stephen Rea # Maristream, Inc. # # Updates: # 5/7/09 - Initial Release # PATH=/usr/bin:/usr/lbin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:. export PATH export NLS_DATE_FORMAT='DD-MON-YY HH24:MI:SS' export ORAENV_ASK=YES for bkup_sid in `cat /etc/oratab | grep -v '^ *#' | sed 's/:.*//'` do echo $bkup_sid | . oraenv >/dev/null if [ "${ORACLE_SID}" = "${bkup_sid}" ]; then ps -ef | grep "pmon_$ORACLE_SID" | grep -v grep >/dev/null if [ $? -eq 0 ]; then rman target / <