Trigger to stop login from Particular program



Last updated on July 17th, 2015 at 06:05 pm

CREATE OR REPLACE TRIGGER program_restrict
AFTER LOGON ON DATABASE
BEGIN
FOR x IN (SELECT username, program
FROM SYS.v_$session
WHERE audsid = USERENV (‘sessionid’))
LOOP
IF LTRIM (RTRIM (x.username)) = ‘XXXX’
AND LTRIM (RTRIM (x.program)) IN (‘sqlplusw.exe’,
‘TOAD.exe’)
THEN
raise_application_error
(-20999,‘Not authorized to use in the Production
environment!’);
END IF;
END LOOP;
END programe_restrication;
/

Leave a Reply