SEQUENCE 问题

SEQUENCE解决的是并发问题,应该对DML速度有没有帮助 [@more@]

SEQUENCE解决的是并发问题,应该对DML速度有没有帮助

1. 尽量用sequence,不要利用程序解决,数据库自身的东西效率要高的很。

2. 设置SEQUENCE_CACHE_ENTRIES
When an application accesses a sequence in the sequence cache, the sequence numbers are read quickly. However, if an application accesses a sequence that is not in the cache, then the sequence must be read from disk to the cache before the sequence numbers are used.
If your applications use many sequences concurrently, then your sequence cache might not be large enough to hold all the sequences. In this case, access to sequence numbers might often require disk reads. For fast access to all sequences, be sure your cache has enough entries to hold all the sequences used concurrently by your applications.
The number of entries in the sequence cache is determined by the initialization parameter SEQUENCE_CACHE_ENTRIES. The default value for this parameter is 10 entries. Oracle creates and uses sequences internally for auditing, grants of system privileges, grants of object privileges, profiles, debugging stored procedures, and labels. Be sure your sequence cache has enough entries to hold these sequences as well as sequences used by your applications.
If the value for your SEQUENCE_CACHE_ENTRIES parameter is too low, then it is possible to skip sequence values. For example, assume that this parameter is set to 4, and that you currently have four cached sequences. If you create a fifth sequence, then it will replace the least recently used sequence in the cache. All of the remaining values in this displaced sequence are lost. In other words, if the displaced sequence originally held 10 cached sequence values, and only one had been used, then nine would be lost when the sequence was displaced.

3. sequence的间断问题
TRX的rollback, instance的crash都会导致已cache的sequence丢失。

4.对OPS而言,特别是OLTP系统,为防止出现”DFS LOCK HANDLE” 事件,(中国网通VOIP数据库出现过)最好设置大的cache值。

注意:cache和order选项同时使用时,cache无效。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28429/viewspace-843128/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/28429/viewspace-843128/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值