Schedule Database Cleanup and re-indexing on Accounts Production Advanced
If you are a DVO user then you will not be able to run scripts against your database, contact the Support team where a member of the DVO team can run the script against your database.
To be able to do this you will need to be running SQL Server Standard (or Enterprise Edition) on your system (as this requires the SQL Server Agent) and have downloaded and installed SQL Server Management Studio (SSMS).
Database Cleanup
- Open and sign in to SSMS using the SA account
- On the left-hand side of the screen (at the bottom of the list), right click on SQL Server Agent and selectNew, thenJob.
- Enter aNamefor the database clean (for example,DAPA-Maintenance).
- Under the Select a page heading, selectSteps.
- SelectNew.
- EnterCleanupin theStep namefield.
- Download our Database Cleanup text file containing SQL script.
- SelectTransact-SQL-script (T-SQL)from theTypedropdown list.
- SelectAccountsProductionfrom theDatabasedropdown list.
- Paste the contents of the Database Cleanup text file into theCommandbox.
- Under theSelect a pageheading, selectAdvanced.
- SelectGo to the next stepfrom theOn success actiondropdown list.
- SelectGo to the next stepfrom theOn failure actiondropdown list.
- SelectOK.
Re-index
- Open and sign in to SSMS using the SA account
- Select theNewbutton to open a new Job Step Properties window.
- EnterRe-Indexas the stepName.
- SelectTransact-SQL-script (T-SQL)from theTypedropdown list.
- SelectAccountsProductionfrom theDatabasedropdown list.
- Download our Database Re-index text file containing SQL script.
- Paste the contents of the Database Re-index text file into theCommandbox.
- Under the Select a page heading, selectAdvanced.
- SelectQuit the job reporting successfrom theOn success actiondropdown list.
- SelectQuit the job reporting failurefrom theOn failure actiondropdown list.
- SelectOK.
- SelectSchedules.
- SelectNewto open the New Job Schedule window.
- Enter a Name, (for example,DAPA Weekly).
- Set the schedules as per your requirements. We recommend you run this at weekends when the software is not in use. Co-ordinate to run at a different time to your backups.
- SelectOKto save the changes and close the window
- Select theNotificationstab
- If you have email set up in SSMS (Go toManagement, thenDatabase Mail) then you can also configure email reporting alerts on job successes or failures.
- SelectOKto close and save the changes.
Under
Jobs
you should see DAPA-Maintenance
listed, which will start accoring to the timings you set in the Schedule. note
We recommend that you do not run it during the day becaue it will put a heavy load onto the SQL Server.
The re-index (Step 2) can also be used on the other Digita databases to optimise those. You can create additional steps to optimise these. The re-index stage requires users to be out of the database that is being re-indexed.