0

Is there any command line tool that I can use on a DB2 database to dump a specific set of tables?

The problem is that I work in an application that its database tables was created in an existing schema alongside another application tables what would cause a lot of concurrency with these applications.

So after long discussion with our client he finally decide to attend our request to separate our database server since our application grows very large (tables with 14kk rows) and have lots of simultaneous request.

I've searched through DB2 documentation without any success. All the methods I've found out doesn't seems to solve this specific problem.

I read about the Export command. And couldn't find anything the do what we need.

Thanks in advance.

Edit

As asked in comments dump a specific set of tables means that we need to dump some tables from the database not all of then. Say that we have on this database about 5k tables and about 200 of then belongs to our system, so how would we dump only those 200 tables?

On the Export command documentation (mentioned above) there is no mention about exporting a group of tables only a data set (through a SQL command) of tables which does not meet the requirements.

  • How exactly EXPORT does not do what you need? Can you explain in details what you mean by "dump a specific set of tables"? – mustaccio Mar 22 '16 at 21:20
  • @mustaccio I've added some more info to answer your question. Thank you for your time. – Jorge Campos Mar 23 '16 at 1:48
  • Still it's not clear what you mean by "dumping". Do you just need data? Table definitions? Indexes? Foreign keys? etc. – mustaccio Mar 23 '16 at 12:13
  • @mustaccio by dumping I mean copy all tables and associated objects ( definition, data, indexes, FKs, etc ) into a file that can be restored later. Other database engines provides this functionality with the data inside this file in specific format sometimes even compressed. – Jorge Campos Mar 23 '16 at 12:18
2

Check out db2move - it uses export under the covers and offers options to load or import them into the target.

Details are documented here db2move in KnowledgeCenter

An alternative - for those large volumnes - might be a "load from cursor". Once you have created the new database and its objects (db2look) can help here you load the data into the new database. For this solution you have to create individual statements for each table. Check out this article about load from cursor

  • This db2move tool seems really promising, thank you for mention it. I will do the tests tomorrow and let you know. If it work properly I will accept your answer. Thank you again. – Jorge Campos Mar 23 '16 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.