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 "
" ps -ef | grep dbvctl | grep -v grep echo "" - 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 ""
+ ${DBV_HOME}/dbvctl -d ${ORACLE_SID} -i
+ echo ""
+ fi
fi
\ No newline at end of file