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 > Copy list of tables from one db to another db

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-02-10, 12:19
rockycj rockycj is offline
Registered User
 
Join Date: Feb 2007
Posts: 73
Copy list of tables from one db to another db

I'm using DB2 v9.1 Fix Pak 4 with AIX 6.1. I'm still pretty new to DB2, so please be patient with me, I'm learning....

I would like to copy a handful of tables from one of our Production databases to our Test environment and called the database "TEST". I was wondering the best approach of doing this.

I've already Exported the tables using this command "db2move <database> export -tf /path/tmp/listofschematables;" and ready to Load by this "db2move <database> LOAD -lo INSERT -l /path/tmp/".

The TEST database was created in the test environment with a different name than the Production database. Also I copied one of the ddls tables from one Production table and changed the database name in test and ran.

I tried to run the ddl and got these errors "ALTER TABLE "PRODDTA "."F0006" PCTFREE 10 DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0204N "PRODDTA.F0006" is an undefined name."

Should I run the ddl for all of the Production database and edit it for TEST? What is the best approach to this or what am I missing? The goal is to only copy 7 tables from Production env. to the Test env (but Test has a different DB name). That is it.

Please help?

Thank you.

CC
Reply With Quote
  #2 (permalink)  
Old 11-02-10, 14:27
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Consider using the copy ("-co") option of db2move - it will allow you to create listed tables and load data, while changing the target schema name(s).
Reply With Quote
  #3 (permalink)  
Old 11-04-10, 10:02
rockycj rockycj is offline
Registered User
 
Join Date: Feb 2007
Posts: 73
Thank you for the tip.
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