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

  1. Open and sign in to SSMS using the SA account
  2. On the left-hand side of the screen (at the bottom of the list), right click on SQL Server Agent and select
    New
    , then
    Job.
  3. Enter a
    Name
    for the database clean (for example,
    DAPA-Maintenance
    ).
  4. Under the Select a page heading, select
    Steps
    .
  5. Select
    New
    .
  6. Enter
    Cleanup
    in the
    Step name
    field.
  7. Download our Database Cleanup text file containing SQL script.
  8. Select
    Transact-SQL-script (T-SQL)
    from the
    Type
    dropdown list.
  9. Select
    AccountsProduction
    from the
    Database
    dropdown list.
  10. Paste the contents of the Database Cleanup text file into the
    Command
    box.
  11. Under the
    Select a page
    heading, select
    Advanced
    .
  12. Select
    Go to the next step
    from the
    On success action
    dropdown list.
  13. Select
    Go to the next step
    from the
    On failure action
    dropdown list.
  14. Select
    OK
    .

Re-index

  1. Open and sign in to SSMS using the SA account
  2. Select the
    New
    button to open a new Job Step Properties window.
  3. Enter
    Re-Index
    as the step
    Name
    .
  4. Select
    Transact-SQL-script (T-SQL)
    from the
    Type
    dropdown list.
  5. Select
    AccountsProduction
    from the
    Database
    dropdown list.
  6. Download our Database Re-index text file containing SQL script.
  7. Paste the contents of the Database Re-index text file into the
    Command
    box.
  8. Under the Select a page heading, select
    Advanced
    .
  9. Select
    Quit the job reporting success
    from the
    On success action
    dropdown list.
  10. Select
    Quit the job reporting failure
    from the
    On failure action
    dropdown list.
  11. Select
    OK
    .
  12. Select
    Schedules
    .
  13. Select
    New
    to open the New Job Schedule window.
  14. Enter a Name, (for example,
    DAPA Weekly).
  15. 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.
  16. Select
    OK
    to save the changes and close the window
  17. Select the
    Notifications
    tab
  18. If you have email set up in SSMS (Go to
    Management
    , then
    Database Mail
    ) then you can also configure email reporting alerts on job successes or failures.
  19. Select
    OK
    to 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.