Database
  Home arrow Database arrow Page 6 - Building an Audit Trail for Your Data
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Building an Audit Trail for Your Data
By: Michael Kleane
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 41
    2004-02-25

    Table of Contents:
  • Building an Audit Trail for Your Data
  • Creating Audit Tables
  • Passing Table Names
  • Creating the Audit Triggers
  • Making the Trigger Code Readable
  • Auditing Tips/Techniques

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building an Audit Trail for Your Data - Auditing Tips/Techniques


    (Page 6 of 6 )

    Customizing

    Building on these scripts, other possible enhancements include:

    • Add Grant statements that execute immediately following the table DDL.
    • Add criteria for when triggers should fire, possibly data-driven from a configuration table. In Oracle, this is done with the ‘WHEN’ clause.  
    • Add support for auditing views with ‘INSTEAD OF’ triggers in Oracle 8 and higher.

    When customizing, keep in mind that trigger logic must execute quickly. A slow performing trigger can wreak havoc on database performance (see below). Also, if the definition of an audit table is altered (due to modifications to the audited table), the associated trigger should be rebuilt to reflect those changes.

    Check Performance

    Auditing high-volume tables in production can have serious performance ramifications.  For OLTP systems with a low to moderate amount of volume, a database like Oracle is more than up to the task.  It would be prudent to test the performance with triggers enabled and disabled on any tables in question.  Tables containing configuration data and metadata are ideal candidates for auditing.

    Purge old data

    Have a system in place to routinely purge audit data.  Active tables can quickly consume disk space with audit information.  Set expiration dates on audit trail data and, if necessary, move it off-line.

    Put it on display

    An audit trail might be useful to application users.  One example is in an issue tracking application where a user can view previous activity that might provide clues to their problem.  A ‘History’ button can be added to the user interface that will open a window displaying previously audited information for the master record. 


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hi ,The content is well written and innovative.A charger to readers...
       · With a Web App the user of the database maybe the same (asp.net user) no matter who...
     

    DATABASE ARTICLES

    - Building Applications with Anonymous Types
    - A Closer Look at Anonymous Types
    - Programming with Anonymous Types
    - Converting Your Excel Worksheet into a Worki...
    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek