创建一个指定IP才能执行DDL语句的触发器

create or replace trigger T_sys_config_ddl_refuse_trig
before ddl on schema
declare
v_ipaddress varchar2(20);
begin
select sys_context('userenv','ip_address') 
into v_ipaddress from dual;
if v_ipaddress <> '192.168.1.21' then
raise_application_error(-20099,'Sorry,You 
can not execute the command.Please contact the DBA',false);
end if;
end;
/

你可能感兴趣的:(触发器,replace,BEFORE,create,contact)