Patent ID: 7127448

Claim:
A method for selectively auditing accesses to a relational database, comprising: receiving a query for the relational database; selectively auditing an access to the relational database, wherein selectively auditing the access involves automatically modifying the query prior to processing the query, wherein an auditing condition for the selective auditing specifies a condition based on a value of a field in a row in the relational database, and wherein satisfying the auditing condition allows selective auditing of the query, processing the modified query to produce a query result, wherein processing the modified query includes: creating audit records only for rows in relational tables accessed by the query and that satisfy the auditing condition, and recording the audit records in an audit record store; and returning the query result; wherein if the query modifies at least one entry in the relational database, using a relational database system trigger to create and record the audit record for the modification to the relational database.