OGG How to handle / replicate tables with no (without) primary key (PK) or unique index (UI) (UPI) [
Applies to:
Oracle GoldenGate - Version: 5.0.0 and later [Release: 5.0.0 and later ]Information in this document applies to any platform.
Goal
To handle / replicate tables with no (without) primary key (PK) or unique index (UI) or UPISolution
By default, all the columns (except LOB, XML, UDT et al) will be used as the key. Supplemental logging of the table is required.For batch updates and deletes, one update/delete statement in source will becomes multiple ones in target. if each has to do a full-table scan, it will slow down the replication. an index (even not unique) may be added to target to speed up the replication.
However, if a subset of columns is known to be unique, even without unique index, it may be used as key with KEYCOLS parameter.
here is an example of the setup:
let's use a simple example to explain the case:
source: create table s1 (a number, b number, c number);
target: create table t1 (a number, b number, c number);
there is no pk/ui.
ggsci> dblogin user id
ggsci> add trandata
extract: table
replicat: map
insert into s1 values (1,2,3);
commit;
the row will be replicated to t1.
update s1 set c=4;
commit;
the column 'c' in T1 will be updated.
delete s1;
commit;
the row in T1 will be deleted.
if (only if) you know column A is unique even there is no pk/ui.
extract: table
This is covered in version 11 installation guide for oracle db, page 42.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/161195/viewspace-1055386/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- unique index與primary key的區別Index
- mysql中key 、primary key 、unique key 與index區別MySqlIndex
- pk 、unique index 和 index 區別Index
- ORA-02429: cannot drop index used for enforcement of unique/primary keyIndex
- oracle資料庫primary key和unique key的異同Oracle資料庫
- 主鍵(PK)與非空唯一索引(Unique Index)的區別索引Index
- ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys foundIndex
- Index Unique Scan (213)Index
- sql primary key procedureSQL
- What is meant by Primary Index and Secondary IndexIndex
- Sparse Indexes vs unique indexIndex
- INDEX UNIQUE SCAN,INDEX FULL SCAN和INDEX FAST FULL SCANIndexAST
- oracle10g_exceptions異常表_記錄違犯pk_unique key約束資訊OracleException
- SORT (UNIQUE STOPKEY)/ SORT GROUP BY STOPKEYTopK
- The differences between index-organized tables and ordinary tables (228)IndexZed
- How to rebuild and replicate the SYSVOL tree and its content in a Windows domainRebuildWindowsAI
- How Logs Work On MySQL With InnoDB TablesMySql
- Unique Index和Normal Index差異經典對比IndexORM
- 再說Unique Index和Normal Index行為差異IndexORM
- SQL Server Primary Key ConstraintsSQLServerAI
- Overview of Index-Organized Tables (227)ViewIndexZed
- Benefits of Index-Organized Tables (229)IndexZed
- Partitioned Index-Organized Tables (234)IndexZed
- How to Find Out How Much Space an Index is UsingIndex
- Bitmap Indexes on Index-Organized Tables (232)IndexZed
- 【SQL】15 SQL 約束(Constraints)、NOT NULL 約束、UNIQUE 約束、PRIMARY KEY 約束、FOREIGN KEY 約束、CHECK 約束、DEFAULT約束SQLAINull
- HDU 1213 How Many Tables(並查集)並查集
- Unique約束,Primary Key約束與索引的關係學習與測試_20091213.doc索引
- Data Warehouse Guide閱讀筆記(六):unique constraint & unique indexGUIIDE筆記AIIndex
- CCAH-CCA-500-5題:How will the Fair Scheduler handle these two jobs?AI
- How to Determine When an Index Should be Rebuilt?IndexUI
- [20171211]UNIQUE LOCAL(Partitioned)IndexIndex
- 高效的SQL(Index unique scan最優化)SQLIndex優化
- 簡單分析MySQL中的primary key功能MySql
- 簇表及簇表管理(Index clustered tables)Index
- 查詢指定使用者的unique,primary索引名/鍵值索引
- 關於primary key和foreign key的問題處理
- How To Replicate Data from Oracle to Postgres Using GoldenGate (Doc ID 1544137.1OracleGo