简体   繁体   中英

How to get information in one database when row is inserted in another database?

I have two databases. How can I write some trigger to get notification in database1 when row is insered in some table in database2. I have link from database1 to database2, but I don't have link from two to one.

A standard way to replicate data between databases like this is to create a materialized view in database1 for your table(s) in database2. Eg

CREATE MATERIALIZED VIEW db1_table
REFRESH FORCE AS
SELECT * FROM db2_table@db2;

See for example this article for details .

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