May 18 2016

oracle禁止某台机器连上来

CREATE OR REPLACE TRIGGER sys.trg_work_log
AFTER LOGON ON DATABASE
declare
v_program_name varchar2(200);
v_username varchar2(100);
v_host varchar2(200);
v_error varchar2(1000);
begin
select username,program,SYS_CONTEXT(‘USERENV’,’HOST’)
into v_username,v_program_name,v_host
from sys.v_$session where AUDSID = SYS_CONTEXT(‘USERENV’, ‘SESSIONID’);
if (v_host = (‘drjr-ThinkPad-T520′)) then
RAISE_APPLICATION_ERROR(-20001,’You are not allowed to connect to the database,err01’);
end if;
END ;
/



Copyright 2019. All rights reserved.

Posted 2016年5月18日 by ucjmh in category "oracle

Leave a Reply

Your email address will not be published. Required fields are marked *