We created a logon trigger that inserts each log on into a user table. See below then we created an view that matches that data up with dba_users and fnd_user this gives us the info we need to see the login frequencies.
CREATE OR REPLACE TRIGGER logon_audit_trigger
AFTER LOGON ON DATABASE
BEGIN
insert into cb_user_log values(
user,
sys_context('USERENV','SESSIONID'),
sys_context('USERENV','HOST', 30),
sysdate,
to_char(sysdate, 'hh24:mi:ss')
);
COMMIT;
END;
Allan
Thank you for this...much appreciated. Can you elaborate a little more on how to do this? How do you create the table to insert this info? Am I understanding this correctly?
Thanks,
Jo
We did create a table it is called cb_user_log (CB) is our normal prefix to identify our items. It has the fields User, Session id, Host, Logon_day, and Logon_time. We then activated the trigger to capture this info at login time. We then created an IAL that connects this data with also the views (Oracle_account and fnd_user) so that we can get further information. We then have quick reports in IFS that allow us to see the information.
Allan
here is the table definition for what we created
-- Create table
create table CB_USER_LOG
(
user_id VARCHAR2(60),
session_id NUMBER(20),
host VARCHAR2(60),
logon_day DATE,
logon_time VARCHAR2(40)
)
tablespace IFSAPP_DATA
pctfree 10
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
-- Grant/Revoke object privileges
grant select on CB_USER_LOG to IFSINFO with grant option;
grant select on CB_USER_LOG to IFS_READ_ONLY;
Remember that the CB_USER_Log is what We called the file in our system.
Also that grants to IFS Read Only is a security role on our system You would need your own query role to assign it to.
Allan
which app this code run ?
@Mr.Hassan This seems to me for all IFS Application versions.
When using Aurena (IFS21 and up) with a cloud provider, you will need to use the BuildPlace to create the table and the trigger.
Maybe you can explain what you mean with beginner: In IFS, in IFS21 (or up), in PL/SQL, in Oracle?