Golden gate capture details
#1/bin/bash
#Ask the user for the log directory
read -p "Enter the log directory: " log_dir
#Check if the log directory is provided
if [ -z "$log_dir" ]; then
echo "Log directory not provided. Exiting."
exit 1
fi
#Create log directory if it doesn't exist
mkdir -p "$log_dir"
#Loop through files named exactly setup_ogg and execute ggsci commands
for value in $(locate setup_ogg | grep -E '/setup_ogg$'); do
source $value
# Extract Oracle GoldenGate home GG_HOME=$(dirname "$value")
# Replace "/" with "" in GG_HOME to create a valid filename GG_HOME_FILE=$(echo "$GG_HOME" | tr '/' '_')
#Create a unique log file for each Oracle home log_file="$log_dir/gg_info_$GG_HOME_FILE.log"
#Change to Oracle GoldenGate home
cd "$GG_HOME"
# Print a separator in the log file for better readability
echo "======________________==================" > "$log_file"
echo "Executing 'info all' in $GG_HOME" >> "$log_file"
# Run ggsci command and append the output to the log file /ggsci <<EOF >> "$log_file"
info all
INFO ER detail
EOF
done
Comments
Post a Comment