要實(shí)現(xiàn)db2自增序列到最大值,可以通過(guò)以下步驟實(shí)現(xiàn):
SELECT MAX(sequence_name) FROM syscat.sequences WHERE seq_schema = 'schema_name';
ALTER SEQUENCE sequence_name RESTART WITH new_start_value INCREMENT BY new_increment;
SELECT NEXTVAL FOR sequence_name FROM SYSIBM.SYSDUMMY1;
通過(guò)以上步驟,可以實(shí)現(xiàn)將db2自增序列調(diào)整到最大值的實(shí)現(xiàn)。