Purge procedures and parameters
Contents
Learn how to safely and efficiently purge data in the WFM ETL database.
The WFM ETL database script includes the following database-stored procedures used to enable purging of the ETL database:
Procedure |
Description |
WFM_PURGE_PROC |
The main procedure, used to call all the procedures below, passing a date that is calculated by subtracting a specified number of days from the current date.
Use the following parameters with this procedure:
|
WFM_PERF_PURGE_PROC |
Purges performance statistics data older than a given date.
|
WFM_SCH_PURGE_PROC |
Purges schedule data older than a given date.
|
WFM_ADH_PURGE_PROC |
Purges adherence data older than a given date.
|
WFM_CFG_PURGE_PROC |
Purges configuration data (uses no parameters). |
Specifying the number of records to delete
When using the @MAX_PURGE_CHUNK parameter in the procedures described in the table above, be sure to carefully weight it to prevent overtaxing the database server if there are already millions of records that need purging.
Genesys recommends that you limit the number of records to be deleted in one pass to avoid large transactions and allow the database to purge gradually, during subsequent executions of scheduled purging tasks.
Purging terminated agents
When purging terminated agents, the ACTIVE_FLAG setting plays an important role. ACTIVE_FLAG is used in several Dimension tables in WFM ETL database. It's setting indicates whether or not the corresponding record exists in the operational WFM Database.
When you delete agent records from the Genesys Configuration Database, the termination date is set for agents in the operational WFM Database. However, the record is retained so that schedules and other agent information contain all of the related details.
The TERMINATION_DATE is used to indicate when an agent has been deactivated. After you apply the procedure to purge terminated agents, WFM purges all of the agent records with termination dates earlier than the selected date from WFM database and then, sets the ACTIVE_FLAG to 0 to indicate that the record is now retained only in the WFM ETL database.
Frequently asked questions
The information in these FAQs might be useful when you are purging the database:
Q: Can you suppress or deactivate the data production for the TIMESTEP tables?
A: No, only the complete subsystem (Perf, Sch, Adh) can be disabled.
Q: When the DaysBack option is set to a value of 30, can you purge the TIMESTEP tables to a retention time lower than 30 days—using an extreme example, TRUNCATE TABLE every night? In this case, would ETL try to recreate the last 30 days of data?
A: Yes, you can purge TIMESTEP tables to a retention time lower than the one specified for DAY tables. No, ETL would not try to recreate those tables unless there was a change in the main WFM database for those days and data was synchronized back to ETL. When data is synchronized for some date(s), both TIMESTEP and DAY tables are synchronized simultaneously.
Q: Is Genesys planning to develop a feature, now or in future versions, that would improve the handling of the huge TIMESTEP tables or provide a way to deactivate them?
A: Currently, nothing is planned, but we might consider a feature of disabling TIMESTEP tables. Please submit a feature request.
Q: What is the best way to start purging the TIMESTEP tables?
A: Depending on the scenario, you might want to schedule a task that would call a main purging procedure at regular intervals. For example, using these parameters: WFM_PURGE_PROC (730, 0, 100000)—where the values in brackets represent the @DAYS_BACK_FOR_DAY, @DAYS_BACK_FOR_TIMESTEP, and @MAX_PURGE_CHUNK tables, consecutively.