tags:

views:

165

answers:

2

I am searching for tools to dump db2 tables (like sqlyog or MySQL browser in MySQL).

Can you suggest me some?

Thanks

A: 

Can you describe what you exactly want to do? Do you stay within the db2 realm or do you want to import that stuff in a different DBMS like SQL Server or Oracle?

One option would be to generate the DDL using the 'Generate DDL' Option that is available in the DB2 Control Center or the db2look tool (Control Center calls this tool). The data you can dump by running the export command. This will create an CSV file which you can import using the import command. You might be able to import the data using a different Database engine (MS SQL Server or Oracle).

Peter Schuetze
A: 

DB2 ships with a utility called db2look that will do what you're looking for. Try this command:

 db2look -d MYDATABASE -a -e -o mydatabase.sql

If you're looking to take the data with you, the command db2move could also be useful. Effectively, it does a db2look as described above, and also exports the data from every table. Then on your new database, you can import and be good to go. In my experience, we used this to migrate from DB2 running on Windows to DB2 on Linux.

 db2move MYDATABASE EXPORT

Loading on the other instance is equally easy:

 db2move MYDATABASE IMPORT

Check db2move -h for more information.

Scott Jones