简体   繁体   English

是否可以在 Oracle 中为数据库更改通知注册所有表

[英]Is it possible to register all tables for Database Change Notification in Oracle

I was looking for something to catch all Database changes happening in Oracle Database.我正在寻找一些东西来捕捉 Oracle 数据库中发生的所有数据库更改。 So I got this documentation from Oracle.所以我从 Oracle 得到了这个文档。 It is Database Change Notification ( https://docs.oracle.com/cd/E11882_01/java.112/e16548/dbchgnf.htm#JJDBC28815 ) and I got it working for a single table as described the example in the document.它是数据库更改通知( https://docs.oracle.com/cd/E11882_01/java.112/e16548/dbchgnf.htm#JJDBC28815中描述的文档) I would like to listen changes for all the tables in a Database.我想收听数据库中所有表的更改。 Is it possible with this method?这种方法可以吗? Can someone help me.有人能帮我吗。 Any help would be much appreciated任何帮助将非常感激

Possible is possible, you only need to register all tables as you did with the first one.可能是可能的,您只需要像第一个表一样注册所有表。 However it is not very recommendable.但是,它不是很推荐。 Database Change Notification works good with tables that rarely change.数据库更改通知适用于很少更改的表。 The data cache has to be updated or invalidated when the data changes in the database.当数据库中的数据发生变化时,数据缓存必须更新或失效。

Therefore, good practice is to identify the tables you want to enable for DCN.因此,良好的做法是确定要为 DCN 启用的表。 Not all tables are suitable.并非所有桌子都适合。 Understand your data model and apply it to those which rarely change.了解您的数据 model 并将其应用于那些很少更改的数据。

Oracle suggest this functionality might be of use in multi-tier applications, where semi-static data is cached in the middle tier. Oracle 建议此功能可能用于多层应用程序,其中半静态数据缓存在中间层。 In such a setup, modification of the base data could trigger the middle tier to refresh its cached data.在这样的设置中,基础数据的修改可能会触发中间层刷新其缓存数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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