Solved

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

Posted on 2013-11-11
13
977 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
This article outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

688 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