You can use database auditing, LogMiner log mining, triggers, and other methods to monitor user behavior in the database. However, the first two methods are troublesome. Using triggers can easily meet some special monitoring requirements. The following is an example of who changed the records using the trigger monitoring table: --- display the grantselectonsys. v _
You can use database auditing, LogMiner log mining, triggers, and other methods to monitor user behavior in the database. However, the first two methods are troublesome. Using triggers can easily meet some special monitoring requirements. The following is an example of who changed the records using the trigger monitoring table: --- show the two views grant the permission to all users to query grant select on sys. v _
You can use database auditing, LogMiner log mining, triggers, and other methods to monitor user behavior in the database. However, the first two methods are troublesome. Using triggers can easily meet some special monitoring requirements.
The following is an example of who changed the log using the trigger monitoring table:
--- Grant select on sys. v _ $ session to public; grant select on sys. v _ $ sqlarea to public; --- create table log_monitor_tab (SQL _text varchar2 (400), username varchar2 (30), schemaname varchar2 (30), osuser varchar2 (30 ), ip_address varchar2 (15), machine varchar2 (50), program varchar2 (50), modifytime date ); ---- create or replace trigger tri_monitor_tab before insert or update or delete on table_name -- enter the corresponding table name for each rowbegin insert into log_monitor_tab select sq. SQL _text, se. username, se. schemaname, se. osuser, SYS_CONTEXT ('userenv', 'IP _ address'), se. machine, se. program, sysdate from v $ sqlarea sq, v $ session se where sq. address = se. SQL _address and se. sid = userenv ('sid '); end; --- query the log table log_monitor_tab record select * from log_monitor_tab order by modifytime asc;