Assume a schema named 'SD' with 100 tables, 25 procedures, etc. The creation of a trigger that will inform me of the modifications (if)made in procedures, the logging on/off of other users etc is feasible ? if yes, how can i trace the changes in the code of an existing procedure, the creation/drop of table ?
the trigger 'logon' below inserts in a log file (= table log_events) the users that log on:
CREATE OR REPLACE TRIGGER logon
AFTER LOGON ON SCHEMA
BEGIN
INSERT INTO log_events (used_id,log_date,action)
VALUES (USER,SYSDATE, 'Log on');
END;
--log_events:
CREATE TABLE log_events ( user_id VARCHAR2(50), log_date D开发者_运维百科ATE, action VARCHAR2(50))
Don't DDL event triggers work for you? E.g. a trigger AFTER CREATE OR MODIFY OR DROP
should fire once a table or a procedure is changed.
精彩评论