记录特定用户操作触发器
CREATE OR REPLACE TRIGGER sys.record_sqlAFTER LOGON ON DATABASE
DECLARE
BEGIN
IF (UPPER(sys_context('USERENV', 'MODULE')) LIKE 'SQLPLUS%' AND UPPER(sys_context('USERENV', 'HOST')) IN('WORKGROUP\XIFENFEI-PC') AND UPPER(sys_context('USERENV', 'SESSION_USER')) IN('CHF1'))
THEN
EXECUTE IMMEDIATE 'alter session set tracefile_identifier=''get_sql''';
EXECUTE IMMEDIATE 'alter session set max_dump_file_size=UNLIMITED';
EXECUTE IMMEDIATE 'alter session set events ''10046 trace name context forever, level 1''';
END IF;
EXCEPTION
WHEN OTHERS THEN
null;
END;
/
页:
[1]