DBAsupport.com Forums - Powered by vBulletin
Results 1 to 9 of 9

Thread: Email Alert Log and Scan with FINDSTR

  1. #1
    Join Date
    Nov 2000
    Posts
    416
    Do you know any script or windows tools that Scan the ORACLE alert log for errors using the FINDSTR command and email it to me if it find ORA- String??
    An ounce of prevention is worth a pound of cure

  2. #2
    Join Date
    Apr 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    1,203
    Are you running unix, cause I have a script for UNIX.
    OCP 8i, 9i DBA
    Brisbane Australia

  3. #3
    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    323
    Hi Johnson,

    Can you send it me. my email id is : nrgannamani@yahoo.com


    Thanks in Advance
    Nagesh

  4. #4
    Join Date
    Apr 2001
    Posts
    46
    Hi johnson,

    Pls.send that script to me
    My mail id :
    ravisanapala@yahoo.com

  5. #5
    Join Date
    Feb 2002
    Posts
    21
    hi johnson,

    Can you please send me the script aswell.

    email: kevwidd@hotmail.com

    Thanks in advance

    Kev.

  6. #6
    Join Date
    Feb 2001
    Posts
    290
    Script: #!/bin/ksh
    #---------------------------------------------------------------------------
    -------
    #
    # Filename: alerts.ksh
    #
    # Description: Automatic monitoring of the production
    # database's ALERT LOG file for exceptions.
    #
    # Author: Sandeep Sahore
    #
    #---------------------------------------------------------------------------
    -------
    #
    # Initialize the variables that are to be used in this script.
    #
    C_DATE=`date +"%a %b %e "`
    C_HOUR=`date +"%H"`
    C_TIME=`date +"%p"`
    DBA='your_login_name@some_org.com'
    #
    # Xtract current date records from alert file & scan it for ORA-errors.
    #
    sed -n "/^$C_DATE/,$ p"
    $ORACLE_BASE/admin/$ORACLE_SID/bdump/alert_.log > temp$$
    #
    sed -n '/^ORA-/ p' temp$$ > ora_errors
    #
    # Variable LN_CNT initialized to the no. of lines in the ora_errors
    file.
    #
    LN_CNT=`wc -l < ora_errors`
    #
    # If ora_errors file has lines in it, then mail is sent to the DBA.
    #
    if [[ $LN_CNT -ge 1 ]]
    then
    mailx -s 'Please Check the ALERT_PLCPRD.LOG File for Errors' $DBA
    <
    ora_errors
    fi
    #
    # Reschedule daily execution of script - morning, evening and night.
    #
    if [[ $C_TIME = PM ]]
    then
    if [[ C_HOUR -ge 16 & C_HOUR -lt 23 ]]
    then
    at -mk 11:55pm <;-EOF
    alerts.ksh
    EOF
    else
    at -mk 8:00am <-%%
    alerts.ksh
    %%
    fi
    elif [[ $C_TIME = AM ]]
    then
    at -mk 4:00pm <-!!
    alerts.ksh
    !!
    else
    :
    fi
    #
    trap 'rm temp$$' 0 2 3 15
    #
    # end-of-script
    #


    PS: copy the above to UNIX VI Editor and see the if you need any changes.

    Thanks
    Madhu

  7. #7
    Join Date
    Nov 2000
    Posts
    416
    Actually our Database is in Windows NT, I need the script for Windows NT, that's whyt I said FINDSTR which is a DOS Batch command , please provide if you have a clue
    An ounce of prevention is worth a pound of cure

  8. #8
    Join Date
    Oct 2000
    Posts
    57
    I would also be interested in this script for Windows NT

  9. #9
    Join Date
    Feb 2001
    Posts
    290
    The following Link might help you ...

    I have never worked on NT, so after downloading the script, i suggest you go for R&D and then only implemet in production

    http://www.peoplesoftpros.net/net/sc...sp?scriptid=39

    Thanks,
    Madhu

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width