Oracle

帶有主鍵的表上的 Goldengate 警告

  • January 25, 2019

為 Oracle 11gR2 安裝了 Goldengate 版本 18.1.0.0.0。表有主鍵,但 Goldengate 抱怨沒有找到鍵,見下文

   GGSCI (server01.localdomain as gguser@UPGR) 3> add trandata scott.books

   2019-01-23 22:44:42  WARNING OGG-06439  No unique key is defined for table BOOKS. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.

   2019-01-23 22:44:42  INFO    OGG-15130  No key found for table SCOTT.BOOKS.  All viable columns will be logged.

   2019-01-23 22:44:42  INFO    OGG-15135  TRANDATA for instantiation CSN has been added on table SCOTT.BOOKS` 

   GGSCI (server01.localdomain as gguser@UPGR) 10> info trandata scott.books

   Logging of supplemental redo log data is enabled for table SCOTT.BOOKS.
Columns supplementally logged for table SCOTT.BOOKS: "AUTHOR", "ID", "LANGUAGE_ID", "TITLE", "YEAR_PUBLISHED".

Prepared CSN for table SCOTT.BOOKS: 978016

這是來自 Oracle SQL Developer 的 scott.books 的 DDL

CREATE TABLE "SCOTT"."BOOKS" 
  ("ID" NUMBER(*,0), 
   "TITLE" VARCHAR2(26 BYTE), 
   "AUTHOR" VARCHAR2(23 BYTE), 
   "YEAR_PUBLISHED" NUMBER(*,0), 
   "LANGUAGE_ID" NUMBER(*,0), 
    CONSTRAINT "PK_ID" PRIMARY KEY ("ID")
 )

有人可以指出我正確的方向。謝謝

來自 dba_constraints

SQL> SELECT
 2      constraint_name,
 3      constraint_type,
 4      status,
 5      validated
 6  FROM
 7      dba_constraints
 8  WHERE
 9      owner = 'SCOTT'
10      AND table_name = 'BOOKS';
CONSTRAINT_NAME                C STATUS   VALIDATED
------------------------------ - -------- -------------
PK_ID                          P ENABLED  VALIDATED

不確定這是否是一個錯誤,但兩次註銷 ggsci 會話就可以了。

當 PK 存在但未啟用或未驗證時會發生這種情況。確保 PK 已啟用並經過驗證,然後再次嘗試添加 transdata。

引用自:https://dba.stackexchange.com/questions/227904