Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use shell to extract the alert log of the day of oralce

Shulou Source: shulou.com Published: 2022-06-03 07:42:03 10月03日 Update

This article will explain in detail how to use shell to extract the alert log of the day of oralce. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

A shell script that extracts the alert log of the day of oralce

The code is as follows:

# / bin/sh

# get alert of everyday

# then name of file is everyday_alert.sh

Dir= "/ oracle/admin/bbdz/bdump"

Num=$ (cat-n ${dir} / alert_bbdz.log | grep "`date | cut-c 1-10`" | head-n 1 | awk'{print $1}')

Tail + ${num} ${dir} / alert_bbdz.log > > / oracle/admin/bbdz/alert/alert_bbdz_ `date +'% Y% m% d``. Log

Set the execution plan

The code is as follows:

Crontab-e

58 23 * sh / oracle/script/every_alert.sh

This is the end of this article on "how to use shell to extract the alert log of the day of oralce". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Articles code more good practical content articles knowledge scripts references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Xiaomi Apple macOS Microsoft