Capture an Oracle 10g audit trail in XML format
Takeaway: Oracle 10g can be configured to write its audit logs to XML files in operating system directories. This tip shows the configuration changes that need to be made, as well as how to access the resulting XML files.
The Oracle database has long had the ability to audit selected types of operations against the database, storing the audit trail in a system table. This table, SYS.AUD$, resides in the data dictionary. On some operating systems, you can also write audit records to the operating system's own event logging subsystem.
Oracle 10g added a third option: The ability to write to files in an operating system directory. These files can be written in XML.
There are several benefits to using XML instead of SYS.AUD$ for auditing, including:
- XML can easily be processed by tools outside the database, filtered for events of interest, combined with audit logs from other systems, and formatted for HTML display.
- Operating system files can provide stronger security than the SYS.AUD$ table, especially if it's desirable to protect the audit trail from viewing or modification even by the DBA.
- Audit logs stored outside the database continue to be available even when the database instance is down, but they can still be queried from within the database via a new view, V$XML_AUDIT_TRAIL.
To activate auditing to XML files, two initialization parameters need to be set. First, identify the directory to which the audit files will be written by setting:
audit_file_dest='directorypath'
Note that this is not a directory object such as the Data Pump utilities use, but the actual pathname of the operating system directory.
Second, set the audit_trail parameter:
audit_trail=xml
Finally, restart the Oracle instance. The audit_trail parameter is static and requires that Oracle be restarted for it to take effect. However, you can change the audit_file_dest parameter dynamically via the ALTER SYSTEM command if the DEFERRED parameter is used:
ALTER SYSTEM SET audit_file_dest='directorypath' DEFERRED
Existing sessions will keep logging to the original location, but new sessions will log to the new destination.
Miss a tip?
Check out the Oracle archive, and catch up on our most recent Oracle tips.
Bob Watkins (OCP, MCDBA, MCSE, MCT) is a computer professional with 25 years of experience as a technical trainer, consultant, and database administrator. Visit Bob's site.
Print/View all Posts Comments on this article
|
|
|
|
White Papers, Webcasts, and Downloads
- Why Isn't Server Virtualization Saving Us More? A Few Small Changes May Dramatically Increase Your Efficiency VMware Ever wonder why your company isn't saving more from its server virtualization? Making a few small changes could dramatically increase your efficiency. Download Now
- The True Costs of Virtual Server Solutions VMware Discover ways to streamline and simplify your assessment of the total acquisition costs of a server virtualization environment. Download Now
- Email Security and Archiving - Clearer in the Cloud Google The time is NOW for businesses and organizations of all sizes to implement ... Download Now
- VMware Infrastructure: A Guide to Bottom-Line Benefits VMware Frustrated by the high cost of maintaining or building ever-larger data centers? Get the facts you need to formulate your Virtualization Action Plan. Download Now
- Building the Virtualized Enterprise with VMware Infrastructure VMware This paper explains how adopting a virtual infrastructure -- comprised of server, storage, and networking virtualization technologies -- can help your organization build a sustainable competitive ... Download Now
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET

