I want to create a logon trigger. Trigger will do the following:
It will block access to the database based on certain users and certain machine information. Then it will give an information message to the user and insert this session information into a table.
Users: mike, john, eric, daisy, albert
Message to the user: You are not allowed to logon from machine '||MACHINE|| ' using '|| USERNAME
The information it will insert into the table: username, osuser, machine, port, terminal, program, module, instance_id, sid, serial#
Table name: DBADMINISTRATOR.LOGON_TBL
I have a trigger idea as follows;
CREATE OR REPLACE TRIGGER DBADMINISTRATOR.LOGON_FILTER AFTER LOGON ON DATABASE DECLARE USERNAME varchar2 (200); MACHINE varchar2 (200); begin ... ... if ... then raise_application_error(-20001,'You are not allowed to logon from machine '||MACHINE|| ' using '|| USERNAME); end if; end; /
Can you please help scripting and will it cause any performance problems?