From b39215d1f4f705178a767b76c55a0047628b11ef Mon Sep 17 00:00:00 2001 From: Yacine31 Date: Thu, 13 Oct 2022 14:07:28 +0200 Subject: [PATCH] Create alertlog_color.sh --- alertlog_color.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 alertlog_color.sh diff --git a/alertlog_color.sh b/alertlog_color.sh new file mode 100644 index 0000000..175c119 --- /dev/null +++ b/alertlog_color.sh @@ -0,0 +1,19 @@ +COL_NORMAL=$(tput sgr0) +COL_ROUGE=$(tput setaf 1) +COL_VERT=$(tput setaf 2) +COL_JAUNE=$(tput setaf 3) +COL_BLUE=$(tput setaf 4) +COL_VIOLET=$(tput setaf 5) +COL_CYNA=$(tput setaf 6) +COL_BLANC=$(tput setaf 7) +COL_GRIS=$(tput setaf 8) + + +tail -100f /u01/app/oracle/diag/rdbms/$(echo ${ORACLE_SID} | tr 'A-Z' 'a-z')/${ORACLE_SID}/trace/alert_${ORACLE_SID}.log | sed -E \ + -e "s,^($(date +'%a %b')).*,${COL_JAUNE}&${COL_NORMAL},g" \ + -e "s,.*(ALTER|alter).*,${COL_VERT}&${COL_NORMAL},g" \ + -e "s,.*WARNING.*,${COL_VIOLET}&${COL_NORMAL},g" \ + -e "s,.*(ERROR:|ORA-).*,${COL_ROUGE}&${COL_NORMAL},g" \ + -e "s,.*,${COL_NORMAL}&${COL_NORMAL}," + +