1.用户对象DDL触发器
create or replace trigger trigg_test_ddl
after ddl on test.schema
declare
begin
insert into t_trace values (sys.login_user,
sys_context('userenv','ip_address'),
sysdate,
sys_context('userenv','terminal'),
sys.sysevent,
null,
null);
end trigg_test_ddl;
after ddl on test.schema
declare
begin
insert into t_trace values (sys.login_user,
sys_context('userenv','ip_address'),
sysdate,
sys_context('userenv','terminal'),
sys.sysevent,
null,
null);
end trigg_test_ddl;
2.数据库登陆退出事件记录
create or replace trigger trigg_test_db
after logon on database
declare
begin
insert into t_trace values (sys.login_user,
sys_context('userenv','ip_address'),
sysdate,
sys_context('userenv','terminal'),
sys.sysevent,
null,
null);
end trigg_test_db;
after logon on database
declare
begin
insert into t_trace values (sys.login_user,
sys_context('userenv','ip_address'),
sysdate,
sys_context('userenv','terminal'),
sys.sysevent,
null,
null);
end trigg_test_db;
create or replace trigger trigg_test_db_off
before logoff on database
declare
begin
insert into t_trace values (sys.login_user,
sys_context('userenv','ip_address'),
sysdate,
sys_context('userenv','terminal'),
sys.sysevent,
null,
null);
end trigg_test_db_off;
before logoff on database
declare
begin
insert into t_trace values (sys.login_user,
sys_context('userenv','ip_address'),
sysdate,
sys_context('userenv','terminal'),
sys.sysevent,
null,
null);
end trigg_test_db_off;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/7356664/viewspace-746026/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/7356664/viewspace-746026/