From 1ced2713fd29cf459b9e350bcb9f5f391ddcd2e2 Mon Sep 17 00:00:00 2001 From: Yacine31 Date: Wed, 24 Nov 2021 05:28:53 +0100 Subject: [PATCH] Create alterlog_color.sh coloration de tail alertlog --- alterlog_color.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 alterlog_color.sh diff --git a/alterlog_color.sh b/alterlog_color.sh new file mode 100644 index 0000000..175c119 --- /dev/null +++ b/alterlog_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}," + +