deployment pre patch
#!/bin/bash
# Check if all required arguments are provided
if [ "$#" -ne 5 ]; then
echo "Usage: $0 <SCRIPT_BASE> <CHANGE_NUMBER> <FRAME> <DBHOME_NUMBER> <CLUSTER_NAME>"
exit 1
fi
SCRIPT_BASE=$1
CHANGE_NUMBER=$2
FRAME=$3
DBHOME_NUMBER=$4
CLUSTER_NAME=$5
# Define paths
SCRIPT_LOCATION="/auto/data.misc/oracle/VAT_PATCH/19.22/PRE_INSTALL"
PATCH_LOG="$SCRIPT_LOCATION/PATCH_LOG"
# Create directories
mkdir -p "$SCRIPT_LOCATION" "$PATCH_LOG"
# Tar and extract files
tar -xf /auto/data.misc/oracle/VAT_PATCH/19.22/PRE_INSTALL.tar.gz -C "$SCRIPT_LOCATION"
# Update ssl jan2024.conf with provided parameters
sed -i "s/CHANGE_NUMBER/$CHANGE_NUMBER/g" "$SCRIPT_LOCATION/ssl_jan2024.conf"
sed -i "s/FRAME/$FRAME/g" "$SCRIPT_LOCATION/ssl_jan2024.conf"
sed -i "s/DBHOME_NUMBER/$DBHOME_NUMBER/g" "$SCRIPT_LOCATION/ssl_jan2024.conf"
# Update paths in the script files
sed -i "s|GI_NEW|/u01/app/19.22.0.0/grid|g" "$SCRIPT_LOCATION/script1.sh"
sed -i "s|19C_NEW|/u01/app/oracle/product/19.22.0.0/$DBHOME_NUMBER|g" "$SCRIPT_LOCATION/script1.sh"
sed -i "s|12C_NEW|/u01/app/oracle/product/12.1.0.2.240116/$DBHOME_NUMBER|g" "$SCRIPT_LOCATION/script1.sh"
sed -i "s|116_NEW|/u01/app/oracle/product/11.2.0.4.240116/$DBHOME_NUMBER|g" "$SCRIPT_LOCATION/script1.sh"
sed -i "s|GI_CURRENT|/u01/app/19.19.0.0/grid|g" "$SCRIPT_LOCATION/script2.sh"
sed -i "s|19C_CURRENT|/u01/app/oracle/product/19.19.0.0/$DBHOME_NUMBER|g" "$SCRIPT_LOCATION/script2.sh"
sed -i "s|12C_CURRENT|/u01/app/oracle/product/12.1.0.2.230418/$DBHOME_NUMBER|g" "$SCRIPT_LOCATION/script2.sh"
sed -i "s|116_CURRENT|/u01/app/oracle/product/11.2.0.4.230418/$DBHOME_NUMBER|g" "$SCRIPT_LOCATION/script2.sh"
# Print confirmation
echo "Scripts and configuration files updated successfully."
echo "SCRIPT_LOCATION: $SCRIPT_LOCATION"
echo "PATCH_LOG: $PATCH_LOG"
echo "CLUSTER_NAME: $CLUSTER_NAME"
Comments
Post a Comment