Oracle 视图 USER_AUDIT_STATEMENT 官方解释,作用,如何使用详细说明
本站中文解释
S
Oracle 视图USER_AUDIT_STATEMENTS用来查询被审计的语句。它含有被审计的语句,就类似于操作系统记录的日志文件。它由表SYS.AUD$和系统视图 USER_OBJECTS 构成。
USER_AUDIT_STATEMENTS 的使用方法:
1. 先确定AUD$ 是否被审计,可以查询v$option视图,
SQL> SELECT value FROM v$option WHERE parameter = ‘Audit Trail’;
该查询结果返回如下:
Value
————————————————————————————————
DB,EXTENDED,OS
如果有aud$参数,则说明该实例已设置了审计,才是启用aud$审计功能。
2. 用 USER_AUDIT_STATEMENTS 查询某个时间点的审计记录:
SQL> SELECT * FROM USER_AUDIT_STATEMENTS WHERE AUDIT_CHANGE_ON > SYSDATE-1/1440;
该查询返回最近1分钟中所有审计语句的记录。
官方英文解释
USER_AUDIT_STATEMENT
displays audit trail entries for the GRANT
, REVOKE
, AUDIT
, NOAUDIT
, and ALTER SYSTEM
statements issued by the current user.
Its columns are the same as those in “DBA_AUDIT_STATEMENT”.
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
.