在Oracle中如何写一个触发器记录在某时间某个用户修改了某张表的信息

解决方案 »

  1.   

    新增一张异动表,异动表结构为基表结构+一个记录状态的字段NL,其值N表示更新后的数据,L表示更新前的数据。增加基表触发器,当Updating的时候,写一笔L的old资料,再写一笔N的new资料..
      

  2.   

    create or replace trigger tri_xxxx_trail
    after alter or create or drop on $USER_NAME.schema
    begin
      null ;
    end ;上面是一个ddl触发器或者使用audit 更细粒度的可以使用fga
      

  3.   

    create or replace trigger tri_*******
    before update on 源表
    begin
      --1 insert into 日志表 values(****,sysdate,****);
    end ;