Find the answer to your Linux question:
Results 1 to 8 of 8
Hi all, I am newbie to shell scripting. I would like to enhance my skills.I would like to construct a shell script to determine the size of my oracle log ...
  1. #1
    Just Joined!
    Join Date
    Jan 2009
    Posts
    6

    Shell script

    Hi all,

    I am newbie to shell scripting. I would like to enhance my skills.I would like to construct a shell script to determine the size of my oracle log files and get an alert via email to tell me that it has exceeded the threshold.

  2. #2
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    Have you ever written a shell script?

    If not I'd recommend having a read through The Advanced Bash Scripting Guide. How are your skills generally on the command line?

  3. #3
    Just Joined!
    Join Date
    Jan 2009
    Posts
    6

    Shell script

    Yes I do. I have average knowledge about unix command line. I have written shell scripts that have helped automate some commands that i need execute all the time.
    This has been scheduled with a cron job. Now i want to take on something quite challenging.

    Thanx.

  4. #4
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    Alright, sounds good! Let's see what you've got so far and we can take it from there.

  5. #5
    Just Joined!
    Join Date
    Jan 2009
    Posts
    6
    #!/bin/bash
    #. /home/oracle/.bash_profile

    ORACLE_HOME=/x02/app1/oracle1/product/10.2.0/db_1; export ORACLE_HOME
    ORACLE_SID=xxx2
    error=Archive

    egrep "ORA-|Archive*" /x02/app1/oracle1/admin/xxx2/bdump/alert_xxx2.log>/dev/null 2>&1
    if [ $error="Archive*" ]
    then mailx -n -s "Check alert log rrs2 for oracle errors..." \
    xxx@abcde.com < /x02/app1/oracle1/admin/xxx2/bdump/alert_xxx2.log
    fi



    This is the sample script. The idea is to check for errors concerning the size of the of the oracle archive logs and email it to the address but it is not doing the needful.
    Any help would be appreciated.
    Thanx

  6. #6
    Just Joined!
    Join Date
    Jan 2009
    Posts
    6
    hi all,
    still need help, bigtomrodney can i get a response

  7. #7
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    Can you post the errors your're getting?

    How are you getting on running each command one at a time?

  8. #8
    Just Joined!
    Join Date
    Jan 2009
    Posts
    6
    its not sending any mails nd its not givin me the archive log errors that i need.it just executes nd goes 2 d nxt shell. Thats all.
    Thanks

Posting Permissions

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