Monitor DB With UNIX Shell Script Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Monitor DB With UNIX Shell Script

  1. #1
    Join Date
    Dec 2000
    Washington DC
    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?

    Ken H.
    Ken Hinerman
    Data Interaction

  2. #2
    Join Date
    Nov 2000
    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";
    Jeff Hunter
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

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