467,923 Members | 1,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Change column name in replication environment

DB2 8.2 on AIX

Hi,

I'd like to change a column's name in a table which is part of
replication.
This column is identity column (generated always).

1. Since DB2 will drop and recreate the table with the changed column
name, do I have to do something like 'set integrity off'?

2. I think I have to exclude the target table from replication, add it
back once the column name is changed. Is this correct?

Thanks a lot!

Nov 12 '05 #1
  • viewed: 2064
Share:
1 Reply
ib****@yahoo.com wrote:
DB2 8.2 on AIX

Hi,

I'd like to change a column's name in a table which is part of
replication.
This column is identity column (generated always).

1. Since DB2 will drop and recreate the table with the changed column
name, do I have to do something like 'set integrity off'?

2. I think I have to exclude the target table from replication, add it
back once the column name is changed. Is this correct?

Thanks a lot!

1. Retrieve the identity value with which you want to continue.
2. Create the new table WITHOUT the identity property.
3. LOAD the data
4. ALTER TABLE ALTER COLUMN to make the column an identity column again.

Alternatively you can use the IDENTITY OVERRIDE (sp?) option of LOAD and
alter the table to RESTART with the new value.
I have posted a stored procedure that "synchs up" identity columns after
load repeatedly in this forum.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Shino | last post: by
4 posts views Thread by mokles | last post: by
2 posts views Thread by Mick White | last post: by
3 posts views Thread by ymcj | last post: by
6 posts views Thread by craigkenisston | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.