简体   繁体   中英

Oracle Database Change Notification and 1800 bytes/100 rows limit

I am trying to use Oracle Database Change Notification (DCN) feature to perform data replication between two of our databases. The feature is amazing and everything was going fine until I hit a roadblock.

After registering Object Change Notification using Java I start receiving DB change events. For any DML operation on the registered table, I get a list of rowid s for every row modified. But when the number of updated rows are more than 100, Oracle does not send all rowid s updated; instead it just sends an alert stating all the rows in the table have been modified (which is wrong). The reason for this is that the maximum size of notifications for DCNs is set at 1800 bytes. Every rowid is about 180 bytes in size. So 100 rowid alerts fill the 1800 byte limit and the next (101st) alert causes Oracle to send a ALL_ROWS modified message.

All documentation pages I found just mention this limit and the scenarios in which it is applied. But there is no mention on how to increase this limit.

Is there any way by which we can increase the 1800 bytes per message limit?

Oracle support has suggested the following method to increase the row limit. Call the following stored proc:

DBMS_CQ_NOTIFICATION.SET_ROWID_THRESHOLD (  
  tbname     IN  VARCHAR2,
  threshold  IN  NUMBER);

Call this procedure after you have registered your listener. This feature is documented here: https://docs.oracle.com/database/121/ARPLS/d_cqnotif.htm#ARPLS65668

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM