Name
AUDIT (SQL Statements)
Synopsis
AUDIT {system_option | sql_option}[,{system_option | sql_option ...}]
{[BY username[,username ...]]
| [BY proxy [ON BEHALF OF {ANY | username[,username]] }
}
{[BY SESSION] [WHENEVER [NOT] SUCCESSFUL]
| [BY ACCESS] [WHENEVER [NOT] SUCCESSFUL]
}Sets up auditing for specific SQL statements in subsequent user sessions. Audit records are written to the audit trail, which is a database table containing audit records that can be accessed through data dictionary views. Auditing must be enabled using the AUDIT_TRAIL parameter in the initialization file. (See Chapter 2 for information on auditing parameters.)
Keywords
- system_option
Specifies that SQL statements authorized by the named system privilege be audited. See Chapter 4 for details.
- sql_option
Specifies a set of SQL statements to be audited. See Chapter 4 for details.
- BY username
Specifies that SQL statements issued by the named user be audited.
- BY proxy
Specifies that SQL statements issued by the specified proxy be audited.
- ON BEHALF OF ANY
Specifies that SQL statements issued on behalf of any user be audited.
- ON BEHALF OF username
Specifies the user on whose behalf the proxy executes the specified statement.
- BY SESSION
Causes Oracle to write a single record for all SQL statements of the same type issued in the same session.
- BY ACCESS
Causes Oracle to write a single record for each audited statement.
- WHENEVER SUCCESSFUL
Chooses auditing only for SQL statements that complete successfully.
- WHENEVER NOT SUCCESSFUL ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access