Sample Header Ad - 728x90

Oracle 12c - Logon Trigger According To Machine Information

0 votes
1 answer
834 views
**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. E.g; **Users:** mike, john, eric, daisy, albert **Machine:** NEWMACH\% **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? Best Regards,
Asked by jrdba123 (29 rep)
Nov 6, 2021, 11:01 PM
Last activity: Nov 7, 2021, 11:03 AM