ConfigurationSana Commerce SQL Jobs

Sana Commerce SQL Jobs

Configure Sana Commerce SQL Jobs

To keep the Sana Commerce clean and fast, a SQL job should be created which will clean up unused baskets older than one day from the Sana Commerce SQL database. 
 
The SQL Server 2005 Express does not contain a SQL Server Agent service, so that job scheduling is not possible. There is a solution to realize scheduling without using free or commercial 3rd party products. This solution is only based on the Express version of the SQL Server and uses the SQL Server Service Broker. Please read this article for more information.
  • Open the SQL Management Studio and connect to the SQL server instance to use and expand the 'SQL Server Agent'.
  • Click right on the jobs folder and select a 'New job'. The 'New job' window appears:

     
    Creating a New SQL Job 

  • Enter an appropriate name for the SQL job on the general tab and choose an owner who has the rights to access the Sana Commerce SQL database.
  • Open the 'Steps' tab and click the 'New' button at the bottom of the window to create a new step.
  • Enter 'Cleanup baskets' as name for the step and keep the type as 'Transact-SQL script'. Then select the Sana Commerce SQL database in the database dropdown and enter 'EXEC dbo.CleanupBaskets' as command: 
  • Click 'OK' to save the job step.

     
    Creating a Job Step 

  • Open the 'Schedules' tab and click the 'New' button at the bottom of the window.
  • Enter 'Clean up baskets' as name, select 'Recurring' as schedule type and specify the frequency of performing the job: 

     
    Setting Job Schedule 

  • Click 'OK' to save the job schedule.
  • Click 'OK' in the 'Job' properties window to save the entire job.
ConfigurationSana Commerce SQL Jobs