手动刷新share pool可导致缓存序列(cache sequence)不连续/丢失,
dbms_shared_pool.keep可防止sequence cache不被flush share pool清空,
但是不能防止shutdown引起sequence cache清空而导致的sequence断裂。
C:\>sqlplus scott/tiger@t11a
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 8 18:34:35 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> drop sequence test_seq;
Sequence dropped.
SQL> CREATE SEQUENCE test_seq START WITH 10000 MAXVALUE 2147483647 MINVALUE 1 NOCYCLE CACHE 1000 NOORDER;
Sequence created.
SQL> select test_seq.nextval from dual;
NEXTVAL
----------
10000
SQL> select test_seq.nextv
dbms_shared_pool.keep可防止sequence cache不被flush share pool清空,
但是不能防止shutdown引起sequence cache清空而导致的sequence断裂。
C:\>sqlplus scott/tiger@t11a
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 8 18:34:35 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> drop sequence test_seq;
Sequence dropped.
SQL> CREATE SEQUENCE test_seq START WITH 10000 MAXVALUE 2147483647 MINVALUE 1 NOCYCLE CACHE 1000 NOORDER;
Sequence created.
SQL> select test_seq.nextval from dual;
NEXTVAL
----------
10000
SQL> select test_seq.nextv