Closed ersantosnet closed 2 years ago
Also, validate number o commas per line
for i in ls -l *awrhistosstat*.log|awk '{print $9}'|uniq
; do
echo "Processing: "$i
linecounter=0
while read line; do
commascounter=echo -n "$line" | tr -cd , | wc -c
if [ $commascounter -gt 18 ]; then
echo "Filename: "$i", Line Number: "$linecounter", Comma Line Counter: "$commascounter
fi
linecounter=$((linecounter+1))
done < $i
done
Maybe validate only first X rows
Another possible validation is to check: If the files is empty
If any OP log file contains the pattern "ORA-" the file should be skipped. Those files should be flagged to the use with a message that tells them that those files were skipped most likely because there are errors in them and they should be manually reviewed. Exception to this rule are "patchlevel.log" and "alertlog*.log".
Today we can only stop those files using:
grep "ORA-" *log|cut -d ":" -f1|uniq