Sample Header Ad - 728x90

How to we get history of sql statements of sysdba?

0 votes
1 answer
852 views
We have been running a list of commands in cli: sqlplus / as sysdba We did not have "history on" and we logged out of the session. How do we get the list of sql statements we ran before as sysdba? We tried the following: SELECT h.sample_time, u.username, h.program, h.module, s.sql_text FROM DBA_HIST_ACTIVE_SESS_HISTORY h, DBA_USERS u, DBA_HIST_SQLTEXT s WHERE sample_time >= SYSDATE - 1 AND h.user_id=u.user_id AND h.sql_id = s.sql_iD ORDER BY h.sample_time Also tried select * from v$sql
Asked by Kristi Nanza_ (3 rep)
Sep 30, 2022, 08:42 PM
Last activity: Apr 12, 2025, 10:09 AM