23 lines
862 B
Bash
23 lines
862 B
Bash
# script à exécuter si seulement dbvctl existe et une instance avec le nom de service dbv existe aussi
|
|
|
|
count=$(ps -ef | grep dbvctl | grep -v grep | grep ${ORACLE_SID} | wc -l)
|
|
|
|
if [ $count -gt 0 ]; then
|
|
# les process dbvisit en cours
|
|
echo "<h2>Process DBVisit en cours d'exécution</h2>"
|
|
echo "<pre>"
|
|
ps -ef | grep dbvctl | grep -v grep
|
|
echo "</pre>"
|
|
|
|
# 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))
|
|
|
|
# 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 "<h2>Rapport de GAP DBVisit pour la base ${ORACLE_SID}</h2>"
|
|
echo "<pre>"
|
|
${DBV_HOME}/dbvctl -d ${ORACLE_SID} -i
|
|
echo "</pre>"
|
|
fi
|
|
fi |