more little fixes
This commit is contained in:
@@ -33,6 +33,9 @@ MOUNTPOINT_PREFIX="/rubrik_"
|
||||
HOSTLOGRET=2
|
||||
MV_SPACE_WARN=75
|
||||
|
||||
# Number of RMAN channels to allocate per NFS mount
|
||||
RMAN_CHANNELS_PER_MOUNT=1
|
||||
|
||||
# Logging directories
|
||||
API_LOG_DIR=/tmp/rubrik
|
||||
RMAN_LOG_DIR=/tmp/rubrik/rman
|
||||
@@ -95,6 +98,7 @@ Performs RMAN database backup with incremental merge to Rubrik Managed Volume.
|
||||
**Features:**
|
||||
- Incremental level 1 backup with merge
|
||||
- Automatic MV open/close
|
||||
- Configurable RMAN channels per NFS mount (RMAN_CHANNELS_PER_MOUNT)
|
||||
- Disk space monitoring
|
||||
- Email alerts on failure/success
|
||||
- Archive log backup
|
||||
@@ -109,6 +113,7 @@ Performs RMAN archive log backup to Rubrik Managed Volume.
|
||||
|
||||
**Features:**
|
||||
- Backs up all not-backed-up archive logs
|
||||
- Configurable RMAN channels per NFS mount (RMAN_CHANNELS_PER_MOUNT)
|
||||
- Automatic MV open/close
|
||||
- Disk space monitoring
|
||||
- Optional host-side log purging
|
||||
|
||||
@@ -37,7 +37,6 @@ case "$os_name" in
|
||||
DATE=$(command -v gdate)
|
||||
else
|
||||
DATE=$(command -v date)
|
||||
echo "WARNING: GNU date (gdate) not found. Date arithmetic may not work on HP/UX." >&2
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
|
||||
19
rman_db.ksh
19
rman_db.ksh
@@ -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
|
||||
###############################################################################
|
||||
|
||||
@@ -62,15 +62,31 @@ fi
|
||||
|
||||
echo Running RMAN with log to $RMAN_LOG
|
||||
|
||||
allocate=""
|
||||
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;"
|
||||
i=$(expr $i + 1)
|
||||
done
|
||||
channel0="$MOUNTPOINT/c0"
|
||||
# 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"
|
||||
else
|
||||
allocate=""
|
||||
release=""
|
||||
i=0
|
||||
while [ $i -lt $numChannels ]; do
|
||||
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
|
||||
|
||||
|
||||
# RMAN Part Here
|
||||
|
||||
31
rubrik.conf.example
Executable file
31
rubrik.conf.example
Executable file
@@ -0,0 +1,31 @@
|
||||
# ID and Key for RSC Service Account (starts with client|) (use single quotes)
|
||||
ID='client|xxxxxxxxxxxxxxxxxxx'
|
||||
SECRET=xxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
# DNS name of Rubrik CDM
|
||||
RUBRIK_IP=<CDM address>
|
||||
|
||||
# Oracle Settings
|
||||
MOUNTPOINT_PREFIX=/rubrik_
|
||||
# How many hours of archivelog to keep on host. 0 means do not purge logs
|
||||
HOSTLOGRET=2
|
||||
|
||||
# Percentage threshold to warn if an MV filesystem is getting full
|
||||
MV_SPACE_WARN=75
|
||||
|
||||
# Number of RMAN channels to allocate per MV channel
|
||||
# NOTE: This is not a TOTAL. Total number of RMAN channels will be
|
||||
# this multipled by the number of channels of the Managed Volume
|
||||
RMAN_CHANNELS_PER_MOUNT=1
|
||||
|
||||
# Logging directories
|
||||
|
||||
# API calls
|
||||
API_LOG_DIR=/tmp/rubrik
|
||||
# RMAN sessions
|
||||
RMAN_LOG_DIR=/tmp/rubrik/rman
|
||||
|
||||
# List of email addresses to send failure alerts to
|
||||
ALERT_EMAILS=root,oracle
|
||||
# Set to 1 to enable email alert on success also
|
||||
EMAIL_SUCCESS=1
|
||||
Reference in New Issue
Block a user