Oracle est un problème pour vous? Vous trouvez qu'Oracle est plus compliqué que prévu ? Venez faire un tour ici, peut être vous allez trouver la solution, et si non on peut la trouver pour vous.
Translate
vendredi 26 février 2016
Script IdcAnalyze par tranche
Étant donné le nombre de documents que je dois analyser je me suis créé un petit script qui pourrait m'aider à collecter l'information nécessaire sur l'état de mon index UCM
Le script va déplacer le fichier résultant vers un répertoire FIX afin de pouvoir conserver le résultat partiel contenu dans le fichier "IdcCommand.txt"
Serveur : Linux 64 bits
Exécution : nohup sh ./EVTA.sh &
Fichier: EVTA.sh
#!/usr/bin/ksh
#
#
################################################
cd /appl/oracle/product/Middleware/user_projects/domains/gedXXX/ucm/cs/bin/
################################################
###### Chaque 100000 documents
v_maxloop=100000
###### Min DBId
v_minval=390031
###### Max DBId
v_maxval=15095575
###### Compteur
v_count=0
###### Min Range
v_MinRangID=0
###### Max Range
v_MaxRangID=0
###### Nombre de loops
v_nmbloop=0
###### Date_heure
v_date=""
################################################
if [ -f ./FIX/Log_execution.log ]; then
mv ./FIX/Log_execution.log ./FIX/old_execution.log
fi
if [ -f ./logs/IdcAnalyze.log ]; then
rm ./logs/IdcAnalyze.log
fi
################################################
for ((i=$v_minval;i<=$v_maxval;i=i+$v_maxloop));
do
#########################################
## A chaque boucle
#########################################
if [ "$v_count" -eq "$v_maxloop" ]; then
echo "Break_A "$i #>> ./FIX/Log_execution.log
v_nmbloop=`expr $v_nmbloop + 1`
v_MaxRangID=$((${v_count}*$v_nmbloop))
v_MaxRangID=`expr $v_MaxRangID + $v_minval`
#########################################
## Juste le premiere boucle
#########################################
if [ "$v_nmbloop" -eq "1" ]; then
v_MinRangID=$v_minval
fi
v_date=`date +%Y%m%d_%k%M`
echo "Debut : "$v_date >> ./FIX/Log_execution.log
echo "./IdcAnalyze -index -range $v_MinRangID:$v_MaxRangID –report" >> ./FIX/Log_execution.log
./IdcAnalyze -index -range $v_MinRangID:$v_MaxRangID –report
egrep "Finished checking|Errors Found|Errors Fixed" ./logs/IdcAnalyze.log >> ./FIX/Log_execution.log
if [ -f ./logs/IdcCommand.txt ]; then
mv ./logs/IdcCommand.txt ./FIX/IdcCommand.txt_${v_MinRangID}_${v_MaxRangID}
fi
v_date=`date +%Y%m%d_%k%M`
echo "Fin : "$v_date >> ./FIX/Log_execution.log
echo "------------------------------------------------------------------" >> ./FIX/Log_execution.log
v_count=0
fi
#########################################
## Dernier boucle
#########################################
v_calcullastlopp=`expr $v_maxval - $v_minval`
v_calcullastlopp=$((${v_calcullastlopp}/$v_maxloop))
if [ "$v_nmbloop" -eq "$v_calcullastlopp" ]; then
echo "Break_B "$i #>> ./FIX/Log_execution.log
v_MaxRangID=$v_maxval
v_date=`date +%Y%m%d_%k%M`
echo "Debut : "$v_date >> ./FIX/Log_execution.log
echo "./IdcAnalyze -index -range $v_MinRangID:$v_MaxRangID –report" >> ./FIX/Log_execution.log
./IdcAnalyze -index -range $v_MinRangID:$v_MaxRangID –report
egrep "Finished checking|Errors Found|Errors Fixed" ./logs/IdcAnalyze.log >> ./FIX/Log_execution.log
if [ -f ./logs/IdcCommand.txt ]; then
mv ./logs/IdcCommand.txt ./FIX/IdcCommand.txt_${v_MinRangID}_${v_MaxRangID}
fi
v_date=`date +%Y%m%d_%k%M`
echo "Fin : "$v_date >> ./FIX/Log_execution.log
echo "------------------------------------------------------------------" >> ./FIX/Log_execution.log
fi
v_MinRangID=`expr $v_MaxRangID + 1`
v_count=`expr $v_count + $v_maxloop`
done
Un exemple partiel du résultat :
J'espère que cela vous sera utile.
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire