1. Create a table in SYS mode that records the details of the client's login to the database server
Create Tablelogon_logs (logon_time date,usernamevarchar2( -), machinevarchar2( -), Ipadrvarchar2( -), programvarchar2( -), modulevarchar2( -), terminalvarchar2( -));
2. Create a trigger in SYS mode:
Create or Replace TriggerLogusersconnectsafter Logon on Database beginInsert intoLogon_logsValues(Sysdate,User, Sys_context ('USERENV','HOST'), Sys_context ('USERENV','IP_Address'), Sys_context ('USERENV','ACTION'), Sys_context ('USERENV','MODULE'), Sys_context ('USERENV','TERMINAL'));Commit;End;/
--View login_history table
select * from Logon_logs;
select Count (*) from v$session;
--View all sessions of the current client computer named Rhel
select count (*) from v$session where machine = ' RHEL ';
--View the current number of connections for each client computer
select Count (*), machine from V$session Group by machine;
Oracle Landing Trigger