Golden gate stop v1
#!/bin/bash read -p "Enter the log directory: " log_dir if [ -z "$log_dir" ]; then echo "Log directory not provided. Exiting." exit 1 fi mkdir -p "$log_dir" for value in $(locate setup_ogg | grep -E '/setup_ogg$'); do source $value cp $value $value_prepatch_bkp'$(date +"%Y%m%d%H%M%S")' GG_HOME=$(dirname "$value") GG_HOME_FILE=$(echo "$GG_HOME" | tr '/' '_') log_file="$log_dir/gg_info_$GG_HOME_FILE.log" cd "$GG_HOME" echo "==cccccces === ============" > "$log_file" echo "Executing 'info all' in $GG_HOME" >> "$log_file" ./ggsci <<EOF >> "$log_file" STOP ER * detail EOF done # Capture the log without the header export ORACLE_SID=$(ps -ef | grep '[a]sm_smon.*+ASM' | awk '{print $NF}' | cut -d '_' -f3) source oraenv <...