This discussion is archived
2 Replies Latest reply: Jun 30, 2012 3:37 AM by Osama_Mustafa RSS

cluster alert log clean up

853131 Newbie
Currently Being Moderated
Dear all,


Would like to know is there any alarm in moving alert logs generated in the grid infrastructure. The alert log in the grid log directory has grown around 2gb .Our CRS version 11.2.02. on linux. Also pls, if someone could share us a sample script for automating the same.

Thanks in advance
-Dave
  • 1. Re: cluster alert log clean up
    hitgon Expert
    Currently Being Moderated
    you can refer and create the script and schedule using cron

    http://www.mylinuxplace.com/database-tips/rotate-oracle-logs/
    http://www.cyberciti.biz/faq/how-do-i-rotate-log-files/
  • 2. Re: cluster alert log clean up
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    user5350741 wrote:
    Dear all,


    Would like to know is there any alarm in moving alert logs generated in the grid infrastructure. The alert log in the grid log directory has grown around 2gb .Our CRS version 11.2.02. on linux. Also pls, if someone could share us a sample script for automating the same.

    Thanks in advance
    -Dave
    Do you mean rotation Alert log

    You can Use this but change ORACLE_SID, ORACLE _HOME



    #!/bin/bash
    if [ $# -ne 1 ];then
    echo "Usage: `basename $0` "
    exit
    fi

    # Set the Environment
    export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
    export ORACLE_SID=${1};
    export ORAENV_ASK=NO;
    . oraenv;

    # Get the location for the alert log
    bdump=`${ORACLE_HOME}/bin/sqlplus -s /nolog <
    connect / as sysdba ;
    set head off;
    set feedback off;
    set verify off;
    select value from v\\$parameter where name='background_dump_dest';
    exit;
    EOF
    `
    logfile=${bdump}/alert_${ORACLE_SID}.log ;

    # Ensure that the background dump dest exists
    # If so, rotate the log
    if [ -d ${bdump} ]; then
    if [ -f ${logfile} ]; then
    echo "${logfile} rotated at `/bin/date +%Y%m%d%H%M`" ;
    /bin/mv ${logfile} ${bdump}/alert_${ORACLE_SID}.`/bin/date +%Y%m%d%H%M`.log
    if [ $? == 0 ]; then
    /bin/touch ${logfile};
    fi;
    else
    echo "Alert Log ${logfile} does not exist...";
    exit;
    fi;
    else
    echo "Directory does not exist...";
    exit;
    fi;
    date

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points