Results 1 to 7 of 7

Thread: DB2 data export

  1. #1
    Join Date
    Apr 2014
    Posts
    5

    Unanswered: DB2 data export

    Hi all,
    We are using Db2(8.2.8). We want to migrate the data from Db2 to mySQL.Data size is quite big.(Around 25 tables and size is 25GB).
    I was browsing through IBM-docs. DB2 has Export utility which we can use to copy data from DB2 to CSV file. What are the different options available to achieve this?(No migration tools is allowed in this environment).
    1)PERL/python script which will run Export command,create files and then import them to mySQL using mySQL import utility?
    2)Java program to do the same?

    Regards
    D

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    db2look to extract all ddl
    db2move to generate export scripts and export data
    ddl has to be adapted before use..
    import has to be done with target utility
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Apr 2014
    Posts
    5

    Thanks

    Thanks a lot.Just to inform, we have already created database schema and tables in postgres(also required triggers and stored procedures).
    Only data needs to be migrated. In that case, do we still need DDLs etc?

  4. #4
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    If your target tables (in posgres, or mysql) are compatible with the CSV exports from DB2 then you would not need DDL extracted from DB2 (except for reference purposes).

  5. #5
    Join Date
    Apr 2014
    Posts
    5

    Thanks

    Thanks. "db2move" command can be used to export user tables data.But as per documentation(http://publib.boulder.ibm.com/infoce...2Fr0002079.htm) this command ouputs PC/IXF format.i hope it allows for CSV format too.

  6. #6
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Yes. You need DDL. Generate it with db2look and write 'sed' lines unitll it is compatible with your target database. You're lucky that DB2 uses the ANSI standards so it will not be too hard. Generate CSV exports to move the data. If db2move will not generate CSV's for you it will be very easy to script them exports yourself.

    When you go from 1 DB2 to another DB2 you can skip the DDL and use IXF file format which not only contains data, but also a table description. That is an IBM internal format and as far as I know, not other database systems are able to decode that.

    Sorry to see you leave DB2...
    Somewhere between " too small" and " too large" lies the size that is just right.
    - Scott Hayes

  7. #7
    Join Date
    Apr 2014
    Posts
    5

    Thanks

    Thanks. We want to move only data from Db2 to mySQL. Target tables in mySQL/Stored procedures already exist.
    I found one tool(which can be run from command line),SQLWorkbench- which does export and import of data.

Posting Permissions

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