新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
用觸發(fā)器實(shí)現(xiàn)Oracle操作日志
初學(xué)Oracle時,你可能會對Oracle操作日志感到無從下手,下面就用觸發(fā)器來實(shí)現(xiàn)Oracle操作日志的功能進(jìn)行進(jìn)深入描述,希望對大家有所幫助。具體代碼如下:

- create table t1(dml varchar2(100),opttime date);
- create table t2(x number(1));
- create or replace trigger tri_t2
- before insert or update or delete on t2 for each row
- begin
- if inserting then
- insert into t1(DML,OPTTIME) select '添加了記錄' DML, sysdate OPTTIME from dual;
- elsif updating then
- insert into t1(DML,OPTTIME) select '更新了記錄' DML, sysdate OPTTIME from dual;
- elsif deleting then
- insert into t1(DML,OPTTIME) select '刪除了記錄' DML, sysdate OPTTIME from dual;
- end if;
- end;
至此,就可以用觸發(fā)器完成Oracle操作日志。要想了解的更多相關(guān)問題的解決方案,請留意站上的相關(guān)論壇。
【編輯推薦】
- Oracle十步搞定Oracle數(shù)據(jù)庫重新啟動
- Oracle 10g歸檔日志
- Windows2000服務(wù)器下安裝Oracle9i與 10g
- Oracle淺析linux下Oracle 10g啟動與關(guān) 閉
- 深入探討Oracle網(wǎng)絡(luò)服務(wù)解析
本文標(biāo)題:用觸發(fā)器實(shí)現(xiàn)Oracle操作日志
網(wǎng)站路徑:http://m.5511xx.com/article/ccdhcos.html


咨詢
建站咨詢
