Trigger to automatically kill blocking session
We have the below script, the when there is identified there is a blocking session with in XXTIC_IST_ORD_BOOK or XXOM_SALESCOMM_UPD it will kill the blocking session. My question would be how to incorporate this into a trigger whenever it happens, it will execute the script to kill the blocking session? If we schedule a job to run this in certain interval, then it could missing the occurrence when the blocking session happened during non-job interval run time. Please advise. Thank you.
BEGIN
FOR blocked_rec IN (
SELECT blocking_session
FROM (
SELECT
ses1.sid || ',' || ses1.serial# AS blocking_session,