问题描述
我们有一堆使用ORA_ROWSCN作为乐观锁定字段的遗留代码。不幸的是,旧版 (COBOL) 代码为主机变量使用10 (?) 位字段,当SCN滴答超过它可以容纳的大小时,我们会遇到可怕的问题。我们使用数据库链接将一些测试数据推入和推出这一事实加剧了这一事实,这导致了定期的大跳跃,从而使问题再次出现的速度更快。
通过导入和导出来重建数据库,可以解决一段时间的问题,但这是一个重大的痛苦。
有什么方法可以重置数据库SCN (就像循环序列一样)?
通过导入和导出来重建数据库,可以解决一段时间的问题,但这是一个重大的痛苦。
有什么方法可以重置数据库SCN (就像循环序列一样)?
专家解答
不。这是Oracle能够生成读取一致的数据视图的基础。正如医生所说:
A system change number (SCN) is a logical, internal time stamp used by Oracle Database. SCNs order events that occur within the database, which is necessary to satisfy the ACID properties of a transaction. Oracle Database uses SCNs to mark the SCN before which all changes are known to be on disk so that recovery avoids applying unnecessary redo. The database also uses SCNs to mark the point at which no redo exists for a set of data so that recovery can stop.
SCNs occur in a monotonically increasing sequence. Oracle Database can use an SCN like a clock because an observed SCN indicates a logical point in time, and repeated observations return equal or greater values. If one event has a lower SCN than another event, then it occurred at an earlier time in the database. Several events may share the same SCN, which means that they occurred at the same time in the database.
http://docs.oracle.com/database/121/CNCPT/transact.htm#CNCPT039
如果可以将其设置为较低的值,则会破坏数据库...
A system change number (SCN) is a logical, internal time stamp used by Oracle Database. SCNs order events that occur within the database, which is necessary to satisfy the ACID properties of a transaction. Oracle Database uses SCNs to mark the SCN before which all changes are known to be on disk so that recovery avoids applying unnecessary redo. The database also uses SCNs to mark the point at which no redo exists for a set of data so that recovery can stop.
SCNs occur in a monotonically increasing sequence. Oracle Database can use an SCN like a clock because an observed SCN indicates a logical point in time, and repeated observations return equal or greater values. If one event has a lower SCN than another event, then it occurred at an earlier time in the database. Several events may share the same SCN, which means that they occurred at the same time in the database.
http://docs.oracle.com/database/121/CNCPT/transact.htm#CNCPT039
如果可以将其设置为较低的值,则会破坏数据库...
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




