Forum Stats

  • 3,826,359 Users
  • 2,260,635 Discussions


Feature request: convert existing column to identity column

User_7CD4H Member Posts: 4 Red Ribbon

At the time of writing, there is no easy way to convert PK column with data to identity column. The current approach is to add another column as identity, update new identity column value to existing PK and rename columns. (optionally drop old PK column)

Given adding new identity column and update takes time, and seems to be redundant work. (identity column is first populated with dummy value and then overwrite with existing PK value.)

We would like to see if there is a way to convert existing PK to identity column.

(we have dbms_redefinition to reduce conversation time, but it is not feasible especially we are currently using schema consolidation and each each schema have 2k tables. <- each instance has about 300 schema, and each schema have 2k table and we have 100 such databases...)