CREATE SEQUENCE seq_the_table; ALTER TABLE the_table ADD( the_table_seq NUMBER ); update the_table set the_table_seq = seq_the_table.NEXTVAL; ALTER TABLE the_table ADD( PRIMARY KEY (the_table_seq));