Manage/Purge Audit Data

ApexSQL Audit provides a form for purging data automatically from the Audit log if you want to manage the size of this table and your database. To open this form click on "Manage Audit Data" from the Outlook Bar, Audit menu or toolbar as shown here:

 

 

The functionality consists of basically 3 steps: you can delete all audited data, you can delete audited data based on a deletion criteria or you can create and schedule data deletion job.

I want to Delete All Data now

If you want to delete all your audited data and clean up Audit Storage tables choose this option and hit button. This will show a warning dialog:

After your confirmation all data will be deleted.

I want to Delete Data Now Based on Data Deletion Criteria Below

Choosing this option will enable Data Deletion Criteria in the dialog.

Delete Data by Age option allows you specifying the age of data to be deleted by. You may select a time period: Days, Weeks or Months and input an integer number of the periods.

Delete Data by Log Size option allows you to limit a row count of the Log. The excess rows will be deleted. Data is deleted on a FIFO basis - First In First Out - so only the oldest rows are deleted.

Delete All Data option allows you cleaning up of the Audit Storage tables.

After setting up Deletion Criteria you should hit button to start the deletion process.

I want to Create and Schedule a Job to Delete Data Later Based on Data Deletion Criteria Below

To create a schedule job to run your Data Deletion task in the future you need to specify a job name to be created, for example MyJob1.

After you have entered in all of the necessary information - click .

You will see a schedule dialog like this.

Enter in your desired schedule and click .

 Tech Tip:

 The job has not yet been run and will not be run unless it is time to be run by the scheduler or

 you run it manually through ApexSQL Audit itself.

 We can now see that our new job "MyJob1" has been successfully created:

Managing Saved Jobs

The Saved Jobs grid lists all jobs found on your server. Let’s choose the created MyJob1 job in the list. We can right click on the job or click the button to see the job properties. This is what we will see.

This dialog shows us the actual SQL that will be run. It is a procedure created when the Architecture profile was run. It has not been run yet so its "Last Run Outcome" property is Unknown.

So let's run the job directly through the application interface. We can right click on the job and select "Run Job" or click .

You will see this warning dialog if your SQLAgent is not running on your server:

In case of enabled SQLAgent you will hopefully see a dialog that indicates the job was run successfully.

At this point you can check the history of the job by clicking . Here you can see when the job was run and any server messages. You can check back over time to monitor the history of a schedule job that may be executed frequently over time.

Buttons

Button

Description

Deletes all your audited data and cleans up Audit Storage tables. A warning will be displayed before deletion.

 

 

Runs the deletion process. See more information here.

 

 

Creates a job using the selected criteria.

 

 

Displays the History dialog for the selected job.

 

 

Displays the Properties dialog for the selected job.

 

 

Refreshes the whole job list with its status.

 

 

This will schedule the selected job. The Job Scheduler dialog displays.

 

 

This will delete the selected job(s). A warning will be displayed before deletion.

 

 

This will run the selected job.

 

 

This will open the help file.

 

 

This will close the dialog.

 

 

This will cancel performed actions and close the dialog.

 

 

This will delete the job's history. A warning will be displayed before deleting.

 

 

Context Menu

All the buttons in the dialog related to the job list are duplicated in the context menu:

Icon

Name

Description

Run Job

Runs the selected job.

 

 

 

Refresh

Refreshes the whole job list with its status.

 

 

 

 

Schedule

Schedules the selected job.

 

 

 

 

History

Displays the History dialog for the selected job.

 

 

 

Select All

Selects all saved jobs.

 

 

 

Un-Select

Deselects the selected job(s).

 

 

 

 

Properties

Displays the Properties dialog for the selected job.

 

 

 

Delete

Deletes the selected job(s).