Oracle · error reference

ORA-08181: not a valid system change number

ORA-08181: specified number is not a valid system change number

An SCN passed to a flashback query is out of range — usually a stale checkpoint, or an SCN carried between databases where it means nothing.

What the database is telling you

The SCN is either beyond the database's current SCN, or so far behind that it can no longer be resolved. SCNs are per-database counters — not timestamps, and not portable between databases.

Why it shows up in a migration

It almost always means a checkpoint outlived what it pointed at. A capture process stores 'resume from SCN n', the process is down for a while, and by restart n is no longer resolvable. Restoring from backup or failing over to a standby can also move the current SCN in ways a stored checkpoint does not expect.

Common causes

  • A stored CDC checkpoint older than the database can now resolve.
  • An SCN captured on one database and used against another.
  • A restore or flashback of the database itself, moving the SCN backwards.
  • An SCN computed by hand rather than converted from a timestamp.

How to fix it

  1. 1

    Read the current SCN and compare it with the one you are passing.

    SELECT CURRENT_SCN FROM v$database;
  2. 2

    Derive an SCN from a timestamp instead of storing raw numbers across restarts.

    SELECT TIMESTAMP_TO_SCN(SYSTIMESTAMP - INTERVAL '10' MINUTE) FROM dual;
  3. 3

    If the checkpoint is unrecoverable, re-snapshot the affected tables and resume from a fresh SCN — a gap in a stream is worse than a re-copy.

What DBShifts does about it

Invalid-SCN failures are logged per table and the poller keeps running rather than treating one bad checkpoint as fatal to the whole stream. Checkpoints are stored per stream, so a re-snapshot affects only the table that lost its position.

Oracle change capture

Migrating between engines?

DBShifts converts the schema, moves the data, and then proves the two sides match with a type-aware checksum per table — not just a row count. Errors like this one are handled on the way, and the ones that cannot be handled are reported rather than logged and forgotten.

Related errors

← All database errors