https://github.com/famousdraw

CDC 关于Identity columns

 

Identity columns

https://www.ibm.com/docs/en/idr/11.3.3?topic=luw-creating-database-backup

Last Updated: 2021-03-04

There are a number of issues to consider when replicating the two kinds of DB2® LUW identity columns that the CDC Replication Engine for DB2 for LUW supports: those which are GENERATED ALWAYS and those which are GENERATED BY DEFAULT.

There are two kinds of DB2 LUW identity columns that CDC Replication Engine for DB2 for LUW now supports: those which are GENERATED ALWAYS and those which are GENERATED BY DEFAULT. When replicating these identity columns you should consider the following.

GENERATED ALWAYS identity columns

You can map GENERATED ALWAYS identity columns in source tables to a target column in Management Console.

GENERATED ALWAYS columns in target tables are read-only and cannot be mapped.

GENERATED BY DEFAULT identity columns

CDC Replication handles GENERATED BY DEFAULT identity columns in source tables similarly to columns without the identity property. The value of a source column is retained when mapped to a target identity column. Target identity columns will use the value provided by the database if you set the initial value of the column to Database Default. For more information on how to set the initial value of a target column to Database Default, see your Management Console documentation.

When replicating data to or from tables containing GENERATED BY DEFAULT identity columns, consider the following:

  • Any column which has the initial value of the mapping set to Database Default is not applied by CDC Replication. CDC Replication skips the column when applying data and the database provides a value.
  • You cannot reference a target identity column that has the initial value set to Database Default in an expression. There is no restriction on the source columns in a similar scenario.
  • User exits cannot access the data for any target column that has an initial value set to Database Default in Management Console.

User exits and identity columns

isDataAvailable(int) in the CDC Replication API can be used in a user exit to determine if there is data for a specific column. This method will return false for a target column with an initial value set to Database Default in Management Console. An exception is thrown if you attempt to retrieve the value from a column that is mapped to a target identity column.

posted on   红色MINI  阅读(21)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示