Professional Documents
Culture Documents
11, 2015
This document outlines how to create a new schema, upgrade an existing schema to the current
version, downgrade a schema to a particular version, and set-up the SQL Agent job for an
MSPD2 database.
All the scripts mentioned in this document can be located in the MineSight/scripts/sql/MSPD2
folder.
_____________________________
1. In SQL Server Management Studio, connect to the SQL Server instance that you wish to create
5. Change other parameters as you wish (e.g. the database files' parameters such as the file paths).
8. If you wish to set up the SQL Agent job, please refer to the section "Setting-up the SQL Agent
job" below.
____________________________
1. In SQL Server Management Studio, connect to the SQL Server instance that contains the MSPD2
database.
2. Depending on the current version and the version that you want to upgrade the MSPD2
database to,
3. If you wish to set up the SQL Agent job on your upgraded database, please refer to the section
Example:
1) atlas_change_script_1_0_to_1_1.sql
2) atlas_change_script_1_1_to_1_2.sql
______________________________
1. In SQL Server Management Studio, connect to the SQL Server instance that contains the MSPD2
database.
2. Depending on the current version and the version that you want to downgrade the MSPD2
database to,
Example:
1) atlas_change_script_1_3_to_1_2.sql
2) atlas_change_script_1_2_to_1_1.sql
Setting-up the SQL Agent job
____________________________
The following outlines how to set-up the SQL Server Agent and the job required to delete plans.
This only applies to SQL Server Standard and Enterprise editions. SQL Server Agent does not
run on the Express edition. The SQL Server Agent service must be running to execute the job.
1. Click START on your computer and in the search bar type "Component Services"
2. From the list that shows up on top, choose "Component Services" and click on it.
5. Using Windows' Services console, look for the SQL Server Agent service. If there is more
than one, select the one with the instance name that matches the instance where the MSPD2
database resides.
6. Right-click on this service and select Properties. Ensure that the Startup type is Automatic.
7. If the service is currently stopped, click on the Start button to start the service.
1. In SQL Server Management Studio, connect to the SQL Server instance that contains the MSPD2
database.
Notes:
b. The instructions are contained in the script and requires the name of the MSPD2 database as
c. This script will have to be executed by an administrator or a user with privileges to create
SQL Server Agent jobs.
d. By default, the job is scheduled to run every hour at the top of the hour. This schedule can
1. In the Object Explorer, the last option in the tree is SQL Server Agent. Expand this tree.
2. Find a job called "MSPlanner - Delete Plans Marked for Deletion". This is the job that is
4. Under the General page, ensure that the Enabled box is checked.
5. Under the Schedules page, ensure that at least one of the schedules has Enabled set to Yes.
6. Under the Steps page, there should be one step called sp_delete_all_plan. Select this step
and click on Edit. Ensure that the database identified on the General page is the correct MSPD2
database.
At this point, the job is set up and ready to go. Plan saves should no longer delete old versions of
the plan but will instead mark them for deletion and leave them for the job to actually delete.