If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 "IMPORT FROM" question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-29-11, 14:47
pmgaudet pmgaudet is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
db2 "IMPORT FROM" question

Hi,

I'm new to db2 so I apologize if this is a dumb question (because it feels like it). Here's what I'm trying to do. I've got a db2 instance that I need to load data into from a SQL Server db. Right now I plop my data into a csv, FTP the file to the DB2 server, SSH into the server and then run an IMPORT FROM command from the command line. IMPORT reads from the file on the server loads quickly and life is beautiful.

My question is, is there a way to do this without SSHing into the DB2 machine and issuing the command there? Can I just connect to the db2 database on my machine and have my command tell the DB2 engine to look for the file on it's local machine instead of my machine?

e.g. IMPORT FROM 'db2servermachine/home/sdfsdfsd/file.csv' of DEL INSERT INTO my table blah. blah

When I run the import command from my machine it takes hundreds of times longer than when I run the import command on the DB2 instance's machine. Any help is appreciated!
Reply With Quote
  #2 (permalink)  
Old 03-29-11, 15:21
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
If you use LOAD instead of IMPORT, it will by default look for the file on the DB2 server. It will be faster too.
Reply With Quote
  #3 (permalink)  
Old 03-29-11, 15:37
pmgaudet pmgaudet is offline
Registered User
 
Join Date: Mar 2011
Posts: 2
I don't have the privilege to issue a "load" command -- sorry should have mentioned that.
Reply With Quote
  #4 (permalink)  
Old 03-29-11, 17:22
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
You can try using "buffered inserts", but I don't think this option will help in your case:
IBM DB2 9.7 for Linux, UNIX and Windows Information Center


I think I've only used this option with imports in a multi-partitioned env

Last edited by db2girl; 03-29-11 at 17:41.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On