Tuesday, November 30, 2010

Oracle Database archive Alert Log

Hello DBAs,

Here is the simple script which can be used for clear archive log on every Sunday. I know we should make it smart but this is for easy setup :)

Steps 1: create a shell script to do this operation


#!/usr/bin/sh
# File name : alert_log_archive.sh
LOGFILE=/u01/oracle/12.1.1/diag/rdbms/dev/DEV/trace/alert_DEV.log
DDATE=`date +"%Y%m%d"`
cp $LOGFILE $LOGFILE.$DDATE
cat /dev/null > $LOGFILE
touch $LOGFILE


Steps 2: schedule it in cronjob

30 23 * * 0 sh /home/oracle/alert_log_archive.sh



Please put your suggestion in a comment.

Ubuntu - Install trivy image scanner

How to Install Trivy Image Scanner on Ubuntu (Step-by-Step Guide) Trivy is a popular open-source vulnerability scanner used in DevSecOps ...