By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,610 Members | 2,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,610 IT Pros & Developers. It's quick & easy.

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

P: n/a
Is it possible? Thanks!

Carmelo
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.