Oracle Goldengate 12.2 now provides support for replication of tables with INVISIBLE columns which was not possible in earlier releases.
Let us look at an example.
We create a table on both the source as well as target databases with both an INVISIBLE and VIRTUAL column COMMISSION.
SQL> create table system.test_ogg 2 (empid number, salary number, commission number INVISIBLE generated always as (salary * .05) VIRTUAL ); Table created. SQL> alter table system.test_ogg 2 add constraint pk_test_ogg primary key (empid); Table altered.
Note that the column is not visible until we use the SET COLINVISIBLE ON command in SQL*PLUS.
SQL> desc system.test_ogg Name Null? Type ----------------------------------------- -------- ---------------------------- EMPID NUMBER SALARY SQL> SET COLINVISIBLE ON SQL> desc system.test_ogg Name Null? Type ----------------------------------------- -------- ---------------------------- EMPID NUMBER SALARY NUMBER COMMISSION (INVISIBLE) NUMBER
We now insert a row into the TEST_OGG table.
The value for the INVISIBLE and VIRTUAL column is derived based on the value of the SALARY column.
Note that the SELECT * command will not display the invisible column COMMISSION.
SQL> insert into system.test_ogg 2 values 3 (1001, 10000); 1 row created. SQL> commit; Commit complete. SQL> select empid,salary,commission from system.test_ogg; EMPID SALARY COMMISSION ---------- ---------- ---------- 1001 10000 500 SQL> select * from system.test_ogg; EMPID SALARY ---------- ---------- 1001 10000
On the target GoldenGate environment we can see that the table structure information was contained and derived from the trail files as now in 12.2 table metadata is contained in the self-describing trail files and the parameters SOURCEDEFS or ASSUMETARGETDEFS are now no longer required in case the source and target database tables differ in structure.
2015-12-25 07:53:07 INFO OGG-02756 The definition for table SYSTEM.TEST_OGG is obtained from the trail file. Skipping invisible column COMMISSION in default map. 2015-12-25 07:53:07 INFO OGG-06511 Using following columns in default map by name: EMPID, SALARY. 2015-12-25 07:53:07 INFO OGG-06510 Using the following key columns for target table SYSTEM.TEST_OGG: EMPID.
On the target database we can see that the row has been replicated and the invisible column COMMISSION has been populated as well.
SQL> select empid,salary,commission from system.test_ogg; EMPID SALARY COMMISSION ---------- ---------- ---------- 1001 10000 500