How To Find Query History On Oracle

The DBA_HIST_ACTIVE_SESS_HISTORY data dictionary view can be used to find queries executed in the Oracle database. Historical information is available.

You can use the V$ACTIVE_SESSION_HISTORY view for currentyl running queries.

For example, a query such as the following can be used to find queries executed in the last 30 days.

You can also specify a specific date range for sample_time in the query above.