Solved

How to test the sybase connection.

Posted on 2008-10-10
4
2,757 Views
Last Modified: 2012-05-05
Hai !
       we are pulling the data from a sybase remote machine.
Before extracting i need to test the sybase connection status. How to do this ?

How can we determine that the connection failed (sybase database down) ?
0
Comment
Question by:vishali_vishu
4 Comments
 
LVL 2

Expert Comment

by:navid86
ID: 22690737
If I understand the question properly, you need to check the ODBC connection.  This is under the control panel in Windows XP.  Control Planel > Administrative Tools > Data Sources (ODBC).

Under user DSN or system DSN you should see your ODBC connection.  Highlight your connection then click Configure.  At the bottom of the Configure screen there is a Test Connection button.  You can click that to test your connection.

Hope this helps!
0
 
LVL 19

Accepted Solution

by:
grant300 earned 500 total points
ID: 22690844
I am betting that you are doing the data pull automatically in some kind of script and want to put a check of the Sybase connection into the process so you can tell what is wrong.  Since you specify Unix, I figure there is no ODBC.  That's O.K.; it actually makes things easier.

Since you are on a Unix/Linux platform, you will have the Sybase Client Library (CT-lib) and it's associated components installed.  On Windows machines there is a utility called "sybping" for testing connections but there is no equivalent on Linux or Unix.  The script below will do roughly the same thing using ISQL and some shell commands to determine success or failure.  I believe this was posted somewhere by Michael Peppler, a well know Sybase guru.  It looks like it might be a little rough yet.

Regards,
Bill



#!/bin/sh
 

srv=$1

logfile=/tmp/sybping.$$

isql -Usa -PTryItNow -S$srv >$logfile 2>&1
 

# ASE

grep 'Login failed' $logfile >/dev/null

if [ $? -eq 0 ]

then

echo "Server $srv is up"

exit 0

fi
 

# Generic message when connection fails.

grep "connect two endpoints failed" $logfile >/dev/null

if [ $? -eq 0 ]

then

echo "Server $srv is unreachable"

exit 1

fi
 

echo "Unknown sybping error:"

cat $logfile

exit -1

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now