Domanda

I am using ora_rowscn to do delta loading from an oracle database into a MS SQL Server data warehouse. This works excellent.

However, I cannot find what happens when ora_rowscn wraps and what the datatype of ora_rowscn really is.

Can anybody shed some light on it?

When importing ora_rowscn with SSIS using a float column is sugested, as it is an integer value I went with bigint so far.

Documentation:

So what is the biggest ora_rowscn can get?

È stato utile?

Soluzione

From Ask Tom, in response to the question:

When a COMMIT happens, SCN is incremented by one. Is this a sequence? Does it ever reach an end when it has to recycle?

Tom said:

It is not a sequence, it is just an internal number, it is not maintained in seq$ like sequences are (it couldn't, it is used to manage the datafiles, it cannot be in a table in the datafile)

It does not recycle, it can go quite high, you could generate thousands per second and still have to wait hundreds of thousands of years before we exhausted it.

The ora_rowscn pseudocolumn shows the SCN when the row (or its block) was affected by a transaction, so it won't wrap/recycle.

There was a lot of discussion about SCNs about two years ago because of bugs. It was mentioned then that there's a soft limit of 16384 * the number of seconds since 1988-01-01. I don't have a link to anything official that says that, but it should give you a pretty good idea how high it could go in the near or medium future. Even if that was true then, it might have changed in 12c, or change again the future as processing power allows that soft limit to be reached (even without bugs).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top