DB2 – COPY a table

19 January,2012 by Tom Collins

Different methods of extracting DDL and moving data.  Use according to the situation

1)  Gives you the table CREATE statements

 

db2look -d  DBNAME -e -t TABNAME

 

2) Use the DB2 Control Center to copy table and data

3)  Use the CREATE … LIKE   for the table structure

 

CREATE TABLE    LIKE  

Follow up with 

INSERT INTO TAB1 (SELECT * FROM TAB2)

 

See Also

db2move to copy data between databases

Author: Rambler(http://www.dba-db2.com)

Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on DB2 – COPY a table

Comments are moderated, and will not appear until the author has approved them.


dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright