Recently, GoldenGate was used to migrate Windows Oracle10g to Linux Oracle11g.
Record a problem:
After the data is synchronized to Oracle11g, the test finds that the primary key conflict occurs when some applications insert data. Some tables that use sequence for primary keys are found to be faulty. The maximum value of sequence is smaller than the maximum value of the primary key. Compared with the sequence of the source database and target database, we found that some sequence values were not synchronized to the target database.
Query the official documents of GoldenGate and find that you can use the flush sequence Method to synchronize sequence:
GGSCI> flush sequence scott. seq *
Oracle GoldenGate
Windows and UNIX Reference Guide
11g Release 1 Patch Set 1 (11.1.1.1)
E21512-02
This section of description is recorded on page 82nd:
Use flush sequence immediately after you start Extract for the first time during an initia
Synchronization or a re-synchronization. This command updates an Oracle sequence so
That initial redo records are available at the time that Extract starts to capture transaction
Data. Normally, redo is not generated until the current cache is exhausted. The flush give
Replicat an initial start point with which to synchronize to the correct sequence value on
The target system. From then on, Extract can use the redo that is associated with the usua
Cache reservation of sequence values.
The following database procedures are used by this command and normally are installed
By running the sequence. SQL script when Oracle GoldenGate is installed.
Before using flush sequence, issue the DBLOGIN command as the database user that has
EXECUTE privilege on the updateSequence procedure.
To use this command, the GGSCHEMA parameter must be used in the GLOBALS file to specify
The schema in which the sequence. SQL procedure is installed. This can be the same schema
That is used for the Oracle GoldenGate DDL support and any other database objects that
Are owned by Oracle GoldenGate.