SELECT * FROM USER_SEQUENCES WHERE SEQUENCE_NAME='S_MYSEQUENCE';
当为不同用户创建的sequence时,在user_sequences中查找不到,可以通过以下语句查询:
select * from all_sequences WHERE sequence_owner='创建者';
查询结果的最后会有最后一个序列值。
附:
删除语句:DROP SEQUENCE MYUSER.S_MYSEQUENCE;
创建语句:
create sequence MYUSER.S_MYSEQUENCE
minvalue 1
maxvalue 999999999999999999999999999
start with 1--起始值
increment by 1--增量
cache 20;