Thursday, January 19, 2017

ORA-26787: The row with key ... does not exist in table

Cause: The row to update or delete does not exist in the table of standby database.

Solution: Use DBMS_LOGSTDBY.INSTANTIATE_TABLE  procedure to bring a table back into sync with the version on the primary database.

1. Create public DB link in standby database with primary database.
2. Stop SQL Apply on the logical standby.
3. From DBA user Execute the DBMS_LOGSTDBY.INSTANTIATE_TABLE procedure to bring a table back into sync with the version on the primary database.
4. Start SQL Apply on the logical standby.

LOGSTDBY Apply process AS01 server id=1 pid=50 OS id=17029 stopped
Errors in file /u01/app/oracle/diag/rdbms/erpdrdb/erpdrdb/trace/erpdrdb_as01_17029.trc:
ORA-26787: The row with key ("BRANCHCODE", "HOUR", "MINUTES") = (423423, 4, 34) does not exist in table ERP_USER.TRAN_END_TIME
Errors in file /u01/app/oracle/diag/rdbms/erpdrdb/erpdrdb/trace/erpdrdb_lsp0_16993.trc:
ORA-26808: Apply process AS01 died unexpectedly.
ORA-26787: The row with key ("BRANCHCODE", "HOUR", "MINUTES") = (423423, 4, 34) does not exist in table ERP_USER.TRAN_END_TIME
LOGSTDBY Analyzer process AS00 server id=0 pid=49 OS id=17025 stopped
LOGSTDBY Apply process AS05 server id=5 pid=54 OS id=17037 stopped
LOGSTDBY Apply process AS04 server id=4 pid=53 OS id=17035 stopped
LOGSTDBY Apply process AS02 server id=2 pid=51 OS id=17031 stopped
LOGSTDBY Apply process AS03 server id=3 pid=52 OS id=17033 stopped
LOGMINER: session#=1 (Logical_Standby$), builder MS01 pid=46 OS id=17021 sid=139 stopped
LOGMINER: session#=1 (Logical_Standby$), preparer MS02 pid=47 OS id=17023 sid=203 stopped
LOGMINER: session#=1 (Logical_Standby$), reader MS00 pid=45 OS id=17019 sid=63 stopped

Solution: Perform the following in Standby Database.


SQL> alter database stop logical standby apply;

Database altered.

SQL> exec dbms_logstdby.instantiate_table('ERP_USER','TRAN_END_TIME','PRIMDB');

PL/SQL procedure successfully completed.

SQL> ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;

Database altered.


SQL>

No comments:

Post a Comment