手动刷新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.nextval from dual;
NEXTVAL
----------
&nb
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.nextval from dual;
NEXTVAL
----------
&nb

手动刷新Oracle的share pool可能导致sequence缓存不连续或丢失。即使使用dbms_shared_pool.keep来防止序列缓存被清除,也无法避免shutdown时sequence断裂问题。通过示例展示了在不同操作后sequence.nextval的变化。
566

被折叠的 条评论
为什么被折叠?



