Use the ALTER SEQUENCE command to reset a user sequence option, including the name and owner of the sequence. This statement affects only future sequence numbers.
ALTER SEQUENCE <seq_name> <clause> [<clause>…]
INCREMENT BY <value> |
NO CYCLE | CYCLE |
NO MAXVALUE | MAXVALUE <value> |
NO MINVALUE | MINVALUE <value> |
OWNER TO <value> |
RENAME TO <value> |
RESTART WITH <value>
| Input | Description |
|---|---|
| <seq_name> | The name of the sequence. |
| INCREMENT BY | Set a new increment value. |
| NO CYCLE | Do not cycle the sequence. |
| CYCLE | Cycle the sequence. |
| NO MAXVALUE | Do not limit the maximum value. |
| MAXVALUE | Set the maximum value. |
| NO MINVALUE | Do not limit the minimum value. |
| MINVALUE | Set the minimum value. |
| OWNER TO | Change the owner of the sequence. |
| RENAME TO | Rename the sequence. |
| RESTART WITH | Specify the new starting sequence number. |
| Output | Description |
|---|---|
| ALTER SEQUENCE | The command is successful. |
| ERROR: ALTER on system sequence not allowed. | You attempted to alter a system sequence. |
You must be the admin user, the sequence owner, the owner of the database or schema where the sequence is defined, or your account must have the Alter privilege for thesequence or for the Sequence object class.
MYDB.SCH1(USER)=> ALTER SEQUENCE seq1 MAXVALUE 1000;