HP/UX changes after site testing
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -23,3 +23,5 @@ rubrik.conf
|
|||||||
# Other common ignores
|
# Other common ignores
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
|
releases/
|
||||||
|
|||||||
24
list_mv.ksh
24
list_mv.ksh
@@ -5,13 +5,26 @@
|
|||||||
# v1.1 - James Pattinson - October 2025
|
# v1.1 - James Pattinson - October 2025
|
||||||
#
|
#
|
||||||
# usage: list_mv.ksh
|
# usage: list_mv.ksh
|
||||||
|
_SCRIPT_="$0"
|
||||||
|
|
||||||
get_script_dir() {
|
get_script_dir() {
|
||||||
src="$0"
|
script="$1"
|
||||||
dir=$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)
|
case "$script" in
|
||||||
echo "$dir"
|
/*) abs_path="$script" ;;
|
||||||
|
*) abs_path="$PWD/$script" ;;
|
||||||
|
esac
|
||||||
|
while [ -L "$abs_path" ]; do
|
||||||
|
link=$(readlink "$abs_path")
|
||||||
|
case "$link" in
|
||||||
|
/*) abs_path="$link" ;;
|
||||||
|
*) abs_path="$(dirname "$abs_path")/$link" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
script_dir=$(dirname "$abs_path")
|
||||||
|
cd "$script_dir" 2>/dev/null && pwd
|
||||||
}
|
}
|
||||||
MYDIR=$(get_script_dir)
|
|
||||||
|
MYDIR=$(get_script_dir "$_SCRIPT_")
|
||||||
. $MYDIR/rubrik.conf
|
. $MYDIR/rubrik.conf
|
||||||
. $MYDIR/oracle_funcs.ksh
|
. $MYDIR/oracle_funcs.ksh
|
||||||
|
|
||||||
@@ -45,3 +58,4 @@ awk '
|
|||||||
' /tmp/rbkresponse.$$
|
' /tmp/rbkresponse.$$
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
|
|||||||
@@ -80,10 +80,11 @@ exit_with_error() {
|
|||||||
|
|
||||||
check_http_error() {
|
check_http_error() {
|
||||||
# All good responses start with a 2
|
# All good responses start with a 2
|
||||||
if [ ${http_response:0:1} != "2" ]; then
|
first_char=$(echo "$http_response" | cut -c1)
|
||||||
echo FATAL: HTTP error from API call: $http_response. The server responded with:
|
if [ "$first_char" != "2" ]; then
|
||||||
cat /tmp/rbkresponse.$$ ; echo ; exit_with_error
|
echo FATAL: HTTP error from API call: $http_response. The server responded with:
|
||||||
fi
|
cat /tmp/rbkresponse.$$ ; echo ; exit_with_error
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
check_pid() {
|
check_pid() {
|
||||||
@@ -217,7 +218,7 @@ get_mv() {
|
|||||||
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||||
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
||||||
|
|
||||||
if [[ $mvId == "" ]]; then
|
if [ -z "$mvId" ]; then
|
||||||
echo ERROR: MV with name $mv_name was not found
|
echo ERROR: MV with name $mv_name was not found
|
||||||
exit_with_error
|
exit_with_error
|
||||||
fi
|
fi
|
||||||
@@ -226,7 +227,7 @@ get_mv() {
|
|||||||
|
|
||||||
get_data_mv() {
|
get_data_mv() {
|
||||||
|
|
||||||
mv_name=${HOST}_${ORACLE_SID}_data
|
mv_name=${HOST}_${ORACLE_SID}_Data
|
||||||
|
|
||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
@@ -234,7 +235,7 @@ get_data_mv() {
|
|||||||
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||||
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
||||||
|
|
||||||
if [[ $mvId == "" ]]; then
|
if [ -z "$mvId" ]; then
|
||||||
echo ERROR: MV with name $mv_name was not found
|
echo ERROR: MV with name $mv_name was not found
|
||||||
exit_with_error
|
exit_with_error
|
||||||
fi
|
fi
|
||||||
@@ -245,16 +246,16 @@ get_log_mv() {
|
|||||||
|
|
||||||
# Look for a log volume. If not present, return the data volume
|
# Look for a log volume. If not present, return the data volume
|
||||||
|
|
||||||
mv_name=${HOST}_${ORACLE_SID}_logs
|
mv_name=${HOST}_${ORACLE_SID}_Log
|
||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
|
|
||||||
logMvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
logMvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||||
|
|
||||||
if [[ $logMvId == "" ]]; then
|
if [ -z "$logMvId" ]; then
|
||||||
echo "INFO: Log volume ($mv_name) not found. Logs will be written to DB volume"
|
echo "INFO: Log volume ($mv_name) not found. Logs will be written to DB volume"
|
||||||
logMvPresent=0
|
logMvPresent=0
|
||||||
mv_name=${HOST}_${ORACLE_SID}_data
|
mv_name=${HOST}_${ORACLE_SID}_Data
|
||||||
|
|
||||||
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
ENDPOINT="https://$RUBRIK_IP/api/internal/managed_volume?name=$mv_name&is_relic=false"
|
||||||
rest_api_get
|
rest_api_get
|
||||||
@@ -262,7 +263,7 @@ get_log_mv() {
|
|||||||
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
mvId=$(awk '{match($0, /ManagedVolume:::[a-z0-9-]*/); if (RSTART > 0) {id=substr($0, RSTART, RLENGTH); sub(/"$/, "", id); print id}}' /tmp/rbkresponse.$$)
|
||||||
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
numChannels=$(awk '{match($0, /"numChannels":[ ]*[0-9]+/); if (RSTART > 0) {val=substr($0, RSTART, RLENGTH); sub(/.*:[ ]*/, "", val); print val}}' /tmp/rbkresponse.$$)
|
||||||
|
|
||||||
if [[ $mvId == "" ]]; then
|
if [ -z "$mvId" ]; then
|
||||||
echo ERROR: MV with name $mv_name was not found
|
echo ERROR: MV with name $mv_name was not found
|
||||||
exit_with_error
|
exit_with_error
|
||||||
fi
|
fi
|
||||||
@@ -308,3 +309,4 @@ cleanup() {
|
|||||||
rm -f /tmp/rbkresponse.$$
|
rm -f /tmp/rbkresponse.$$
|
||||||
rm -f $PIDFILE
|
rm -f $PIDFILE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
22
rman_db.ksh
22
rman_db.ksh
@@ -6,12 +6,26 @@
|
|||||||
#
|
#
|
||||||
# usage: rman_db.ksh <ORACLE_SID>
|
# usage: rman_db.ksh <ORACLE_SID>
|
||||||
|
|
||||||
|
_SCRIPT_="$0"
|
||||||
|
|
||||||
get_script_dir() {
|
get_script_dir() {
|
||||||
src="$0"
|
script="$1"
|
||||||
dir=$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)
|
case "$script" in
|
||||||
echo "$dir"
|
/*) abs_path="$script" ;;
|
||||||
|
*) abs_path="$PWD/$script" ;;
|
||||||
|
esac
|
||||||
|
while [ -L "$abs_path" ]; do
|
||||||
|
link=$(readlink "$abs_path")
|
||||||
|
case "$link" in
|
||||||
|
/*) abs_path="$link" ;;
|
||||||
|
*) abs_path="$(dirname "$abs_path")/$link" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
script_dir=$(dirname "$abs_path")
|
||||||
|
cd "$script_dir" 2>/dev/null && pwd
|
||||||
}
|
}
|
||||||
MYDIR=$(get_script_dir)
|
|
||||||
|
MYDIR=$(get_script_dir "$_SCRIPT_")
|
||||||
|
|
||||||
export ORACLE_SID=$1
|
export ORACLE_SID=$1
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,26 @@
|
|||||||
#
|
#
|
||||||
# usage: rman_logs.ksh <ORACLE_SID>
|
# usage: rman_logs.ksh <ORACLE_SID>
|
||||||
|
|
||||||
|
_SCRIPT_="$0"
|
||||||
|
|
||||||
get_script_dir() {
|
get_script_dir() {
|
||||||
src="$0"
|
script="$1"
|
||||||
dir=$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)
|
case "$script" in
|
||||||
echo "$dir"
|
/*) abs_path="$script" ;;
|
||||||
|
*) abs_path="$PWD/$script" ;;
|
||||||
|
esac
|
||||||
|
while [ -L "$abs_path" ]; do
|
||||||
|
link=$(readlink "$abs_path")
|
||||||
|
case "$link" in
|
||||||
|
/*) abs_path="$link" ;;
|
||||||
|
*) abs_path="$(dirname "$abs_path")/$link" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
script_dir=$(dirname "$abs_path")
|
||||||
|
cd "$script_dir" 2>/dev/null && pwd
|
||||||
}
|
}
|
||||||
MYDIR=$(get_script_dir)
|
|
||||||
|
MYDIR=$(get_script_dir "$_SCRIPT_")
|
||||||
export ORACLE_SID=$1
|
export ORACLE_SID=$1
|
||||||
|
|
||||||
#. $HOME/.profile
|
#. $HOME/.profile
|
||||||
|
|||||||
@@ -10,12 +10,26 @@
|
|||||||
# -v Volume to operate on, logs or data
|
# -v Volume to operate on, logs or data
|
||||||
# -o Operation to perform - open or close the MV
|
# -o Operation to perform - open or close the MV
|
||||||
|
|
||||||
|
_SCRIPT_="$0"
|
||||||
|
|
||||||
get_script_dir() {
|
get_script_dir() {
|
||||||
src="$0"
|
script="$1"
|
||||||
dir=$(cd -P "$(dirname "$src")" >/dev/null 2>&1 && pwd)
|
case "$script" in
|
||||||
echo "$dir"
|
/*) abs_path="$script" ;;
|
||||||
|
*) abs_path="$PWD/$script" ;;
|
||||||
|
esac
|
||||||
|
while [ -L "$abs_path" ]; do
|
||||||
|
link=$(readlink "$abs_path")
|
||||||
|
case "$link" in
|
||||||
|
/*) abs_path="$link" ;;
|
||||||
|
*) abs_path="$(dirname "$abs_path")/$link" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
script_dir=$(dirname "$abs_path")
|
||||||
|
cd "$script_dir" 2>/dev/null && pwd
|
||||||
}
|
}
|
||||||
MYDIR=$(get_script_dir)
|
|
||||||
|
MYDIR=$(get_script_dir "$_SCRIPT_")
|
||||||
. $MYDIR/rubrik.conf
|
. $MYDIR/rubrik.conf
|
||||||
. $MYDIR/oracle_funcs.ksh
|
. $MYDIR/oracle_funcs.ksh
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user