FAQs - ApexSQL Audit
General
|
How do I get started?
|
See our Getting Started topic. You will have to pass three main steps: install audit architecture, create Audit Plan and script and run the Triggers.
First, download and run ApexSQL Audit installation program on your workstation or server. Run the installed ApexSQL Audit and, when prompted, specify database connection parameters. Also, auditing architecture needs to be installed, audit profile needs to be selected, triggers needs to be created and then executed.
|
What does ApexSQL Audit (inserts, updates, deletes)?
|
ApexSQL Audit audits all DML (Data Modification Language) operations including insert, update, and delete operations on the tables.
|
What versions of SQL Server are supported?
|
ApexSQL Audit supports Microsoft SQL Server versions 7.0, 2000 or 2005.
|
Do I have to change my existing applications to allow ApexSQL Audit to work with my database?
|
No. ApexSQL Audit is completely installed on the database server and it is transparent to all applications affecting the database.
|
What are the limitations of auditing BLOB fields?
|
Auditing BLOB fields have the following limitations:
- BLOB fields do not exist in context tables delete and insert in triggers so values of changes cannot be written in audit tables. We get from parent table new values in insert and update actions. Old value always is NULL in 'update' action.
- We don't save text datatype as it is we convert it to ntext type and write it to audit tables.
- We don't save XML datatype (SQL2005) as it is we convert it to ntext type and write it to audit tables.
- We don't save nvarchar(max) datatype (SQL2005) as it is we convert it to nvarchar(4000) type and write it to audit tables.
- We don't save varbinary(max) datatype (SQL2005) as it is we convert it to nvarchar(4000) type and write it to audit tables.
- Nvarchar(max) and varbinary(max) datatypes (SQL2005) exist in context table and are handled as nvarchar and varbinary datatypes in SQL Server 2000.
|
How does ApexSQL Audit know when my data has been changed?
|
ApexSQL Audit installs triggers on the tables you select to audit. Triggers are SQL objects that automatically execute every time a row in a given table is inserted, updated, or deleted. ApexSQL Audits triggers are especially built to examine the columns you have selected to audit in that table to determine if the data in that column has been changed.
|
Where is the audit log data stored?
|
Audit log data is stored within tables created by ApexSQL Audit. These tables can be installed in the same database being audited or in a different database on the same server. These tables can be queried via SQL or other data access tools. The tables included in the default architecture are: AUDIT_LOG_DATA and AUDIT_LOG_TRANSACTIONS.
|
How can I verify the audit triggers are working?
|
Run an insert, update or delete operation against an audited table and then run this query:
SELECT COUNT(* )
FROM AUDIT_LOG_TRANSACTIONS
If count > 0 then you have audit data.
|
I don't want to audit everything in my database, only certain selected areas, what control do I have over what is audited?
|
You have complete control over which tables are audited and which columns in those tables are audited as well as the type of audit trigger (insert, update and/or delete). In fact, it is wise to carefully consider your audit plan, because the more you audit, the more space your audit log will occupy and the more activity your server will have to bear to perform the auditing.
|
In some cases, I care only about changes to existing data, not new data or deleted data. Do I have to audit all transactions on a given table?
|
No. You can choose any combination of the insert, update, or delete operations, and you can change this selection table-by-table.
|
Which column datatypes are supported?
|
All standard SQL server (7.0, 2000, and 2005) datatypes. However we have several limitations in BLOB fields auditing.
|
Can I have my own triggers on the same table that is being audited by ApexSQL Audit?
|
Yes, you can. SQL Server permits multiple triggers to exist on the same table. ApexSQL Audit's triggers will happily co-exist on a table side-by-side with any triggers of your own.
|
Can ApexSQL Audit track changes in tables without a primary key or a unique index?
|
Yes, it can. It tries finding identity field and if a primary key is not found, it will check all fields as row key. You can customize Row Key if you know which is the fields group with unique values.
|
What order are the ApexSQL Audit triggers fired in?
|
We mark audit triggers as last, so the user triggers will be fired before ApexSQL Audit triggers are.
|
If I change my schema will I have to regenerate the triggers on these tables?
|
Yes, but with the schema change functionality, ApexSQL Audit can automatically detect table changes and repair triggers.
|
Does ApexSQL Audit allow me to manage the Table Key used for auditing?
|
Yes. Select the table(s) you want to edit and go to the Row Key for Panel for managing the Table Keys.
|
How can I transfer my ApexSQL Audit Project/profile to another PC?
|
The Project file contains all information about the audited objects and other audit options. To avoid problems un-check the "Store Encrypted Password" to ensure better portability to other workstations prior to saving. This project file can be transferred to any computer where it is used the same version of ApexSQL Audit.
|
Will ApexSQL Audit capture NT Logins?
|
Yes, ApexSQL Audit captures Windows Authentication logins if there is using Windows Authentication mode.
Managing Audit Architecture
|
What is an audit architecture and how can I use it?
|
The Audit Architecture files (.audx) are XML files that contain all the information ApexSQL Audit requires to set up Auditing on your database. These files that contain tags for a variety of template attributes like Name and Description as well as a tag for each of the major scripts required to run ApexSQL Audit, for example the DDL script to set up the Auditing tables.
|
Is anything done to system tables (for example, Master database) during architecture installation?
|
No, the system tables are unaffected by ApexSQL Audits default architecture.
|
How can I delete all audit triggers?
|
Use Trigger Management module. Here you may delete or disable your triggers. Another way is to use the Delete Auditing module.
Select "Delete Audit Triggers" option to delete all the triggers.
Or, you can create a script like the one below. We use
SQLAUDIT GENERATED - DO NOT REMOVE to identify the audit trigger.
Script:

|
What is the script to manually delete all architecture objects (tables etc)?
|
The Architecture Management form contains the Delete AA architecture node. It references to dbo.AUDIT_prc_DeleteArchitecture stored procedure to delete architecture from database. If you don't have it, you should install the Architecture first.
Managing Trigger Template
|
How do I create my own template in ApexSQL Audit?
|
You can edit our default template in Template Editor and then save it or click New Template and start from scratch creating your own.
|
How can I change the way Primary_Key is written? What lines in the template will affect this (so I can change them)?
|
We use same template to generate Primary key fields and values in each trigger. You should change it. Go to Template Editor and make the following changes:

Format of result string defined in yellow background string. So if you want to write only values (without name of key column) you should change it to:

We do not recommend changing PRIMARY_KEY_DATA field writing, because it is used in UnDo, so if youll change it then UnDo would not work.
UnDo-ing Operations
|
Is ApexSQL Audit able to undo the audited operations?
|
Yes. ApexSQL Audit includes the capability to reverse audited transactions down to the cell level. Click on "Undo Transaction" from the Outlook Bar, toolbar or Audit menu to access the UnDo module.
|
How deep does the UnDo procedure work?
|
The UnDo module is structured in 4 steps:
- Filter Transactions
- Check Dependencies to Ability to UnDo and Show Report
- UnDo Transactions (here SQL server locks user tables used in undoing transactions until undo is either committed or rolled back)
- Commit or Rollback your UnDo
Watches
|
What are Watches?
|
Watches are fields that might not be affected by the data change but are selected to participate in the audit trail anyway. This way, the value is watched when other fields are changed.
|
Where can I setup Watches?
|
First you need to select the table(s) you want watches to be created for, select the table fields for auditing and use the Watches Panel for managing the watches.
|
Can I add more than one Watch field for a single audited field?
|
Yes, you can add multiple Watch fields for a single audited field.
|
Can I associate a single Watch field to more than one audited fields?
|
Yes, you can associate a single Watch field to several audited fields from the same table.
|
Will Watches work for new added data?
|
No, Watches will not work if you will insert or delete a value. They work only for updated data.
|
Why are the pick lists for "Watch Field Name" and "Audit Field Name" empty?
|
You must have selected at least one field for auditing in the table you are trying to add Watch for.
Lookups
|
What are Lookups?
|
Lookups are Watches that pick up their value from a different table (usually following a standard FK) to show the human recognizable Literal versus an ID type Value that would not be as helpful to someone looking at an audit report.
|
How can I create Lookups?
|
Select the table you want lookup to be created for, select the table fields for auditing and use the Lookups Panel for managing the lookups.
|
What is the difference between a Lookup and a Watch?
|
Lookups only affect the audited column which must be changed for the Lookup to fire. Watches are from columns that might not be changed but can be assigned to columns that, if changed, will fire the Watch.
Lookup values are derived from a different table. Watches always come from the same table.
|
How can I build an Expression on Lookup creating?
|
Go to the Lookup Panel and create/edit a lookup. In the Expression field type your expression.
|
Can I add more than one condition pair on Lookup creating?
|
Yes. You can add any number of condition pairs as well as first condition.
Security
|
Are there ways to secure the Audit tables better to restrict/deny direct edits, potential fraudulent activity including manipulation of audit data, or users viewing data directly?
|
Yes, there are. You should make your audited tables owners to be a Public role member and grant them at least INSERT permission on Audit storage tables. Then make sure that your non-trusted users have no owner rights on the audited tables. This way they wont be able to DROP/ALTER the Audit triggers.
To restrict user access to the Audit storage tables you should deny to the non-trusted user:
- Any permissions on Audit storage tables.
- A permission on executing of the stored procedures of the Audit architecture.
That may be done manually or over additional role that have no rights to browse dbo roles objects. All Audit objects have dbo as owner.
|
Is there anything that can be done to help preventing audit triggers from being deleted, disabled or modified by users - to prevent fraudulent disabling of auditing?
|
Yes, by giving users only delete, insert, select and update permissions on the desired tables.
Command Line Interface
|
Does ApexSQL Audit support command line mode?
|
Yes, ApexSQL Audit supports Command Line mode. Simply run apexsqlaudit.com file from the installation folder.
|
Where is the executable file that host the Command Line Interface of ApexSQL Audit located on my file system?
|
Go to the folder where you have installed ApexSQL Audit to. There you will find a file named apexsqlaudit.com. This is the console application you call in command line scripts. Note, that there is also a file named apexsqlaudit.exe. Do not use this file in your scripts. This file starts the GUI and you will get an error when you try to run it from the Command Line.