开发者

PLSQL-database event Trigger

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜