开发者

PLSQL-database event Trigger

开发者 https://www.devze.com 2023-02-15 08:35 出处:网络
Assumea 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 feas

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

精彩评论

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