Hi.
Can help me with this doubt, he missed working with development to have better ideas.
Next I'm trying to create a trigger to lock the operating system user access with a username database. This is quiet, however, I wish these operating system users were registered on a table and during execution of the trigger were performed to validate these logins:
CREATE OR REPLACE TRIGGER SYS.BLOCK_USER
AFTER LOGON ON DATABASE
DECLARE
v_prog sys.v_$session.program%TYPE;
v_username sys.v_$session.username%TYPE;
v_osuser sys.v_$session.osuser%TYPE;
v_sid sys.v_$session.sid%TYPE;
v_serial sys.v_$session.sid%TYPE;
--v_inst_id sys.v_$session.sid%TYPE;
BEGIN
SELECT program, username, osuser, sid, serial#
INTO v_prog, v_username, v_osuser, v_sid, v_serial
FROM sys.v_$session
WHERE sid = USERENV('SID')
AND audsid != 0 -- Não verifica conexões do SYS
AND rownum = 1; -- Parallel processes will have the same AUDSID's
IF UPPER(v_osuser) not in ('BR3AMR','BR3CAM8')
THEN
IF (UPPER(v_username) = 'ADMRMS')
THEN
RAISE_APPLICATION_ERROR(-20000, 'Block Access! ('||v_osuser||' - '||v_username||' - '||v_prog||')');
END IF;
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN NULL;
END;
/
Hi.
Can help me with this doubt, he missed working with development to have better ideas.
Next I'm trying to create a trigger to lock the operating system user access with a username database. This is quiet, however, I wish these operating system users were registered on a table and during execution of the trigger were performed to validate these logins:
As above code, the line "IF UPPER (v_osuser) not in", the user should not be fixed but the trigger on a table, in case new users entering the company, there is no need for maintaining the trigger.
Is there a solution for this?
hugs!!