oracle 查看变更的表
发布网友
发布时间:2022-04-09 15:46
我来回答
共1个回答
热心网友
时间:2022-04-09 17:15
create or replace trigger ddl_deny
before create or alter or drop or truncate on database
declare
l_errmsg varchar2(100) := 'You have no permission to this operation';
begin
if ora_sysevent = 'CREATE' then
raise_application_error(-20001,
ora_dict_obj_owner || '.' || ora_dict_obj_name || ' ' ||
l_errmsg);
elsif ora_sysevent = 'ALTER' then
raise_application_error(-20001,
ora_dict_obj_owner || '.' || ora_dict_obj_name || ' ' ||
l_errmsg);
elsif ora_sysevent = 'DROP' then
raise_application_error(-20001,
ora_dict_obj_owner || '.' || ora_dict_obj_name || ' ' ||
l_errmsg);
elsif ora_sysevent = 'TRUNCATE' then
raise_application_error(-20001,
ora_dict_obj_owner || '.' || ora_dict_obj_name || ' ' ||
l_errmsg);
end if;
exception
when no_data_found then
null;
end;
按照这个修改吧,你可以通过trigger把修改的表插入到一个中间表,这样你就知道你的变更表了。