DESCRIPTION:
There are a number of scenarios in which it is desirable to automate the adding of a statistics instance i.e. configure a project to collect statistics. For example, as part of a delivery mechanism, it may be necessary to activate statistics following duplication.
Assuming that the statistics tables have already been created in the database, the following outline scripts are required:
The instance must be created as a standard database instance using CREATE_DBINSTANCE_OUTLINE.otl. This instance can then be implicitly converted into a statistics instance using ALTER_STATISTICS_OUTLINE.otl. If all the projects are logging into a single Statistics database (single instance session logging), then the step to create a new database instance can be skipped and the existing Statistics database instance can be used.
If collection of Statistics need to be started immediately, Administrators should also reload the project. The 'Unload_Project_Outline' and 'Load_Project_Outline' can be used on Command Manager to achieve this. Example scripts have been provided below for the above steps.
EXAMPLE:
CREATE DBINSTANCE "Statistics" DBCONNTYPE
"Microsoft SQL Server 2000" DBCONNECTION "Data" DESCRIPTION
"Production database" HIGHTHREADS 10 MEDIUMTHREADS 5
LOWTHREADS 7;
ALTER STATISTICS DBINSTANCE "Tutorial Data" ENABLED USERSESSIONS TRUE PROJECTSESSIONS TRUE BASICDOCJOBS TRUE BASICREPJOBS TRUE CACHES TRUE SCHEDULES TRUE DETAILEDREPJOBS TRUE JOBSQL TRUE IN PROJECT "Strategy Tutorial";