Trigger recording on every user login

I want to write a trigger that fires every time a user logs in and stores the name of each user for example.

I wrote the trigger like this:

create or replace TRIGGER LOGON_TRG
AFTER LOGON ON DATABASE
BEGIN
INSERT INTO t_log(ID,NAME) VALUES (S1.NextVal,ora_login_user);
END;

      

Does anyone have any solutions for this?

+3


source to share


1 answer


Why implement a trigger when Oracle provides you with AUDIT CONNECT

. It will record the login / logout activity in the audit log.



You can take a look at Tom's suggestion here https://asktom.oracle.com/pls/asktom/f?p=100:11=::::P11_QUESTION_ID:1830073957439

+4


source







All Articles