Database Maintenance

Database Maintenance

Managing Call Viewer and Speech Application Reports databases requires understanding how to delete records.

Deleting Information from the Database

Once data from a specific log file within a Call Viewer or Speech Application Reports database is no longer needed, delete the row corresponding to that .etl file from the LogFiles table, and all corresponding data which was imported from that file will be deleted from the database. The necessary delete relationships are in place between the LogFiles table and all the other imported tables to ensure that when rows are deleted from the LogFiles table, all corresponding entries are deleted. Do not delete data directly from any of the other tables.

To delete rows from the LogFiles table using Enterprise Manager
  1. In Enterprise Manager, in the left pane open the appropriate database and select Tables.

  2. In the right pane, right-click on the LogFiles table, select Open Table and then select Return All Rows.

  3. Select a row, or shift-click on the left column to select a range of rows.

  4. Right-click the selection and select Delete.

Using a Stored Procedure to Delete Database Records

It is possible to create a stored procedure which will delete rows given a set of date ranges. Create a stored procedure using the following SQL code.

CREATE PROCEDURE PurgeLogFiles
@startDate datetime = 0,
@endDate datetime
AS
DELETE FROM LogFiles
      WHERE @startDate < LogFiles.FirstEventTime
      AND LogFiles.LastEventTime < @endDate
GO

For example, to delete all log files before 1/15/2004 call the stored procedure with the following input.

PurgeLogFiles @endDate='01/15/2004'

Or to delete all log files between two dates call the stored procedure with the following input.

PurgeLogFiles '01/01/2000', '01/01/2001'
See Also

Detailed Analysis Tools