Oracle:序列是如何实现的?
为了满足一些奇怪的业务需求,我将不得不实现我自己的类似序列的计数器。 我将以显而易见的方式对此进行初步讨论,但我想更多地了解 Oracle 如何实现序列。 例如,他们可以使用闩锁而不是锁吗?
我在网上找不到太多相关信息,因此欢迎指向文档以及您个人经验的见解!
(10g RAC,如果重要的话)
To meet some odd business requirements, I'm going to have to implement my own sequence-like counters. I'm going to make a first cut of this in the obvious way, but I would like to understand a bit more about how Oracle implements sequences. For example, can they use latches instead of locks?
I've been unable to find much about this on the web, so pointers to docs as well as insight from your personal experience welcome!
(10g RAC, if it matters)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不认为 Oracle 已经发布了序列的内部工作原理,但是 Jonathan Lewis 写了一些关于它们如何工作的详细分析 这里。 从该文件:
I don't think Oracle has published the internal workings of sequences, but Jonathan Lewis has written some detailed analysis of how they work here. From that document:
以下是一组很好的问题答案: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6575961912937
Here's a good set of issues answered: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6575961912937
您想要/需要无间隙数字序列吗? 阅读以下内容: http:// Asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4343369880986
Do you want/need a gapless sequence of numbers? Read this: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4343369880986
我认为您需要解释为什么您需要实现自己的序列。 如果我们知道您要解决的问题,我们也许可以给您答案,这样您就不必执行自己的自定义序列。
I think you need to explain why you would need to implement your own sequence. If we know the problem you are trying to solve we may be able to give you an answer so you would not have to do your own custom sequence.