Solved

Sybase Windows Command Line BCP - Driver Call To Connect Two End Points Failed

Posted on 2013-11-11
13
931 Views
Last Modified: 2013-11-13
I've been doing some Sybase stuff on Linux and have bcp in's and out's working great. Here's my working bcp out on linux:

bcp drd02.dbo.APPL_ENVIRONMENT out APPL_ENVIRONMENT.bcp -U sa -P SyAdmin  -n

When trying the same in Windows, I get the following error:

ct_connect(): network packet layer: internal net library error: Net-Lib protocol
 driver call to connect two endpoints failed

Here's a few pertinent details:

I can connect to my server via iSQL GUI. Its shown as Sybase157 0.0.0.0  5000 and my Drd02 database is online and available.

Contents of the c:\sybase\ini\sql.ini  are (I added the drd02 lines):

[Sybase157_XP]
master=NLWNSCK,0.0.0.0,5001
query=NLWNSCK,0.0.0.0,5001
drd02=NLWNSCK,0.0.0.0,5001

[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

[Sybase157_JSAGENT]
master=NLWNSCK,0.0.0.0,4900
query=NLWNSCK,0.0.0.0,4900



The environment variables are:

%DSQUERY%=Sybase157
%SYBASE%=c:\Sybase


No matter what I try, it's just not connecting. I'd be happy for any help that could be provided.
0
Comment
Question by:Jay Redd
  • 8
  • 4
13 Comments
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 39641403
Are you using exactly the same command line? If not can you show us your Windows command line?

You might need to try explicitly adding the ASE server name to the bcp command line... I don't put my faith in DSQUERY working correctly...
0
 

Author Comment

by:Jay Redd
ID: 39641789
I tried that:

bcp drd02.dbo.APPL_ENVIRONMENT out APPL_ENVIRONMENT.bcp -U sa -P SyAdmin -S Sybase157 -n

but I get the same result.
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39641900
Command line environment might be different than GUI environment. Have you tried isql on command line, whether it connects to Sybase157 or not?
0
 

Author Comment

by:Jay Redd
ID: 39641956
yes, I can for example run:
    dbisql -host 123.123.123.123 -port 5000 -c "uid=sa;pwd=thepw"  \delivery\create.sql

(where 123.123.123.123 is the box's ip)
0
 
LVL 13

Accepted Solution

by:
alpmoon earned 500 total points
ID: 39642061
What about command line isql:

isql -U sa -P SyAdmin -S Sybase157

Also can you try the same with IP address like below?

isql -U sa -P SyAdmin -S 123.123.123.123:5000
0
 

Author Comment

by:Jay Redd
ID: 39642084
i have never been able to get -S 123.123.12.3:5000 to work with bcp in linux or windows, I think -S is for referring over to interface (linux) and sql.ini (windows).
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 13

Expert Comment

by:alpmoon
ID: 39642130
It depends on your Open Client version. I think OCS 15.5 and later works with IP address (maybe 15.0 as well).

What about command line isql, does it work?
0
 

Author Comment

by:Jay Redd
ID: 39642133
I figured it out. The fact that i could get into isql with the IP address made me think that maybe 0.0.0.0 is somehow not available to Bcp.

I modified c:\sybase\ini\sql.ini with the following:

from:
[Sybase157]
master=NLWNSCK,0.0.0.0,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000


to:
[Sybase157]
master=NLWNSCK,123.123.123.123,5000
query=NLWNSCK,0.0.0.0,5000
drd02=NLWNSCK,0.0.0.0,5000

after putting my public IP address of my vm in the sql.ini, bcp was able to speak to it correctly.
0
 

Author Comment

by:Jay Redd
ID: 39642178
I've requested that this question be closed as follows:

Accepted answer: 0 points for Beatscribe's comment #a39642133

for the following reason:

solved it myself
0
 
LVL 13

Expert Comment

by:alpmoon
ID: 39642175
Do you think that my comments didn't help you to find the soultion?
0
 

Author Closing Comment

by:Jay Redd
ID: 39642179
this helped get me there
0
 

Author Comment

by:Jay Redd
ID: 39642184
it did aplmoon, got my brain going, thanks!
0
 

Author Comment

by:Jay Redd
ID: 39645561
I should mention this is just a temporary fix, this will close off sybase_157 from outside traffic i think. you'd need a loopback adaptor or something to do it as a permanent fix.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SYSBASE IQ how to filter the table rows thru the TIMSTAMP column value. 3 577
Sybase - CronJob schedule 2 591
connect to sybase then query 1 712
Sybase Adaptive server 4 137
Lotus Notes – formerly IBM Notes – is an email client application, while IBM Domino (earlier Lotus Domino) is an email server. The client possesses a set of features that are even more advanced as compared to that of Outlook. Likewise, IBM Domino is…
When converting a physical machine to a virtual machine using VMware vCenter Converter Standalone or vCenter Converter Enterprise, if an adapter type is not selected during the initial customization the resulting virtual machine may contain an IDE d…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

943 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

10 Experts available now in Live!

Get 1:1 Help Now