* script permettant de vérifier la synchro Dataguard, sur tous les SID up #!/bin/bash ############################### BANCO SANTANDER CH ############################## # # Script Name : dg_health.sh # Author : Mikaël DE LAGRANDRIE # Role : UNIX script to check Dataguard status for all active SID # Usage : none # # ------------------------------------------------------------------------------- # REVISIONS # ------------------------------------------------------------------------------- # 1.0 => Initial version (15/04/2024) # ################################################################################ # Checking if current user is Oracle if [ "$USER" != "oracle" ]; then echo "ERROR - this script must be run under ORACLE" exit fi # Oracle sids oracle_sids=( $(ps -ef | grep oracle | grep ora_pmon | sed 's/ora_pmon_//'| awk '{print $8}' |grep -v grep | grep -v sed) ) # compter membre array oracle_sids_nmr=${#oracle_sids[@]} # DG Status and FRA on SID list for i in "${oracle_sids[@]}" do : echo "#########################################" echo "######### $i ####################" echo "==== DATAGUARD ====" ORACLE_SID=$i export ORACLE_HOME=`grep -w ${ORACLE_SID} /etc/oratab | cut -d ":" -f 2` dgmgrl -silent / "show configuration" echo "==== FRA ====" sqlplus -s <