Create Update trigger on stream heatbeat table to test HEAVY insert/update activiry.
CREATE OR REPLACE TRIGGER KARAM.UPDATE_AFTER_EACH_ROW
AFTER UPDATE
OF STM_UDT_TS
ON KARAM.TDM_STRMHB FOR EACH ROW
DECLARE
v_out_file UTL_FILE.FILE_TYPE;
begin
v_out_file := UTL_FILE.FOPEN('STRMADMIN_DIR','heart_beat.log', 'A');
UTL_FILE.PUT_LINE (v_out_file, 'Updated on ' to_char(sysdate,'mm-dd-YYYY HH24:MI:SS'));
UTL_FILE.FCLOSE(v_out_file);
EXCEPTION
WHEN OTHERS THEN NULL;
end update_after_each_row;
/
ALTER TRIGGER KARAM.UPDATE_AFTER_EACH_ROW ENABLE;
Also trigger will get fire only if following executed:
SQLPLUS> beginDBMS_DDL.SET_TRIGGER_FIRING_PROPERTY('TEST_SCHEMA','UPDATE_AFTER_EACH_ROW',FALSE);end;/
No comments:
Post a Comment