more little fixes

This commit is contained in:
2025-10-28 12:21:11 -04:00
parent 6c1f8c926e
commit 09fd3b2c67
5 changed files with 76 additions and 14 deletions

View File

@@ -68,7 +68,12 @@ fi
echo Running RMAN with log to $RMAN_LOG
if [ $numChannels -eq 1 ]; then
# Default RMAN channels per mount if not set
RMAN_CHANNELS_PER_MOUNT=${RMAN_CHANNELS_PER_MOUNT:-1}
total_channels=$(expr $numChannels \* $RMAN_CHANNELS_PER_MOUNT)
if [ $total_channels -eq 1 ]; then
allocate="allocate channel 'ch1' device type disk format '$MOUNTPOINT/%U';"
release="release channel ch1;"
channel0="$MOUNTPOINT"
@@ -77,15 +82,21 @@ else
release=""
i=0
while [ $i -lt $numChannels ]; do
allocate="$allocate allocate channel 'c$i' device type disk format '$MOUNTPOINT/c$i/%U';"
release="$release release channel c$i;"
j=0
while [ $j -lt $RMAN_CHANNELS_PER_MOUNT ]; do
suffix=$(echo $j | tr '0123456789' 'abcdefghijklmnopqrstuvwxyz')
allocate="$allocate allocate channel 'c${i}${suffix}' device type disk format '$MOUNTPOINT/c$i/%U';"
release="$release release channel c${i}${suffix};"
j=$(expr $j + 1)
done
i=$(expr $i + 1)
done
channel0="$MOUNTPOINT/c0"
fi
# Save the current time (minus one hour) to ensure we catch all archive logs
startTime=$(date +%m-%d-%Y\ %H:%M:%S -d '-1 hour')
startTime=$(perl -e 'use POSIX qw(strftime); $time = time() - 3600; print strftime("%m-%d-%Y %H:%M:%S", localtime($time))')
# RMAN Part Here
###############################################################################