Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Location
    SA
    Posts
    9

    Unanswered: Need to cron a Script that resumes connection to Server.database

    I need to write a script that resumes the replication connection to a database if the connection is broken. I usually have to manually resume it through a GUI called Sybase Central, but when i'm not here the connection remains down and the replication queue builds up. So I want to run a script every hour or so to check if any connection is down and automatically bring it up. It will have to be a Unix script though.
    If you can help me with this please let me know.
    Really appreciate it.
    shenese

  2. #2
    Join Date
    Jun 2006
    Posts
    16
    Script can go like this

    #!/usr/bin/ksh

    PASS=abcd

    for DOWN in `isql -Usa -SRS <<EOF | grep "DSI EXEC" | awk '{print $2}'
    $PASS
    admin who_is_down
    go
    exit
    EOF`
    do
    isql -Usa -SRS <<EOF
    $PASS
    resume connection to $DOWN
    go
    EOF

    enjoy.
    This will not run as is. you may have to tweak rhe GREP and awk part

  3. #3
    Join Date
    Feb 2002
    Location
    Willy is on vacation
    Posts
    1,208
    This is bad design. You should not have resume connection in the crontab. There is no point, if a connection has gone down no matter how many times you resume it won't come up unless handled by an error class.

    A better design is to create an error_class for that condition and let Rep Server handle it.

  4. #4
    Join Date
    Oct 2005
    Location
    SA
    Posts
    9
    i actually wrote an error class to catch the error message number.
    and resumed the connection.
    but i didn't cron it.
    seems to work but will still have to test it.
    Thanks so much
    appreciate it.
    Shen

Posting Permissions

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