The Optimizely <<product-name>> database contains a Nightly Maintenance stored procedure which cleans up abandoned shopping cart records, maintains the application log, and removes obsolete scheduled task records. The Nightly Maintenance stored procedure should be scheduled to run each night during non-peak hours. This can be accomplished within your SQL server or by creating a Nightly Maintenance Scheduled Task within the <<product-name>> Admin Console. There are four finger tabs related to the creation of an Integration Job: **Details**, **Steps**, **Parameters**, and **History**.
Go to **Admin Console** \> **Administration** \> **Jobs** \> **Job Definitions** \> **Details** finger tab.
## Details finger tab
Click **Add Job Definition**.
Populate the following fields as shown:
Field Name Field Properties Job Name Something akin to "Nightly Maintenance Job" Job Type Execution Connection\* Internal Preprocessor None Integration Processor None Post Processor ExecuteStoredProcedure
\*The **Connection** is defined by the Connection created in the **Connections** page: **Admin Console** \> **Administration** \> **Jobs** \> **Connections**. It is here that type of connection is defined:
Scroll down to the **Notifications **section, populate the following fields
Scroll down to the Run Options section, populate the following fields:
Scroll down to the Recurrence section, populate the following fields:
## Steps finger tab
Nothing required within the **Steps** finger tab.
## Parameters finger tab
Go to the **Parameters** finger tab.
Click **Add Job Definition Parameter**.
For **Stored Procedure**, enter the name "**NightlyMaintenance**" as the **default value**. This directly correlates to the name of the stored procedure that is deployed with the platform.
Select the **Value Type** of **String**.
Enter the **Default Value.**
Enter the **Prompt** as the Stored Procedure Name.
Click **Save** and then click **Back** or using the breadcrumb trail, click **Nightly Maintenance Job**.
The newly created parameter should be displayed within the **Parameters** finger tab list.
## History finger tab
The **History** finger tab provides a list of previously run jobs and their respective metadata.
## Manually running the job
To manually start the job, click **More Options** and select **Schedule Job**.
From this window, choose **Date/Time.**
Using the **Yes/No** toggle, decide if it should run as a **Real Time Job** or not.
Click **Schedule Job**.