469,306 Members | 1,896 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

How can I move a table from a schema to another one?

Is it possible? Thanks!

Carmelo
Nov 12 '05 #1
3 10598
1.Use db2look to extract table DDL and then use export and load
command to migrate the table data into the new schema

2. Else just create a Alias in new schema which will poin the
original table .

Nov 12 '05 #2
1.Use db2look to extract table DDL and then use export and load
command to migrate the table data into the new schema

2. Else just create a Alias in new schema which will poin the
original table .

Nov 12 '05 #3
I think I'd do it like that:

Create new table in new schema:
db2 create table <sch2>.<tab> like <sch1>.<tab>

Copy data:
db2 insert into <sch2>.<tab> select * from <sch1>.<tab>

Drop old table:
db2 drop <sch1>.<tab>

Recreate Constraints, Indexes, etc, from original table:
I would do that via a db2look output

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Sgt. Sausage | last post: by
1 post views Thread by gaozj111 | last post: by
2 posts views Thread by JC Voon | last post: by
9 posts views Thread by Joshua.Buss | last post: by
22 posts views Thread by klenwell | last post: by
2 posts views Thread by Frank Swarbrick | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.