'list of users who logged in for last week, month and year

I had written a query where i can get a list of users who logged into the system based upon last 1 day, 7 days, 90 days, 180 days and year and it was written in MYSQL

but I need to write the same query for my oracle database but i am very limited in my oracle knowledge, can anyone please share the code as to how i can write that such query

Database Table name is JOBDesc and column name is lastLogin

Like this question
MYSQL last login and number of logins in last 3 months

my database is too large and big



Solution 1:[1]

If you want to check login history from your database user, prior to oracle 10g (which is 9i and below) you had two options:

Setup an event trigger that logs the information whenever user logs in or logs out into your audit table and query the table directly.

On the recent versions, you can try the query below.

select * from dba_hist_active_sess_history;

You can join this table with dba_hist_sqltext , dba_users to ge the additional information about the user and the sql_text used in that session.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kaushik Nayak