471,832 Members | 1,459 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,832 software developers and data experts.

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

Is it possible? Thanks!

Carmelo
Nov 12 '05 #1
3 11191
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
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.