FAQ
Hi,

I need windows scripts to monitor 9i database(win 2003 server)


1)database and listener up and down status
2)alert log scan
3)alert log rename


Thanks for any help

Reg,
Ed

Search Discussions

  • Robert Freeman at Mar 16, 2009 at 12:11 am
    And how much per hour are you willing to pay?;-)
    Have you looked at OEM lately? It will handle the first two of these nicely.

    :-)

    RF


    Robert G. Freeman
    Author:
    Blog: http://robertgfreeman.blogspot.com
    OCP: Oracle Database 11g Administrator Certified Professional Study Guide (Sybex)
    Oracle Database 11g New Features (Oracle Press)
    Portable DBA: Oracle (Oracle Press)
    Oracle Database 10g New Features (Oracle Press)
    Oracle9i RMAN Backup and Recovery (Oracle Press)
    Oracle9i New Features (Oracle Press)
    Other various titles out of print now...
    The LDS Church is looking for DBA's. You do have to be a Church member in
    good standing. A lot of kind people write me, concerned I may be breaking
    the law by saying you have to be a Church member. It's legal I promise! :-)

    From: edwin devadanam
    To: oracle-l@freelists.org
    Cc: kanna.blue_at_gmail.com
    Sent: Sunday, March 15, 2009 8:28:02 AM
    Subject: Windows scripts requirement!!!

    Hi,


    I need windows scripts to monitor 9i database(win 2003 server)


    1)database and listener up and down status
    2)alert log scan
    3)alert log rename

    Thanks for any help


    Reg,
    Ed
  • Guillermo Alan Bort at Mar 16, 2009 at 12:40 am
    look for services... instance services are OracleService and
    listener is Listener (except when
    LISTENER_NAME is LISTENER), for alert log scan, you can use a third
    party monitoring tool, or use windows equivalent of more (which really
    sucks) and some sort of regular expression filter (perhaps you'll need
    python). Alert log rename, this can be done with WinAPI32, perhaps
    there is a program out there that already does that, but if you are a
    bit savvy with C or VB (pfff) you could do something yourself.

    HTH

    Alan Bort
    Oracle Certified Professional

    On Sun, Mar 15, 2009 at 11:28 AM, edwin devadanam
    wrote:
    Hi,

    I need windows scripts to monitor 9i database(win 2003 server)

    1)database and listener up and down status
    2)alert log scan
    3)alert log rename

    Thanks for any help

    Reg,
    Ed
    --
    http://www.freelists.org/webpage/oracle-l
  • Ujang Jaenudin at Mar 16, 2009 at 2:40 am
    use activestate perl + pstools + code yourself :)
    i have been used it, and quite stable.

    On Sun, Mar 15, 2009 at 9:28 PM, edwin devadanam
    wrote:
    Hi,

    I need windows scripts to monitor 9i database(win 2003 server)

    1)database and listener up and down status
    2)alert log scan
    3)alert log rename

    Thanks for any help

    Reg,
    Ed
    --
    thanks and regards
    ujang | oracle dba | mysql dba
    http://ora62.wordpress.com
    --
    http://www.freelists.org/webpage/oracle-l
  • Jared Still at Mar 16, 2009 at 9:36 pm

    On Sun, Mar 15, 2009 at 7:28 AM, edwin devadanam wrote:


    1)database and listener up and down status
    2)alert log scan
    I personally recommend the scripts from this book:
    http://oreilly.com/catalog/9780596002107/

    :)

    Scripts and PDBA libs can be found here as well:
    http://jaredstill.com/misc.html

    Very effective, but not trivial to setup.

    Then again, what you are asking for is never trivial to setup
    if it is also robust.

    3)alert log rename
    The Perl script at the end of this post works quite nicely for #3.
    It works in Windows (ActiveState Perl) and *nix.

    Just change the value of the $sourceLog variable

    The variable $daysToKeepLog determines how old a zipped
    up log file must be before it is deleted.

    Jared Still
    Certifiable Oracle DBA and Part Time Perl Evangelist

    #!/home/oracle/perl/bin/perl -w

    use strict;
    use File::Find ();
    use File::Basename;
    use Archive::Zip qw( :ERROR_CODES :CONSTANTS );

    #
    my ($logPrefix, $logSuffix ) = qw{alert_ .zip};
    my $daysToKeepLog = 90;
    my $sourceLog = 'I:\oracle\QAS\saptrace\background\alert_qas.log';

    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
    $year += 1900;
    $mon++;
    my $date = sprintf("%4d-%02d-%02d.%02d-%02d-%02d",
    $year,$mon,$mday,$hour,$min,$sec);
    my $targetZip = qq{${sourceLog}.${date}.zip};

    my $zip = Archive::Zip->new();
    my $member = $zip->addFile($sourceLog);

    die 'logmgr write error' unless $zip->writeToFileNamed($targetZip) == AZ_OK;

    open(LOG, ">$sourceLog") || die "cannot open $sourceLog for write - $! \n";
    print LOG qq{ \n};
    close LOG;

    # delete old logs if needed > 90 days
    # Set the variable $File::Find::dont_use_nlink if you're using AFS,
    # since AFS cheats.

    # for the convenience of &wanted calls, including -eval statements:
    use vars qw/*name *dir *prune/;

    *name = *File::Find::name;
    *dir = *File::Find::dir;
    *prune = *File::Find::prune;

    # Traverse desired filesystems
    # a delete the old files

    File::Find::find({wanted => \&wanted}, dirname($sourceLog));
    exit;

    sub wanted {

    my ($dev,$ino,$mode,$nlink,$uid,$gid);

    (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
    -f _ &&
    (int(-M _) > $daysToKeepLog) &&
    /^$logPrefix.*$logSuffix\z/s &&
    (unlink($_) || warn "$name: $!\n");
    }

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedMar 15, '09 at 2:28p
activeMar 16, '09 at 9:36p
posts5
users5
websiteoracle.com

People

Translate

site design / logo © 2022 Grokbase