Best way to reset an Oracle sequence to the next value in an existing column?
问题 For some reason, people in the past have inserted data without using sequence.NEXTVAL. So when I go to use sequence.NEXTVAL in order to populate a table, I get a PK violation, since that number is already in use in the table. How can I update the next value so that it is usable? Right now, I'm just inserting over and over until it's successful ( INSERT INTO tbl (pk) VALUES (sequence.NEXTVAL) ), and that syncs up the nextval. 回答1: You can temporarily increase the cache size and do one dummy