Auditing Features  «Prev  Next»

Viewing Unified Audit Records: Exercise

Objective: Write a report showing who performed an audited action, when it occurred, and which action was recorded.

Self-assessment: 5 points

Submit one SQL query and compare it with the model answer. The site does not execute your query or grade free-text SQL.

Scenario

The policies from the preceding exercise have generated records in an Oracle AI Database 26ai practice PDB. Connect to that PDB as an authorized reviewer, normally with AUDIT_VIEWER. Assume the reporting client supplies :start_utc and :end_utc as TIMESTAMP bind values representing UTC, with the start earlier than the end.

Tasks

  1. Query UNIFIED_AUDIT_TRAIL for all recorded users within the requested interval.
  2. Return the database username, UTC event timestamp, and action name.
  3. Include the start instant and exclude the end instant.
  4. Sort from oldest to newest.

Do not filter to the connected reviewer or a single policy. This report covers records available in the current container and interval, not an assertion that every database action was audited. You do not need to expose SQL text or bind contents.

Hints

Use DBUSERNAME, EVENT_TIMESTAMP_UTC, and ACTION_NAME. Bind values keep dates explicit and avoid implicit string-to-date conversion. A report across PDBs would require the appropriate container-aware view and authority; that is outside this exercise.

Submit your answer

Your SQL is displayed for comparison with the model answer; it is not executed or automatically graded.