databaseauditing
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| databaseauditing [2015/07/21 08:24] – z0hpvk | databaseauditing [2025/03/08 22:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Database Auditing ===== | ===== Database Auditing ===== | ||
| - | ==== Turn Off Create Session Auditing ==== | + | ==== Disabling |
| By default, from 11gR1, when a database is created using DBCA, the database auditing parameter will be turned on. | By default, from 11gR1, when a database is created using DBCA, the database auditing parameter will be turned on. | ||
| Line 19: | Line 19: | ||
| This still means that failed logins are audited. | This still means that failed logins are audited. | ||
| - | ==== View Audit Trail ==== | + | ==== Viewing |
| SQL below will show everything that has been audited today | SQL below will show everything that has been audited today | ||
| Line 25: | Line 25: | ||
| < | < | ||
| set linesize 160 | set linesize 160 | ||
| - | col os_username format | + | col os_username format |
| - | col userhost format | + | col userhost format |
| - | select os_username, | + | select os_username, |
| from dba_audit_trail | from dba_audit_trail | ||
| where timestamp > trunc(sysdate) | where timestamp > trunc(sysdate) | ||
| Line 34: | Line 34: | ||
| ==== Purging Audit Trail ==== | ==== Purging Audit Trail ==== | ||
| + | Copy sys.aud$ table to the SYSAUX tablespace | ||
| + | < | ||
| + | DBMS_AUDIT_MGMT.INIT_CLEANUP( | ||
| + | AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, | ||
| + | DEFAULT_CLEANUP_INTERVAL => 24 | ||
| + | ); | ||
| + | END; | ||
| + | /</ | ||
| + | |||
| + | Create a job to set the Archive Timestamp. In this case it will be over 30 days | ||
| + | < | ||
| + | DBMS_SCHEDULER.CREATE_JOB ( | ||
| + | job_name | ||
| + | job_type | ||
| + | job_action => 'BEGIN DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(AUDIT_TRAIL_TYPE => | ||
| + | | ||
| + | start_date => sysdate, | ||
| + | repeat_interval => ' | ||
| + | enabled | ||
| + | comments | ||
| + | ); | ||
| + | END; | ||
| + | /</ | ||
| + | |||
| + | Create a purge job which will delete all audit entries older than the Archive Timestamp. | ||
| + | < | ||
| + | DBMS_AUDIT_MGMT.CREATE_PURGE_JOB( | ||
| + | AUDIT_TRAIL_TYPE | ||
| + | AUDIT_TRAIL_PURGE_INTERVAL => 24 /* hours */, | ||
| + | AUDIT_TRAIL_PURGE_NAME | ||
| + | USE_LAST_ARCH_TIMESTAMP | ||
| + | ); | ||
| + | END; | ||
| + | /</ | ||
databaseauditing.1437467092.txt.gz · Last modified: (external edit)
