About_Data_Warehouse_Jobs

Applies To: System Center 2012 R2 Service Manager

The Service Manager set of cmdlets includes the following cmdlets for managing Service Manager data warehouse jobs:

  • Set-SCDWJobSchedule: Sets the schedule for a data warehouse job.

  • Start-SCDWJob: Starts a data warehouse job.

  • Enable-SCDWJobSchedule: Enables the schedule for a data warehouse job.

  • Enable-SCDWJob: Enables a previously disabled data warehouse job.

  • Stop-SCDWJob: Stops a data warehouse job that is currently running.

  • Disable-SCDWJob: Disables future runs of a data warehouse job.

  • Disable-SCDWJobSchedule: Disables the schedule for a data warehouse job.

  • Get-SCDWJobSchedule: Retrieves the schedule for a data warehouse job.

  • Get-SCDWJob: Retrieves status for a data warehouse job.

  • Get-SCDWJobModule: Retrieves detailed information about a data warehouse job.

About Data Warehouse Jobs

A Service Manager data warehouse job is a logical collection of related job modules that run together to perform a specific task that is related to the data warehouse. For example, the Extract job retrieves new or changed data from a source.

Job Module

A job module is a single unit of work within a job. For example, the Extract job contains a job module that extracts data from a single, specific table in the database. The other job modules in the Extract job are similar, but each job module is extracting data from a different table. Job modules within a job can have dependencies on each other, for example, one job module does not start to run until another job module has finished.

Controlling Job Runs

You can use several methods to start, stop, and intervene in job runs. Each method behaves differently as described below:

  • Use automatic job schedule: You can define a recurring job schedule. A job schedule is a rule which defines the frequency in which the data warehouse automatically starts a job. For example, the default schedule for an Extract job is to run every 5 minutes. Using an automatic job schedule, you can control the frequency and the start and stop time of a job.

  • Manually enable or disable the job: You can manually enable or disable a job run to control future job runs.

  • Manually start or stop the job: You can manually stop or start a job run to control a job that is currently running.

For example, if you use the Stop-SCDWJob cmdlet to stop the Extract job, which runs every 5 minutes, it stops the job for only 5 minutes because the job starts again in 5 minutes. Therefore, if you have to stop the process for a longer period of time, use the Disable-SCDWJobSchedule cmdlet, with which the job can finish and not start until you use the Enable-SCDWJobSchedule cmdlet when you are ready.

Using the Data Warehouse Job Cmdlets

The following sections describe the different methods for running and stopping data warehouse jobs.

Automatic Job Schedule

If you defined a schedule for the job by using the Set-SCDWJobSchedule cmdlet, you can enable the schedule by using the Enable-SCDWJobSchedule cmdlet, which causes the job to run on the specified recurring schedule. Or, you can prevent the job from running on its specified schedule by using the Disable-SCDWJobSchedule cmdlet.

When you disable a job schedule, the data warehouse stops the automatic initiations of job runs. Disabling the job schedule does not stop a job that is currently running, and it does not prevent you from manually running the job by using the Start-SCDWJob –JobName cmdlet.

Starting and Stopping a Job

You can manually start a job or stop a job that is currently running. When you use the Stop-SCDWJob cmdlet, the job module that is currently running finishes, the remaining job modules do not start, and so the job stops. For example, the Extract job contains a few hundred job modules. If you stop the job while it is running, the currently running module finishes, and then the job stops. Later, if you use the Start-SCDWJob cmdlet, the job continues by running the job module that was scheduled to run when you stopped it. The Stop-SCDWJob cmdlet does not interfere with the recurring schedule of the job, if there is a recurring schedule.

Enabling and Disabling a Job

You can manually disable or enable a job to control future job runs. When you use the Disable-SCDWJob cmdlet, it prevents the job from being started either by the automatic job schedule or manually by the Start-SCDWJob cmdlet. When you disable a job, the job completes its current run if it is running, and the specified schedule of the job is preserved, if it exists.

You can use the Enable-SCDWJob cmdlet to enable a disabled job. This restores the automatic schedule functionality and allows you to manually run the job.