|
 |
|
Oracle Tips by Burleson |
Chapter 8 General Oracle Auditing
-
Then the data in the archived table should be
deleted from the main aud$ table. A simple DELETE AUD$ will do; but
there are two problems:
-
A regular delete generates a lot of redo
and undo activity.
-
A regular delete also does not reset the
high water mark, so the table is fragmented.
Therefore, as an alternative, we will create a
separate temporary table named aud_temp on the same tablespace as
the aud$ table. This table holds the records that are not present in
the archived table AUD0306.
-
After this table is created, the original aud$
table is dropped.
-
The table aud_temp is then renamed to the main
table aud$. The index on it, I_AUD1, is rebuilt.
-
The tablespace AUD0306 is converted to READ
ONLY.
-
This tablespace is now transported to a
separate medium such as a WORM device, which could be as simple as a
Writable CD-ROM. The datafiles of the tablespace and the small
export dump file are written to the WORM device.
-
The tablespace is then dropped.
These steps have been implemented in the code
below. The code has been deliberatively broken into three parts
since only the successful execution of the prior part should pave
the way for the next part. If an error occurs during any part, it
should be stopped.
archive_audit_1.sh
--**********************************************
--
-- Copyright © 2003 by Rampant TechPress Inc.
The above text is
an excerpt from
the bestselling book:
Oracle
Privacy Security Auditing.
It's only $39.95 and has an
download of working security scripts:
This is the only authoritative
book on Oracle Security, Oracle Privacy, and Oracle Auditing written
by two of the world’s leading Oracle Security experts.
This indispensable book is only $39.95 and has an
download of working security scripts:
http://rampant-books.com/book_2003_2_audit.htm
Download your Oracle scripts now:
www.oracle-script.com
The
definitive Oracle Script collection for every Oracle professional DBA
|
|