Oracle 视图 DBA_AUDIT_TRAIL 官方解释,作用,如何使用详细说明
本站中文解释
Oracle 中的DBA_AUDIT_TRAIL 视图能够显示数据库审计数据,包括用户会话中执行的SQL和操作,如SELECT、INSERT等以及每一次登录数据库所执行的操作。
DBA_AUDIT_TRAIL 视图可以用来诊断数据库性能,检测用户的安全行为,帮助符合合规要求。
使用此视图的步骤如下:
• 登录到Oracle 数据库中,有相关权限的用户;
• 搜索DBA_AUDIT_TRAIL视图;
• 编写SQL语句,获取要查看的数据;
• 运行SQL语句,查看所需的数据
• 添加/修改/删除视图中的数据
• 将数据另存为报表,以便进一步分析数据
官方英文解释
DBA_AUDIT_TRAIL
displays all standard audit trail entries.
Note:
This view is relevant when using traditional auditing. Traditional auditing is deprecated in Oracle Database 21c. Oracle recommends that you instead use unified auditing, which enables selective and more effective auditing inside Oracle Database.
-
See Oracle Database Security
Guide for more information about unified auditing. -
See Oracle Database Upgrade
Guide for more information about migrating to unified auditing.
This view is populated only in an Oracle Database where unified auditing is not enabled. When unified auditing is enabled in Oracle Database, the audit records are populated in the new audit trail and can be viewed from UNIFIED_AUDIT_TRAIL
.
Related View
USER_AUDIT_TRAIL
displays the standard audit trail entries related to the current user.
Column | Datatype | NULL | Description |
---|---|---|---|
|
|
Operating system login username of the user whose actions were audited |
|
|
|
Name (not ID number) of the user whose actions were audited |
|
|
|
Client host machine name |
|
|
|
Identifier of the user’s terminal |
|
|
|
Date and time of the creation of the audit trail entry (date and time of user login for entries created by |
|
|
|
Creator of the object affected by the action |
|
|
|
Name of the object affected by the action |
|
|
|
|
Numeric action type code. The corresponding name of the action type is in the |
|
|
Name of the action type corresponding to the numeric code in the |
|
|
|
Owner of the object named in the |
|
|
|
New name of the object after a |
|
|
|
Object privileges granted or revoked by a
A
|
|
|
|
System privileges granted or revoked by a |
|
|
|
Indicates whether the role or system privilege was granted with the |
|
|
|
Name of the grantee specified in a |
|
|
|
Auditing option set with the |
|
|
|
Session summary (a string of 16 characters, one for each action type in the order
|
|
|
|
Date and time of user log off |
|
|
|
Logical reads for the session |
|
|
|
Physical reads for the session |
|
|
|
Logical writes for the session |
|
|
|
Deadlocks detected during the session |
|
|
|
Text comment on the audit trail entry, providing more information about the statement audited Also indicates how the user or remote call was authenticated. The method can be one of the following:
When an object is accessed remotely over a database link, the
|
|
|
|
|
Numeric ID for each Oracle session. Each user session gets a unique session ID. |
|
|
|
Numeric ID for each audit trail entry in the session. The entry ID is an index of a session’s audit entries that starts at 1 and increases to the number of entries that are written. |
|
|
|
nth statement in the user session. The first SQL statement gets a value of 1 and the value is incremented for each subsequent SQL statement. Note that one SQL statement can create more than one audit trail entry (for example, when more than one object is audited from the same SQL statement), and in this case the statement ID remains the same for that statement and the entry ID increases for each audit trail entry created by the statement. |
|
|
|
Oracle error code generated by the action. Some useful values:
|
|
|
System privilege used to execute the action |
|
|
|
Client identifier in each Oracle session |
|
|
|
Application execution context identifier |
|
|
|
Amount of CPU time used by each Oracle session (in centiseconds) |
|
|
|
Timestamp of the creation of the audit trail entry (timestamp of user login for entries created by |
|
|
|
Proxy session serial number, if an enterprise user has logged in through the proxy mechanism |
|
|
|
Global user identifier for the user, if the user has logged in as an enterprise user |
|
|
|
Instance number as specified by the |
|
|
|
Operating System process identifier of the Oracle process |
|
|
|
Transaction identifier of the transaction in which the object is accessed or modified |
|
|
|
System change number (SCN) of the creation of the audit trail entry |
|
|
|
Bind variable data of the query |
|
|
|
SQL text of the query |
|
|
|
Name of the edition containing the audited object |
|
|
|
Database identifier of the audited database |
|
|
|
Stores virtual private database (VPD) policy names and predicates separated by delimiter. To format the output into individual rows, use the |
|
|
|
Effective user for the statement execution |
Note:
The SQL_BIND
and SQL_TEXT
columns are only populated if the AUDIT_TRAIL
initialization parameter is set to db
, extended
.
See Also:
-
“AUDIT_TRAIL”
-
“USER_AUDIT_TRAIL”
-
Oracle Database PL/SQL
Packages and Types Reference for more information about theDBMS_AUDIT_UTIL.DECODE_RLS_INFO_ATRAIL_XML
function.