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

Thread: Monitor DB With UNIX Shell Script

  1. #1
    Join Date
    Dec 2000
    Location
    Washington DC
    Posts
    42
    I'm looking for an inexpensive method to monitor if my Oracle database is up or down and determine if I can connect to it remotely.

    Does anyone have a UNIX shell script that would allow me to attempt a SQL*Plus connect and if it fails shoot an email out to a specified distribution list?

    Thanks
    Ken H.
    Ken Hinerman
    Data Interaction
    DBASupport@datainteraction.com

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    I wrote a perl script to go out and "ping" databases. If a connection to the database fails, it sends mail to a particular id (in my case, my pager).

    The basics of the oracle connect are:

    #!/usr/local/bin/perl -w
    use strict;
    use DBI;

    scalar(@ARGV)==1 || die ("usage");

    my $name = $ARGV[0];

    my $drh = DBI->install_driver('Oracle');
    my $dbh = connect($name,'/','') || die "Can not connect: $DBI::errstr\n";
    $dbh->disconnect;
    exit;
    Jeff Hunter

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