Solved

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

Posted on 2013-11-11
13
918 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 13

Expert Comment

by:alpmoon
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Do you think that my comments didn't help you to find the soultion?
0
 

Author Closing Comment

by:Jay Redd
Comment Utility
this helped get me there
0
 

Author Comment

by:Jay Redd
Comment Utility
it did aplmoon, got my brain going, thanks!
0
 

Author Comment

by:Jay Redd
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

15 Experts available now in Live!

Get 1:1 Help Now