记录数据库的某个用户对于数据库的操作 首先要一个记录操作信息的表
Java代码
create table mylog(
user_name varchar ( )
oper_time date
operate_type varchar ( )
* )
对应的trigger 下面以oracle的dept表为例子
Java代码
SQL>create or replace trigger my_tri
after insert or update or delete on dept
begin
if inserting then
insert into mylog values(user sysdate insert );
elsif updating then
insert into mylog values(user sysdate update );
else
insert into mylog values(user sysdate delete );
end if;