I have written a trigger to capture insert and update on a table and insert it into another table over a database link to different database.
This is working fine but I want to add a solution for a potential problem that is if target table is not available then trigger will fail and eventually cause a failure of insert and updates of source table. In order to avoid this senario I have few suggestion but I would like to know your opinion on that to find best solution.
1. Write a cron job that will execute every 5 minutes and check the status of trigger and if trigger is invalid then disable it and inform dba.
2. There must be a way to make trigger do nothing if target table is unreachable rather than making it invalid. This is what I don't know how to do it.
Can someone help me to decide what is that best way to do it and also help me to acheive point 2 sucessfully.