diff --git a/sh/20_dbvisit_infos.sh b/sh/20_dbvisit_infos.sh index 521f90b..ea1e110 100644 --- a/sh/20_dbvisit_infos.sh +++ b/sh/20_dbvisit_infos.sh @@ -3,16 +3,21 @@ count=$(ps -ef | grep dbvctl | grep -v grep | grep ${ORACLE_SID} | wc -l) if [ $count -gt 0 ]; then - # dbvisit - echo "

Process DBVisit

" + # les process dbvisit en cours + echo "

Process DBVisit en cours d'exécution

" echo "
"
 	ps -ef | grep dbvctl | grep -v grep 
 	echo "
" - echo "

dbvctl gap report

" + # on récupère le chemin de l'executable dbvctl export DBV_HOME=$(dirname $(ps -ef | grep dbvctl | grep -v grep | awk '{print $8}' | sort -u)) - echo "
"
-	${DBV_HOME}/dbvctl -d ${ORACLE_SID} -i
-	echo "
" + # on récupère le statut de la base pour exécuter la commande sur la base primaire + db_prim=$(${DBV_HOME}/dbvctl -d ${ORACLE_SID} -o status | grep -i "read write" | wc -l) + if [ ${db_prim} -gt 0 ]; then + echo "

Rapport de GAP DBVisit pour la base ${ORACLE_SID}

" + echo "
"
+		${DBV_HOME}/dbvctl -d ${ORACLE_SID} -i
+		echo "
" + fi fi \ No newline at end of file