Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011
    Posts
    2

    Unanswered: 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!

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    If you use LOAD instead of IMPORT, it will by default look for the file on the DB2 server. It will be faster too.

  3. #3
    Join Date
    Mar 2011
    Posts
    2
    I don't have the privilege to issue a "load" command -- sorry should have mentioned that.

  4. #4
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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 18:41.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •