Thursday, March 13, 2025

2025-03-12 00:11:11 ERROR OGG-01169 Encountered an update where all key columns for target table SCHEMA.TABLE_NAME are not present

 To find primary key of a table:
SQL>
select cols.column_name
from dba_constraints cons
join dba_cons_columns cols
on cons.sonstraint_name = cols.constraint_name
where cons.constraint_type in ('U','P')
and cons.owner = '&SCHEMA'
and cons.table_name = '&TABLE_NAME';

to get ddl for indexes for a table on source :
SQL>
set long 5000;
set pages 0;
select dbms_metadata.get_ddl('INDEX',u.index_name,'SCHEMA') from dba_indexes u where
table_name='&table_name' ;


STEPS TO PERFORME ON TARGET DB AND SOURCE DB:
1) target gg db:
GGSCI > sh cat dirrpt/REPLICAT_NAME.rpt
2025-03-12 00:11:11 ERROR OGG-01169 Encountered an update where all key columns for
target table SCHEMA.TABLE_NAME are not present

2) GGSCI > edit param REPLICAT_NAME
...
2.1 on target db checked for primary key and unique key columns
    then take the ddl for the indexes on the table SCHEMA.TABLE_NAME on source db
2.2 create source indexes on  target
2.3 then add below lines in REPLICAT_NAME.prm
    map SCHEMA.TABLE_NAME, target SCHEMA.TABLE_NAME, keycols (column_pk,column_uk) ;
2.4 start target abended REPLICAT REPLICAT_NAME
    GGSCI > start REPLICAT_NAME

No comments:

Post a Comment

Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...