Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Posts
    52

    Unanswered: Oracle availabilty

    Hi,

    Does any one have script in Unix level that will check if DB is up and send alert if no.


    thanks

  2. #2
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    It depends on the db version. One could say "look at the oracle processes" but then that will not guarantee you the "db is up" just oracle processes are (it can be in restricted mode, for example). I would simply try to connect to it and catch whatever returns me (for example). That way I could determine if its really up for what I want.

  3. #3
    Join Date
    Feb 2004
    Posts
    143
    Here's a script that I use to check if databases are running on a particular host. You could use the same logic, I guess, in your situation. This script checks for database availability(the pmon process of a database) as well as oracle listeners.


    #!/bin/ksh
    # File : DB_Status.ksh
    # Desc : Script that lists the databases and listeners
    # that are available.
    echo "--------------------------------------"
    print "Date : "`date '+%m/%d/%y %X %A'`
    print "Desc : Database and Listener Check"
    echo "--------------------------------------"

    print "\n\t********* List of Database(s) on $host **********"
    ps -efo comm | grep pmon | cut -c 10-17 | while read DB
    do
    print "\t$DB"
    done

    print "\n\t******** List of Listener(s) on $host **********"
    ps -ef | grep tns | awk -F/ '{print $9}' - | while read TNS
    do
    print "\t$TNS"
    done

    return 0;

    Hope this helps

Posting Permissions

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