Oracle8i SQL Reference Release 2 (8.1.6) A76989-01 |
|
SQL Statements (continued), 10 of 11
To track the occurrence of specific SQL statements in subsequent user sessions. Auditing options specified by the AUDIT
sql_statements
statement apply only to subsequent sessions, not to current sessions.
To choose particular schema objects for auditing, see "AUDIT schema_objects". For information on disabling auditing of SQL statements, see "NOAUDIT sql_statements".
You must have AUDIT
SYSTEM
system privilege.
You must enable auditing by setting the initialization parameter AUDIT_TRAIL
to DB. You can specify auditing options regardless of whether auditing is enabled. However, Oracle does not generate audit records until you enable auditing.
statement_opt |
chooses specific SQL statements for auditing. For a list of these statement options and the SQL statements they audit, see Table 7-1 and Table 7-2. For each audited operation, Oracle produces an audit record containing this information:
Oracle writes audit records to the audit trail, which is a database table containing audit records. You can review database activity by examining the audit trail through data dictionary views. For information on these views, see the Oracle8i Reference. |
|
system_priv |
chooses SQL statements that are authorized by the specified system privilege for auditing. For a list of all system privileges and the SQL statements that they authorize, see Table 7-5.
Rather than specifying many individual system privileges, you can specify the roles |
|
|
|
|
|
Note: Oracle Corporation recommends that you specify individual system privileges and statement options for auditing rather than roles or shortcuts. The specific system privileges and statement options encompassed by roles and shortcuts change from one release to the next and may not be supported in future versions of Oracle. |
|
|
chooses only SQL statements issued by specified users for auditing. If you omit this clause, Oracle audits all users' statements. |
|
|
chooses for auditing only SQL statements issued by the specified proxy. See Also: Oracle8i Concepts for more information on proxies and their use of the database. |
|
|
|
|
|
causes Oracle to write a single record for all SQL statements of the same type issued in the same session. |
|
|
causes Oracle to write one record for each audited statement. |
|
|
If you specify statement options or system privileges that audit data definition language (DDL) statements, Oracle automatically audits by access regardless of whether you specify the |
|
|
For statement options and system privileges that audit SQL statements other than DDL, you can specify either |
|
|
chooses auditing only for statements that succeed.
|
|
|
If you omit the |
To choose auditing for every SQL statement that creates, alters, drops, or sets a role, regardless of whether the statement completes successfully, issue the following statement:
AUDIT ROLE;
To choose auditing for every statement that successfully creates, alters, drops, or sets a role, issue the following statement:
AUDIT ROLE WHENEVER SUCCESSFUL;
To choose auditing for every CREATE ROLE
, ALTER ROLE
, DROP ROLE
, or SET
ROLE
statement that results in an Oracle error, issue the following statement:
AUDIT ROLE WHENEVER NOT SUCCESSFUL;
To choose auditing for any statement that queries or updates any table, issue the following statement:
AUDIT SELECT TABLE, UPDATE TABLE;
To choose auditing for statements issued by the users SCOTT
and BLAKE
that query or update a table or view, issue the following statement:
AUDIT SELECT TABLE, UPDATE TABLE BY scott, blake;
To choose auditing for statements issued using the DELETE ANY TABLE
system privilege, issue the following statement:
AUDIT DELETE ANY TABLE;
To choose auditing for statements issued using the CREATE ANY DIRECTORY
system privilege, issue the following statement:
AUDIT CREATE ANY DIRECTORY;
To choose auditing for CREATE DIRECTORY
(and DROP DIRECTORY
) statements that do not use the CREATE ANY DIRECTORY
system privilege, issue the following statement:
AUDIT DIRECTORY;
|
Copyright © 1999 Oracle Corporation. All Rights Reserved. |
|