今天在ITPUB看到一个关于序列在数据库重启之后是否会丢失cache部分的帖子,感觉很有意思,一时手痒也做了个实验。实验环境是CentOS 6.3操作系统,11.2.0.4.0版本的数据库,实验过程如下:
普通用户登录数据库,创建一个序列。
[oracle@db98 dbs]$ sqlplus dbdream/dbdream
SQL*Plus: Release 11.2.0.4.0 Production on Fri Apr 17 17:58:28 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create sequence seq_1 minvalue 1 maxvalue 10000 start with 1 increment by 1 cache 100;
Sequence created.
SQL> select SEQUENCE_NAME,MIN_VALUE,INCREMENT_BY,CACHE_SIZE,LAST_NUMBER from user_sequences;
SEQUENCE_NAME MIN_VALUE INCREMENT_BY CACHE_SIZE LAST_NUMBER
------------------------------ ---------- ------------ ---------- -----------
SEQ_1