2008-03-01 来自:java060515
问题:如何才能限制用户对自己对象的DDL权限(触发器实现)?
解决此问题的示例:
create or replace trigger 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.152' then
raise_application_error(-20099,'Sorry,You
can not execute the command.Please contact the DBA',false);
end if;
end;
/
问题:如何才能限制用户对自己对象的DDL权限(触发器实现)?
解决此问题的示例:
create or replace trigger 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.152' then
raise_application_error(-20099,'Sorry,You
can not execute the command.Please contact the DBA',false);
end if;
end;
/