如果用了sequence,做export的时候就会有跳号?

[复制链接]
查看11 | 回复6 | 2007-10-20 08:38:44 | 显示全部楼层 |阅读模式
最近发现一个表的自增列有跳号现象
查看官方文档 上面说
If transactions continue to access sequence numbers during an export, sequencenumbers can be skipped. The best way to ensure that sequence numbers are not skipped is to ensure that the sequences are not accessed during the export.
Sequence numbers can be skipped only when cached sequence numbers are in use.
When a cache of sequence numbers has been allocated, they are available for use in the current database. The exported value is the next sequence number (after the cached values). Sequence numbers that are cached, but unused, are lost when the sequence is imported
我理解的意思是
如果再export的时候有sequences 被accessed ,就会发上跳号
可是不是很理解这个他是怎么做到的
我应该如果避免呀 7*24的系统
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
当然会跳号啊!exp之前cache的还未来得及使用的所有sequence 号都会跳过。
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
尽管不cache,可能也会有跳号的。
如果业务上不允许,就得自己处理!
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
自己重置
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
那也就是说我想做一个表 表中的某一列值是自增的,而且必须连续。如果用了sequence,就不能做export操作??
或者还有没有其他办法呢??
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
哪就不能cache.
回复

使用道具 举报

千问 | 2007-10-20 08:38:44 | 显示全部楼层
通常sequence被应用在主键上。主键通常是非业务字段。一般来讲跳号是可以接受的。如果你想完全达到不跳号。就需要想些其他的方法。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行