Table auditing script in Oracle

Table Auditing :

CREATE TABLE delete_audit (
login_date DATE,
hostnm  VARCHAR2(30),
ipaddr  VARCHAR2(30),
module VARCHAR2(50),
client_info VARCHAR2(50),
os_user VARCHAR2(30),
terminal VARCHAR2(30));


CREATE OR REPLACE TRIGGER delete_audit
AFTER DELETE
ON .
BEGIN
    INSERT INTO delete_audit
    (login_date,  hostnm, ipaddr, module, client_info, os_user, terminal)
    VALUES
    (SYSDATE,
     SYS_CONTEXT('USERENV','HOST'),
     sys_context('USERENV','IP_ADDRESS'),
     sys_context('USERENV','module'),
     sys_context('USERENV','client_info'),
     sys_context('USERENV','os_user'),
     sys_context('USERENV','terminal')
     );
END delete_audit;
/

Comments

Popular posts from this blog

ORA-01565: error in identifying file '?/dbs/spfile@.ora'

Reboot Exadata Machine

How to combine Oracle .ova files