Handle Tables with ROWID Columns
Any attempt to insert into a target table that includes a column with a data type of ROWID GENERATED ALWAYS (the default) will fail with the following ODBC error:
ODBC error: SQLSTATE 428C9 native database error -798. {DB2 FOR OS/390}{ODBC DRIVER}{DSN08015} DSNT408I SQLCODE = -798, ERROR: YOU CANNOT INSERT A VALUE INTO A COLUMN THAT IS DEFINED WITH THE OPTION GENERATED ALWAYS. COLUMN NAME ROWIDCOL.
You can do one of the following to prepare tables with ROWID
columns to be processed by Oracle GoldenGate:
-
Ensure that any
ROWIDcolumns in target tables are defined asGENERATED BY DEFAULT. -
If it is not possible to change the table definition, you can work around it with the following procedure.
To workaround ROWID GENERATE ALWAYS:
-
For the source table, create an Extract
TABLEstatement, and use aCOLSEXCEPTclause in that statement that excludes theROWIDcolumn. For example:TABLE tab1, COLSEXCEPT (rowidcol);The
COLSEXCEPTclause excludes theROWIDcolumn from being captured and replicated to the target table. -
For the target table, ensure that Replicat does not attempt to use the
ROWIDcolumn as the key. This can be done in one of the following ways:-
Specify a primary key in the target table definition.
-
If a key cannot be created, create a Replicat
MAPparameter for the table, and use aKEYCOLSclause in that statement that contains any unique columns except for theROWIDcolumn. Replicat will use those columns as a key. For example:MAP tab1, TARGET tab1, KEYCOLS (num, ckey);
-