Name

AUDIT (SQL Statements)

Synopsis

AUDIT {system_privilege |
sql_statement}[,{system_privilege
| sql_statement ...}]
[BY user[,user
...]]
   [BY SESSION [WHENEVER [NOT] SUCCESSFUL]
   [BY ACCESS [WHENEVER [NOT] SUCCESSFUL]

Sets up auditing for specific SQL statements in subsequent user sessions.

Keywords

system_privilege

Indicates that the SQL statement authorized by the named system privilege is to be audited.

sql_statement

Indicates that a set of SQL statements (e.g., SELECT, UPDATE) specified by the system option is to be audited.

BY user

Indicates that SQL statements issued by the particular user are to be audited.

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

Chooses auditing only for SQL statements that fail or result in errors.

Notes

You must have the AUDIT SYSTEM privilege to issue this command. Audit records are written to the audit trail, a database table containing audit records, which can be accessed through data dictionary views. Note that auditing must be enabled using the INIT.ORA parameter AUDIT_TRAIL.

Example

The following example audits for any unsuccessful SELECT statement, which may indicate an attempt to read a table for which a user has not been granted access:

AUDIT SELECT TABLE
   WHENEVER NOT SUCCESSFUL
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset