Problem:
When running Enterprise Manager Database or Grid Console, the following Query is showing high I/O Waiting for the User the following query takes a lot of time to run:
SELECT TO_CHAR(current_timestamp AT TIME ZONE 'GMT', 'YYYY-MM-DD HH24:MI:SS TZD') AS curr_timestamp, COUNT(username) AS failed_count
FROM sys.dba_audit_session
WHERE returncode != 0 AND TO_CHAR(timestamp, 'YYYY-MM-DD HH24:MI:SS') >=
TO_CHAR(current_timestamp - TO_DSINTERVAL('0 0:30:00'), 'YYYY-MM-DD HH24:MI:SS')
|
Cause:
The 'TO_CHAR' conversion to do the date arithmetic is redundant and should NOT be used. This was reported in an internal BUG.
There is a known performance issue with DBA_AUDIT_SESSION table per non-published Bug 7633167 : SQL PERFORMANCE ISSUE IN DBA_AUDIT_SESSION.
Solution:
You can either disable 'Failed Login Count' job in OEM or purge aud$ table.
Disable the 'Failed Login Count' metric:
- In the Grid Control Console:
- Navigate to Targets -> Databases -> Click on the Database Link
- Navigate to Oracle Database -> Monitoring -> Metric and Collection Setting
- Find “Failed Logins” and click "Every 30 Minutes" link:
- Under Collection Schedule click Disable button:
- Click Continue button.
- Click OK button.
- You should this confirmation message:
- Click OK button.
Truncate, Delete, or Purge Rows from the Audit Trail Table AUD$:
To purge all the audit records from the audit trail run this command as SYS:
SQL> truncate table aud$;
|
To delete rows from the audit trail related to a particular audited object run this command:
SQL> DELETE FROM sys.aud$ WHERE obj$name='<object_name>';
|
I hope this helps.
Please feel free to leave your questions or suggest improvements to this section.
Thank you. Very useful this tip.
ReplyDeleteGreat help for solving Disk I/O that was reason of poor performance because of OEM query running every 30 mins.
ReplyDeleteI don't recommend to truncate the table in that way. Instead you should use the intended way with "DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL" package to purge the Audit tables. Note that SYSAUX tablespace is used for this.
ReplyDeletethanks a lot!
ReplyDeletehank you. Very useful this tip.
ReplyDeleteThank you, it helped me!
ReplyDelete