Adding original DM files
This commit is contained in:
54
fromDmOct2025/v930p2/oracle_get_rr.sh
Normal file
54
fromDmOct2025/v930p2/oracle_get_rr.sh
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Fetch recoverable ranges for a given Oracle DB
|
||||
# v0.2 - James Pattinson - August 2021
|
||||
#
|
||||
# usage: oracle_get_rr.sh [-h <dbhost>] <SID>
|
||||
|
||||
MYDIR="$(dirname "$(realpath "$0")")"
|
||||
# source $MYDIR/rbk_api.conf
|
||||
source $MYDIR/oracle_funcs.sh
|
||||
|
||||
usage() { echo "Usage: $0 [-h <dbhost>] [-g|] <SID>" 1>&2; exit 1; }
|
||||
|
||||
while getopts "h:" o; do
|
||||
case "${o}" in
|
||||
h)
|
||||
RBK_HOST=${OPTARG}
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
RBK_SID=$1
|
||||
|
||||
if [ -z "${RBK_SID}" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
echo Connecting to Rubrik with IP $RUBRIK_IP
|
||||
|
||||
# API call to list Oracle DBs
|
||||
find_database
|
||||
|
||||
echo Fetching Recoverable Ranges for $RBK_SID on $RBK_HOST
|
||||
|
||||
# API call to get the recoverable range
|
||||
ENDPOINT="https://$RUBRIK_IP/api/internal/oracle/db/$db_id/recoverable_range"
|
||||
rest_api_get
|
||||
|
||||
echo
|
||||
|
||||
#echo -e "SID\t Start Time\t\t\tEnd Time\t\t\tStatus"
|
||||
#echo -e "-------- ----------\t\t\t--------\t\t\t------"
|
||||
echo -e "Start Time\t\t\tEnd Time\t\t\tStatus"
|
||||
echo -e "----------\t\t\t--------\t\t\t------"
|
||||
|
||||
RESULT_GET=`cat /tmp/rbkresponse.$$ | jq -r '.data[]' | jq -r ' "\(.beginTime)\t\(.endTime)\t\(.status)"'`
|
||||
# echo "$RBK_SID ${RESULT_GET}"
|
||||
echo "${RESULT_GET}"
|
||||
|
||||
cleanup
|
||||
Reference in New Issue
Block a user