我们知道在ORACLE数据库中有一个SCN的概念,即System Change Number,简称SCN,简单的说它就是一个Oracle数据库里的时钟。每次数据库状态变化后都会生成一个SCN,比如commit了,就产生一个Commit SCN,当然,这只是Oracle中的其中一种SCN,它还有什么Checkpoint SCN了、Resetlog SCN了、Offline SCN了等等。不管是何种SCN,它记录的是数据库状态的变化,关于SCN的详细讨论,可以参考:http://www.itpub.net/thread-151534-1-1.html,这里就不做详细介绍了。
在Oracle GoldenDate中,为了记录一个个事物,引入了CSN:Commit Sequence Number,注意了是Commit Sequence Number而不是System Change Number,这个是不一样的!!!尽管GG直接引用了Oracle中的SCN来作为GG中的CSN,但是它们还是不一样的!
When working with Oracle GoldenGate, you might need to refer to a Commit Sequence
Number, or CSN. The CSN can be required to position Extract in the transaction log, to
reposition Replicat in the trail, or for other purposes. It is returned by some conversion
functions and is included in reports and certain GGSCI output.
A CSN is an identifier that Oracle GoldenGate constructs to identify a transaction for the purpose of maintaining transactional consistency and data integrity. It uniquely identifies a particular point in time in which a transaction commits to the database.
Each kind of database management system generates some kind of unique serial number
of its own at the completion of each transaction, which uniquely identifies that transaction.
A CSN captures this same identifying information and represents it internally as a series
of bytes, but the CSN is processed in a platform-independent manner. A comparison of any
two CSN numbers, each of which is bound to a transaction-commit record in the same log
stream, reliably indicates the order in which the two transactions completed.
The CSN value is stored as a token in any trail record that identifies the beginning of a
transaction. This value can be retrieved with the @GETENV column conversion function and
viewed with the Logdump utility.
Extract writes a normalized form of the CSN to external storage such as the trail files and
the checkpoint file. There, the CSN is represented as a hex string of bytes. In normalized
form, the first two bytes represent the database platform, and the remainder of the string
represents the actual unique identifier.
这段文字翻译起来挺别扭的,直接般过来算了:)
阅读(2718) | 评论(0) | 转发(0) |