Dialogue Cloud

Retention Policy for Dialogue Manager Database

Introduction

This topics describes how the use the retention policy script to remove Dialogue Manager data older the set time.

Only Text conversation that are processed before the retention date range will be deleted. Text conservations that are still open or that have been re-opened inside the rendition date range will not be deleted.

The Retention Policy script will cleanup the following tables:

  • Session

  • MessageAttachment

  • Attachment

  • Participant

  • Message

  • Conversation

Run Retention Policy script

  1. Login to a machine / server with "Azure Data Studio" or "Microsoft SQL Server Management Studio".

  2. Connect to the Database engine, where the databases are located.

  3. Navigate to the Dialogue Programmability > Stored Procedured

  4. Execute the "dbo.usp_Retention" script.

  5. Change the Parameter:

    1. RetentionDate = The earliest date you would like to keep data in the current database.

  6. Execute the script.

Alternative: Moving target

If you want to run the retention policy on a recurrent schedule, you need to make the RetentionDate a moving target. This can be done by using the following SQL query:

Copy
SQL
DECLARE @RC int
DECLARE @RetentionDate date

SET @RetentionDate = GETDATE()-90

EXECUTE @RC = [dbo].[usp_Retention] 
    @RetentionDate
GO