SQL Overview Part 6 

This package collects rows from the system table 
SYSPROCESSES repeatedly throughout the day. It's principal
purpose is to identify processes that are causing BLOCKS. 
It can also be used to check for some long running Jobs/SQL
and verify the SQL Agent is executing on each server. 


The instructions in this file are lengthy to provide 
enough detail so you can easily setup this package. It 
assumes you already setup the previous version of the 
SQL Overview database, package, and jobs. See the 
article SQL Overview Part V if you have not set this up.

Update: 02/27/10 Added a block reported through the day and fixed 
an issue with missing JobName in Block Reports 


Installation Steps

1) Execute a-Add_Columns_to_SSIS_ServerList.sql
   By default all servers in this table will be processed
   by this new package. To skip a server, set the new columns 
   to True. 
   Sample Update to set all servers to be skipped
     UPDATE [SQL_Overview].[dbo].[SSIS_ServerList]
        SET [Skip_SQL_Processes] = 'True'
           ,[Skip_SQLAgent_Check] = 'True'
   Remember to leave at least one server not to be skipped.


2) Execute b-Add_NewTables.sql

3) Verify the following tables were created
    dbo.SQL_Sysprocesses
    dbo.SSIS_Errors_Sysprocesses
    rep.SQL_Overview_Last_Run_Date_Sysprocesses
    rep.Sysprocesses_Blocked


4) Add new Package "SQL_Sysprocesses.dtsx" to the SQL_Overview Solution
4a) Use "SQL Server Business Intelligence Development Studio" (BIDS)
    to open your SQL Overview solution
4b) Change Package Location > File System
4c) View Solution Explorer
4d) Right click on SSIS Packages > select Add Existing Package
4e) Browse to the location of SQL_Sysprocesses.dtsx and select it
4f) If the name changes to SQL_Sysprocesses (1).dtsx, change it back
4g) Fix any errors or warnings
        Tip: For a quick list of all errors/warnings use View > Error List
	
5) Test Package 
5a) Test your connections. The default is LOCALHOST
5b) Execute package in BIDS editor/debugger.
5c) Review tables 
   Browse table dbo.SQL_Sysprocesses
   Browse table dbo.SSIS_Errors_Sysprocesses

6) Create five new reports
6a) Edit c-Job_NewReports.sql
6b) Change E:\Output\Job\ to your job output text file location. 5 changes
6c) Change ??@Domain.com to your teams email address. 5 changes
6d) Execute c-Job_NewReports.sql


7) Test new SQL Agent Report Jobs
7a) Start "DBA-SQL Overview - Report Blocked Sysprocesses Summary"
7b) Start "DBA-SQL Overview - Report Long Running Executing Jobs-Sysprocesses"
7c) Start "DBA-SQL Overview - Report SQLAgent Stopped"
7d) Start "DBA-SQL Overview - Report Table Refresh Errors-Sysprocesses"
7e) Start "DBA-SQL Overview - Report Blocked Sysprocesses New Blocks"


8) Create SQL Agent Job "DBA-SQL Overview - Sysprocesses" used to execute Package
8a) Edit file "d-Job_DBA-SQL Overview - Sysprocesses.sql"
8b) Change E:\Output\Job\ to your job output text file location. 
8c) Execute "d-Job_DBA-SQL Overview - Sysprocesses.sql"
8c) Use SQL Agent and edit job "DBA-SQL Overview - Sysprocesses"
8d) Change location of the SYSPROCESS package to the correct location.
    It is easier to do it on the server where the Job is started
8e) If you want to run the JobActivity package right after this package (See SQL Overview V for details)
       Disable the job schedule for "DBA-SQL Overview - JobActivity - Only"
    else 
       Delete step "Step 4 - Start SQL Agent Collection"
8f) Test Job
8g) Enable Job schedule and set the appropiate runtime


9) Add start job commands for the new reports to SQL Agent Job "DBA-SQL Overview" adding the new reports.
9a) Edit Job "DBA-SQL Overview"
9a) Update the last job step advance setting to continue with next step 
9b) Add a new step to start each report. 
    I created separate steps for each job to help identify the cause of the problem.
9c) Here are the commands used to start each morning report job
     EXEC msdb.dbo.sp_start_job N'DBA-SQL Overview - Report Long Running Executing Jobs-Sysprocesses'
     EXEC msdb.dbo.sp_start_job N'DBA-SQL Overview - Report Blocked Sysprocesses Summary'
     EXEC msdb.dbo.sp_start_job N'DBA-SQL Overview - Report SQLAgent Stopped'
     EXEC msdb.dbo.sp_start_job N'DBA-SQL Overview - Report Table Refresh Errors-Sysprocesses'
9d) Test report Job steps 



*** If you rather not update the Job "DBA-SQL Overview", by adding all the steps.  
*** I have included a script to create it. It might save you some steps in setting it up.
10a) Rename the current SQL Agent Job "DBA-SQL Overview" to "DBA-SQL Overview-old". Then disable it.
10b) Edit z-Job_DBA-SQL Overview.sql  
10c) Change E:\Output\Job\ to your job output text file location. 2 changes
10d) Execute SQL
10e) Using SQL Agent edit the job and change location of SSIS Package
10f) Test Job


  
