記錄數據庫的某個用戶對於數據庫的操作首先要一個記錄操作信息的表
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(usersysdateinsert);
elsif updating then
insert into mylog values(usersysdateupdate);
else
insert into mylog values(usersysdatedelete);
end if;
end;
From:http://tw.wingwit.com/Article/program/Oracle/201311/18460.html