SQL Server Performance Base Line Script part2



/*
SQL Server datafile read write stats in the min
*/


/*
SQL Server Databfiles Read/Write Stall and Average Read/Write Information
*/
print N'<H3>SQL Server Databases Datafiles Writes/Reads</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Database Name</strong></th>'+
'<th><strong>Physical File Name</strong></th>'+
'<th><strong>File Types</strong></th>'+
'<th><strong>File Size in MB</strong></th>'+
'<th><strong>Total Reads in MB</strong></th>'+
'<th><strong>Total Writes in MB</strong></th>'+
'<th><strong>Number of Reads</strong></th>'+
'<th><strong>Number of Writes</strong></th>'+
'<th><strong>IO Stall Write in Minute</strong></th>'+
N'<th><strong>IO Stall Read in Minute</strong></th></tr>'
declare cur_iom_info cursor local for
SELECT sys.master_files.name as DatabaseName,
sys.master_files.physical_name,
CASE WHEN sys.master_files.type_desc = 'ROWS' THEN 'Data Files'
WHEN sys.master_files.type_desc = 'LOG' THEN 'Log Files'
END as 'File Type',
((FileStats.size_on_disk_bytes/1024)/1024)/ 1024.0 as FileSize_GB,
(FileStats.num_of_bytes_read /1024)/1024.0 as MB_Read,
(FileStats.num_of_bytes_written /1024)/1024.0 as MB_Written,
FileStats.Num_of_reads, FileStats.Num_of_writes,
((FileStats.io_stall_write_ms /1000.0)/60) as
Minutes_of_IO_Write_Stalls,
((FileStats.io_stall_read_ms /1000.0)/60) as
Minutes_of_IO_Read_Stalls
FROM sys.dm_io_virtual_file_stats(null,null) as FileStats
JOIN sys.master_files ON
FileStats.database_id = sys.master_files.database_id
AND FileStats.file_id = sys.master_files.file_id

open cur_iom_info
fetch from cur_iom_info into
@fileio_dbname,
@fileio_filename,
@fileio_filetype,
@fileio_filesizegb,
@fileio_mbread ,
@fileio_mbwrite,
@fileio_noofread,
@fileio_noofwrite,
@fileio_miniowritestall ,
@fileio_minioreadstall

while @@fetch_status>=0
begin

print '<tr><td>'+cast(@fileio_dbname as varchar(500))+
 '</td><td>'+cast(@fileio_filename as varchar(5000))+
 '</td><td>'+cast(@fileio_filetype as varchar(500))+
 '</td><td>'+cast(@fileio_filesizegb as varchar(500))+
 '</td><td>'+cast(@fileio_mbread as varchar(150))+
 '</td><td>'+cast(@fileio_mbwrite as varchar(150))+
 '</td><td>'+cast(@fileio_noofread as varchar(150))+
 '</td><td>'+cast(@fileio_noofwrite as varchar(150))+
 '</td><td>'+cast(@fileio_miniowritestall as varchar(150))+
 '</td><td>'+cast(@fileio_minioreadstall as varchar(150))+'</td>'+'</tr>'
fetch from cur_iom_info into
@fileio_dbname,
@fileio_filename,
@fileio_filetype,
@fileio_filesizegb,
@fileio_mbread ,
@fileio_mbwrite,
@fileio_noofread,
@fileio_noofwrite,
@fileio_miniowritestall ,
@fileio_minioreadstall
end

close cur_iom_info
deallocate cur_iom_info
print'</table><br/>'

print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Database Name</strong></th>'+
'<th><strong>Physical File Name</strong></th>'+
'<th><strong>IO stall READ in MS</strong></th>'+
'<th><strong>IO Num of READ</strong></th>'+
'<th><strong>IO Avg READ Stall in MS </strong></th>'+
'<th><strong>IO stall WRITE in MS</strong></th>'+
'<th><strong>IO Num of WRITE</strong></th>'+
'<th><strong>IO Avg WRITE Stall in MS</strong></th>'+
'<th><strong>IO Stalls in MS(Io stall read_MS+Io stall write_MS)</strong></th>'+
'<th><strong>Total IO(Total Read+Total Write)</strong></th>'+
N'<th><strong>IO Avg IO Stall</strong></th></tr>'


declare cur_db_io_readwrite cursor local for SELECT DB_NAME(fs.database_id) AS [Database Name], mf.physical_name, io_stall_read_ms, num_of_reads,
CAST(io_stall_read_ms/(1.0 + num_of_reads) AS NUMERIC(10,1)) AS [avg_read_stall_ms],io_stall_write_ms,
num_of_writes,CAST(io_stall_write_ms/(1.0+num_of_writes) AS NUMERIC(10,1)) AS [avg_write_stall_ms],
io_stall_read_ms + io_stall_write_ms AS [io_stalls], num_of_reads + num_of_writes AS [total_io],
CAST((io_stall_read_ms + io_stall_write_ms)/(1.0 + num_of_reads + num_of_writes) AS NUMERIC(10,1))
AS [avg_io_stall_ms]
FROM sys.dm_io_virtual_file_stats(null,null) AS fs
INNER JOIN sys.master_files AS mf
ON fs.database_id = mf.database_id
AND fs.[file_id] = mf.[file_id]
ORDER BY avg_io_stall_ms DESC ;

open cur_db_io_readwrite
fetch from cur_db_io_readwrite into
@IO_DBName,
@IO_PhyName,
@io_stall_read_ms,
@io_num_of_reads,
@io_avg_read_stall_ms,
@io_stall_write_ms,
@io_num_of_writes,
@io_avg_write_stall_ms,
@io_stalls,
@io_total,
@avg_io_stall_ms
while @@fetch_status>=0
begin

print '<tr><td>'+cast(@IO_DBName as varchar(500))+
 '</td><td>'+cast(@IO_PhyName as varchar(5000))+
 '</td><td>'+cast(@io_stall_read_ms as varchar(50))+
 '</td><td>'+cast(@io_num_of_reads as varchar(50))+
 '</td><td>'+cast(@io_avg_read_stall_ms as varchar(50))+
 '</td><td>'+cast(@io_stall_write_ms as varchar(50))+
 '</td><td>'+cast(@io_num_of_writes as varchar(50))+
 '</td><td>'+cast(@io_avg_write_stall_ms as varchar(50))+
 '</td><td>'+cast(@io_stalls as varchar(50))+
 '</td><td>'+cast(@io_total as varchar(50))+
 '</td><td>'+cast(@avg_io_stall_ms as varchar(50))+'</td>'+'</tr>'

fetch from cur_db_io_readwrite into
@IO_DBName,
@IO_PhyName,
@io_stall_read_ms,
@io_num_of_reads,
@io_avg_read_stall_ms,
@io_stall_write_ms,
@io_num_of_writes,
@io_avg_write_stall_ms,
@io_stalls,
@io_total,
@avg_io_stall_ms

end

close cur_db_io_readwrite
deallocate cur_db_io_readwrite
print'</table><br/>'
print'<table >
<tr>
<td><span ><strong>SQL Server Databases Datafiles
Writes/Reads:-</strong></span><br>-- This above table will give you
detail about the Database DataFiles read/write operation information
along with Read Stall and Write Stall.<br>--  Helps you determine
which database files on the entire instance have the most I/O
bottlenecks.<br>-- This can help you decide whether certain LUNs are
overloaded and whether you might.<br>-- With help of this you can plan
to move some of very busy files to some another less busy locations.</td>
</tr>
</table>'

/*
SQL Server database wise CPU Utilization Query
*/

print N'<H3>SQL Server Databases Wise CPU Utilization</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Row Count</strong></th>'+
'<th><strong>Database Name</strong></th>'+
'<th><strong>CPU Time in MS</strong></th>'+
N'<th><strong>CPU Usage in(%)</strong></th></tr>'


declare cur_db_cpuusage cursor local for
WITH DB_CPU_Stats
AS
(SELECT DatabaseID, DB_Name(DatabaseID) AS [DatabaseName], SUM(total_worker_time) AS [CPU_Time_Ms]
 FROM sys.dm_exec_query_stats AS qs
 CROSS APPLY (SELECT CONVERT(int, value) AS [DatabaseID]
              FROM sys.dm_exec_plan_attributes(qs.plan_handle)
              WHERE attribute = N'dbid') AS F_DB
 GROUP BY DatabaseID)
SELECT ROW_NUMBER() OVER(ORDER BY [CPU_Time_Ms] DESC) AS [row_num],
       DatabaseName, [CPU_Time_Ms],
       CAST([CPU_Time_Ms] * 1.0 / SUM([CPU_Time_Ms]) OVER() * 100.0 AS DECIMAL(5, 2)) AS [CPUPercent]
FROM DB_CPU_Stats
WHERE DatabaseID > 4 -- system databases
AND DatabaseID <> 32767 -- ResourceDB
ORDER BY row_num;

open cur_db_cpuusage

fetch cur_db_cpuusage into
@row_cnt,
@Db_name,
@Db_cpu_time_ms,
@db_cpu_per

while @@fetch_status>=0
begin
print '<tr><td>'+cast(@row_cnt as varchar(50))+'</td><td>'+cast(@Db_name as varchar(500))+'</td><td>'+cast(@Db_cpu_time_ms as varchar(500))+'</td><td>'+cast(@db_cpu_per as varchar(500))+'</td>'+'</tr>'
fetch cur_db_cpuusage into
@row_cnt,
@Db_name,
@Db_cpu_time_ms,
@db_cpu_per

end
close cur_db_cpuusage
deallocate cur_db_cpuusage
print'</table><br/>'

print '<table >
<tr>
<td><span ><strong>SQL Server Databases Wise CPU
Utilization:-</strong></span><br>-- This above table helps you to
determine which database is using most of CPU.<br>-- With the help of
above table we can tune the database to reduce consumption of CPU(
Statistics Update,Weekly Indxe Rebuild)<br>-- If fesible tune most
expensive query by CPU utilization.</td>
</tr>
</table>'

/*
SQL Server databases Cache Size Information in the bpool Query.
*/

print N'<H3>SQL Server Databases Cache Size Information in Buffer Pool</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Database Name</strong></th>'+
N'<th><strong>Cache Size in (MB)</strong></th></tr>'

declare cur_db_cacheinfo cursor local for
SELECT DB_NAME(database_id) AS [Database Name],
COUNT(*) * 8/1024.0 AS [Cached Size (MB)]
FROM sys.dm_os_buffer_descriptors
WHERE database_id > 4 -- system databases
AND database_id <> 32767 -- ResourceDB
GROUP BY DB_NAME(database_id)
ORDER BY [Cached Size (MB)] DESC;

open cur_db_cacheinfo
 fetch from cur_db_cacheinfo into
 @dbcache_Dbname,
 @dbcache_dbcachesizeMB
 while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@dbcache_Dbname as varchar(500))+'</td><td>'+cast(@dbcache_dbcachesizeMB as varchar(500))+'</td>'+'</tr>'
fetch from cur_db_cacheinfo into
 @dbcache_Dbname,
 @dbcache_dbcachesizeMB
 end

 close cur_db_cacheinfo
 deallocate cur_db_cacheinfo

print'</table><br/>'
print '<table >
<tr>
<td><strong><span >SQL Server Databases Cache Size
Information in Buffer Pool:-</span><br ></strong>
--This above table tells you total buffer usage by the databases.<br>
--It also tells you how much memory in the buffer pool is being used by
each database on the instance.</td>
</tr>
</table>'


/*
SQL Server Instance Over all Wait Type information Query
*/

print N'<H3>SQL Server Instance Wait Type Information</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>WAIT Type Names</strong></th>'+
'<th><strong>WAIT Time in (S)</strong></th>'+
'<th><strong>Resource Time in (S)</strong></th>'+
'<th><strong>Signal Time (S)</strong></th>'+
'<th><strong>Wait Counts</strong></th>'+
'<th><strong>WAIT Perc(%)</strong></th>'+
N'<th><strong>Running in (%)</strong></th></tr>'

declare cur_inst_waitinfo cursor local for
WITH Waits AS
(SELECT
wait_type,
wait_time_ms / 1000 AS waits,
(wait_time_ms-signal_wait_time_ms)/1000 as Resoruce_Wait_Time_S,
signal_wait_time_ms /1000.0 as signals_wait_time_s,
waiting_tasks_count as WaitCount,
100. * wait_time_ms / SUM(wait_time_ms) OVER() AS Percentage,
ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS RowNumber
FROM sys.dm_os_wait_stats
WHERE wait_type NOT IN ('CLR_SEMAPHORE','LAZYWRITER_SLEEP','RESOURCE_QUEUE','SLEEP_TASK'
,'SLEEP_SYSTEMTASK','SQLTRACE_BUFFER_FLUSH','WAITFOR', 'LOGMGR_QUEUE','CHECKPOINT_QUEUE'
,'REQUEST_FOR_DEADLOCK_SEARCH','XE_TIMER_EVENT','BROKER_TO_FLUSH','BROKER_TASK_STOP','CLR_MANUAL_EVENT'
,'CLR_AUTO_EVENT','DISPATCHER_QUEUE_SEMAPHORE', 'FT_IFTS_SCHEDULER_IDLE_WAIT'
,'XE_DISPATCHER_WAIT', 'XE_DISPATCHER_JOIN', 'SQLTRACE_INCREMENTAL_FLUSH_SLEEP'))
SELECT
W1.wait_type as WaitType,
CAST(W1.waits AS DECIMAL(12, 2)) AS wait_S,
CAST(W1.Resoruce_Wait_Time_S as decimal(12,2)) as Resource_S,
CAST(W1.signals_wait_time_s as decimal(12,2)) as Signal_S,
CAST(W1.WaitCount as varchar(20)) as WaitCounts,
CAST(W1.Percentage AS DECIMAL(12, 2)) AS Percentage_wait,
CAST(SUM(W2.Percentage) AS DECIMAL(12, 2)) AS running_Percentage
FROM Waits AS W1
INNER JOIN Waits AS W2
ON W2.RowNumber <= W1.RowNumber
GROUP BY
W1.RowNumber,
W1.wait_type,
W1.waits,
W1.Percentage,
W1.Resoruce_Wait_Time_S,
W1.signals_wait_time_s,
W1.WaitCount
HAVING SUM(W2.Percentage) - W1.Percentage < 99;

open cur_inst_waitinfo
fetch cur_inst_waitinfo into
   @waitType_WaitTypeName,
@WaitType_waittime_s,
@WaitType_resource_s,
@WaitType_Signal_s,
@WaitType_counts,
@WaitType_WaitingPct,
@WaitType_RunningPct

while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@waitType_WaitTypeName as varchar(500))+
'</td><td>'+cast(@WaitType_waittime_s as varchar(500))+
'</td><td>'+cast(@WaitType_resource_s as varchar(500))+
'</td><td>'+cast(@WaitType_Signal_s as varchar(500))+
'</td><td>'+cast(@WaitType_counts as varchar(500))+
'</td><td>'+cast(@WaitType_WaitingPct as varchar(500))+
'</td><td>'+cast(@WaitType_RunningPct as varchar(500))+'</td>'+'</tr>'
fetch cur_inst_waitinfo into
   @waitType_WaitTypeName,
@WaitType_waittime_s,
@WaitType_resource_s,
@WaitType_Signal_s,
@WaitType_counts,
@WaitType_WaitingPct,
@WaitType_RunningPct
end

close cur_inst_waitinfo
deallocate cur_inst_waitinfo

print'</table><br/>'
print '<table >
<tr>
<td><strong><span >SQL Server Instance Wait Type
Information:-</span><br ></strong>-- Common
Significant Wait types with BOL explanations<br><br>-- *** Network
Related Waits ***<br>-- ASYNC_NETWORK_IO Occurs on network writes when
the task is blocked behind the network<br><br>-- *** Locking Waits ***<br>
-- LCK_M_IX Occurs when a task is waiting to acquire an Intent Exclusive
(IX) lock<br>-- LCK_M_IU Occurs when a task is waiting to acquire an
Intent Update (IU) lock<br>-- LCK_M_S Occurs when a task is waiting to
acquire a Shared lock<br><br>-- *** I/O Related Waits ***<br>--
ASYNC_IO_COMPLETION Occurs when a task is waiting for I/Os to finish<br>
-- IO_COMPLETION Occurs while waiting for I/O operations to complete.
<br>-- This wait type generally represents non-data page I/Os. Data page
I/O completion waits appear <br>-- as PAGEIOLATCH_* waits<br>--
PAGEIOLATCH_SH Occurs when a task is waiting on a latch for a buffer
that is in an I/O request. <br>-- The latch request is in Shared mode.
Long waits may indicate problems with the disk subsystem.<br>--
PAGEIOLATCH_EX Occurs when a task is waiting on a latch for a buffer
that is in an I/O request. <br>-- The latch request is in Exclusive
mode. Long waits may indicate problems with the disk subsystem.<br>--
WRITELOG Occurs while waiting for a log flush to complete. <br>-- Common
operations that cause log flushes are checkpoints and transaction
commits.<br>-- PAGELATCH_EX Occurs when a task is waiting on a latch for
a buffer that is not in an I/O request. <br>-- The latch request is in
Exclusive mode.<br>-- BACKUPIO Occurs when a backup task is waiting for
data, or is waiting for a buffer in which to store data<br><br>-- ***
CPU Related Waits ***<br>-- SOS_SCHEDULER_YIELD Occurs when a task
voluntarily yields the scheduler for other tasks to execute. <br>--
During this wait the task is waiting for its quantum to be renewed.<br>
<br>-- THREADPOOL Occurs when a task is waiting for a worker to run on.
<br>-- This can indicate that the maximum worker setting is too low, or
that batch executions are taking <br>-- unusually long, thus reducing
the number of workers available to satisfy other batches.<br>--
CX_PACKET Occurs when trying to synchronize the query processor exchange
iterator <br>-- You may consider lowering the degree of parallelism if
contention on this wait type becomes a problem<br></td>
</tr>
</table>
<br/>'


/*
SQL Server Signal Wait Type Query
*/

print N'<H3>SQL Server Signal Wait in Percentage</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>%signal (cpu) waits</strong></th>'+
N'<th><strong>%resource waits</strong></th></tr>'

declare cur_sql_cpuwaitinfo cursor local for
SELECT CAST(100.0 * SUM(signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [%signal (cpu) waits],
       CAST(100.0 * SUM(wait_time_ms - signal_wait_time_ms) / SUM (wait_time_ms) AS NUMERIC(20,2)) AS [%resource waits]
FROM sys.dm_os_wait_stats ;

open cur_sql_cpuwaitinfo

fetch from cur_sql_cpuwaitinfo into
@cpuwait_signal_cpu_waits,
@cpuwait_resource_wait

while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@cpuwait_signal_cpu_waits as varchar(500))+'</td><td>'+cast(@cpuwait_resource_wait as varchar(500))+'</td>'+'</tr>'

fetch from cur_sql_cpuwaitinfo into
@cpuwait_signal_cpu_waits,
@cpuwait_resource_wait

end
close cur_sql_cpuwaitinfo
deallocate cur_sql_cpuwaitinfo

print'</table><br/>'
print '<table >
<tr>
<td><strong><span >SQL Server Signal Wait in (%):-</span><br >
</strong><br>-- Signal Waits above 10-15% is usually a sign of CPU
pressure</td>
</tr>
</table>
<br/>'

/*

SQL Server Login Count and Session Detail.
*/

print N'<H3>SQL Server Login and session count detail</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>SQL Login Name</strong></th>'+
N'<th><strong>SQL Session Counts</strong></th></tr>'

declare cur_session_countinfo cursor local for
SELECT login_name, COUNT(session_id) AS [session_count]
FROM sys.dm_exec_sessions
GROUP BY login_name
ORDER BY COUNT(session_id) DESC;

open cur_session_countinfo
fetch from cur_session_countinfo into
@logindet_LoginName,
@logindet_session_count
while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@logindet_LoginName as varchar(500))+'</td><td>'+cast(@logindet_session_count as varchar(500))+'</td>'+'</tr>'
fetch from cur_session_countinfo into
@logindet_LoginName,
@logindet_session_count
end
close cur_session_countinfo
deallocate cur_session_countinfo
print'</table><br/>'
print '<table >
<tr>
<td><strong><span >SQL Server Login and Session
Detail:-</span><br ></strong>-- Get logins that are
connected and how many sessions they have <br>-- This can help
characterize your workload and determine whether you are seeing a normal
level of activity.</td>
</tr>
</table>'


/*

SQL Server Average Task COunt
*/

print N'<H3>SQL Average Tasks count</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Avg Task Count</strong></th>'+
'<th><strong>Avg Runnable Task Count</strong></th>'+
N'<th><strong>Avg Pending IO Disk Count</strong></th></tr>'

declare cur_avgtask_count cursor local for
SELECT AVG(current_tasks_count) AS [Avg Task Count],
AVG(runnable_tasks_count) AS [Avg Runnable Task Count],
AVG(pending_disk_io_count) AS [AvgPendingDiskIOCount]
FROM sys.dm_os_schedulers
WHERE scheduler_id < 255;

open cur_avgtask_count
fetch from cur_avgtask_count into
@avg_task_count,
@avg_runnable_task_count,
@avg_diskpendingio_count
while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@avg_task_count as varchar(500))+'</td><td>'+cast(@avg_runnable_task_count as varchar(500))+'</td><td>'+cast(@avg_runnable_task_count as varchar(500))+'</td>'+'</tr>'
fetch from cur_avgtask_count into
@avg_task_count,
@avg_runnable_task_count,
@avg_diskpendingio_count
end
close cur_avgtask_count
deallocate cur_avgtask_count
print'</table><br/>'
print ' <table >
<tr>
<td>SQL Average Tasks Count:<br>-- Sustained values above 10 suggest
further investigation in that area.<br>-- High current_tasks_count is
often an indication of locking/blocking problems.<br>-- High
runnable_tasks_count is an indication of CPU pressure.<br>-- High
pending_disk_io_count is an indication of I/O pressure.</td>
</tr>
</table>
<br>'


/*

SQL Server and OS Cpu utilization for last 4 hours

*/
print N'<H3>SQL and OS CPU Utilization from SQL Ring Buffer</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>SQL Server Process CPU Util</strong></th>'+
'<th><strong>System IDLE Process CPU Util</strong></th>'+
'<th><strong>Other Process CPU Util</strong></th>'+
N'<th><strong>CPU Time Stamp</strong></th></tr>'

select  @ts_now= (SELECT cpu_ticks/(cpu_ticks/ms_ticks)FROM sys.dm_os_sys_info)
declare cur_sqlos_cpu_usage cursor local for



SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization],
               SystemIdle AS [System Idle Process],
               100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization],
               DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time]
FROM (
 SELECT record.value('(./Record/@id)[1]', 'int') AS record_id,
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int')
AS [SystemIdle],
record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]',
'int')
AS [SQLProcessUtilization], [timestamp]
 FROM (
SELECT [timestamp], CONVERT(xml, record) AS [record]
FROM sys.dm_os_ring_buffers
WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR'
AND record LIKE N'%<SystemHealth>%') AS x
 ) AS y
ORDER BY record_id DESC;

open cur_sqlos_cpu_usage

fetch  from cur_sqlos_cpu_usage into
@sqlproc_cpu_Sql_proc,
@sqlproc_cpu_sysidle,
@sqlproc_cpu_otheros_proc,
@sqlproc_cpu_event_time

while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@sqlproc_cpu_Sql_proc as varchar(500))+'</td><td>'+cast(@sqlproc_cpu_sysidle as varchar(500))+'</td><td>'+cast(@sqlproc_cpu_otheros_proc as varchar(500))+'</td><td>'+cast(@sqlproc_cpu_event_time as varchar(500))+'</td>'+'</tr>'
fetch  from cur_sqlos_cpu_usage into
@sqlproc_cpu_Sql_proc,
@sqlproc_cpu_sysidle,
@sqlproc_cpu_otheros_proc,
@sqlproc_cpu_event_time
end
close cur_sqlos_cpu_usage
deallocate cur_sqlos_cpu_usage
print'</table><br/>'
print '<table >
<tr>
<td><strong><span >SQL and OS CPU Utilization from
SQL Ring Buffer:-</span><br ><br></strong>-- Look at
the trend over the entire period. <br>-- Also look at high sustained
Other Process CPU Utilization values</td>
</tr>
</table>
<br/>'

/*
SQL Server memory utilization History via PLE
*/
print N'<H3>SQL Memory Utilization History</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Server Name</strong></th>'+
'<th><strong>Object Name</strong></th>'+
'<th><strong>Instance Name</strong></th>'+
N'<th><strong>Page Life Expectancy</strong></th></tr>'

declare cur_sql_mem_info cursor local for
SELECT @@SERVERNAME AS [Server Name], [object_name], instance_name, cntr_value AS [Page Life Expectancy]
FROM sys.dm_os_performance_counters
WHERE [object_name] LIKE N'%Buffer Node%' -- Handles named instances
AND counter_name = N'Page life expectancy';

open cur_sql_mem_info
fetch from cur_sql_mem_info into
@sqlmem_svr_name,
@sqlmem_obj_name,
@sqlmem_ins_name,
@sqlmem_Page_life_expe
while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@sqlmem_svr_name as varchar(500))+'</td><td>'+cast(@sqlmem_obj_name as varchar(500))+'</td><td>'+cast(@sqlmem_ins_name as varchar(500))+'</td><td>'+cast(@sqlmem_Page_life_expe as varchar(500))+'</td>'+'</tr>'
fetch from cur_sql_mem_info into
@sqlmem_svr_name,
@sqlmem_obj_name,
@sqlmem_ins_name,
@sqlmem_Page_life_expe
end
close cur_sql_mem_info
deallocate cur_sql_mem_info
print'</table><br/>'

print '<table >
<tr>
<td><strong><span >SQL Server Memory Utilization
History:-</span><br ></strong><br>-- Page Life
Expectancy (PLE) value for each NUMA node in current instance<br>-- PLE
is a good measurement of memory pressure.<br>-- Higher PLE is better.
Watch the trend, not the absolute value.<br>-- This will only return one
row for non-NUMA systems.</td>
</tr>
</table>
<br/>'

/*

SQL Server memory grant pending
*/

print N'<H3>SQL Memory Grant Pending History</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Server Name</strong></th>'+
'<th><strong>Object Name</strong></th>'+
N'<th><strong>Memory Grants Pending</strong></th></tr>'

declare cur_sqlmem_grantinfo cursor local for
SELECT @@SERVERNAME AS [Server Name], [object_name], cntr_value AS [Memory Grants Pending]                                                                                                      
FROM sys.dm_os_performance_counters
WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances
AND counter_name = N'Memory Grants Pending';

open cur_sqlmem_grantinfo
fetch from cur_sqlmem_grantinfo into
@sqlmem_svrm_name,
@sqlmem_sql_obj_name,
@sqlmem_sql_mem_grant_pend
while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@sqlmem_svrm_name as varchar(500))+'</td><td>'+cast(@sqlmem_sql_obj_name as varchar(500))+'</td><td>'+cast(@sqlmem_sql_mem_grant_pend as varchar(500))+'</td>'+'</tr>'

fetch from cur_sqlmem_grantinfo into
@sqlmem_svrm_name,
@sqlmem_sql_obj_name,
@sqlmem_sql_mem_grant_pend
end
close cur_sqlmem_grantinfo
deallocate cur_sqlmem_grantinfo
print'</table><br/>'

print '<table >
<tr>
<td><strong><span >SQL Server Memory Grant Pending
History:-</span><br ><br></strong>-- Memory Grants
Pending above zero for a sustained period is a very strong indicator of
memory pressure.</td>
</tr>
</table>
<br/>'

/*
SQL Server memory clerk utilization
*/

print N'<H3>SQL Memory Clerks Memory Utilization</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Memory Clerk Name</strong></th>'+
N'<th><strong>Single Page Memory Allocation in (KB)</strong></th></tr>'

declare cur_sqlmem_clerkinfo cursor local for
SELECT TOP(10) [type] AS [Memory Clerk Type], SUM(single_pages_kb) AS [SPA Mem, Kb]
FROM sys.dm_os_memory_clerks
GROUP BY [type]
ORDER BY SUM(single_pages_kb) DESC;

open cur_sqlmem_clerkinfo
fetch from cur_sqlmem_clerkinfo into
@sqlmemclerk_obj_name,
@sqlmemclerk_mem_kb
while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@sqlmemclerk_obj_name as varchar(500))+'</td><td>'+cast(@sqlmemclerk_mem_kb as varchar(500))+'</td>'+'</tr>'
fetch from cur_sqlmem_clerkinfo into
@sqlmemclerk_obj_name,
@sqlmemclerk_mem_kb
end
close cur_sqlmem_clerkinfo
deallocate cur_sqlmem_clerkinfo
print'</table><br/>'

print'<table >
<tr>
<td><strong><span >SQL Server Memory Clerk
Information:-</span><br><br></strong>-- Look for high value for
CACHESTORE_SQLCP (Ad-hoc query plans)<br>-- CACHESTORE_SQLCP SQL Plans
<br>-- These are cached SQL statements or batches that <br>-- aren't in
stored procedures, functions and triggers<br>-- CACHESTORE_OBJCP Object
Plans <br>-- These are compiled plans for <br>-- stored procedures,
functions and triggers<br>-- CACHESTORE_PHDR Algebrizer Trees <br>-- An
algebrizer tree is the parsed SQL text <br>-- that resolves the table
and column names</td>
</tr>
</table>
<br/>'
/*
SQL Server QUery which tells you who is bloating plan cache
*/

print N'<H3>SQL Ad Hoc Query Plan cache  Utilization by Top 10</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>SQL Query Text</strong></th>'+
N'<th><strong>Size in Bytes(B)</strong></th></tr>'


declare cur_plancache_bloatqry cursor local for
SELECT TOP(10) [text] AS [QueryText], cp.size_in_bytes
FROM sys.dm_exec_cached_plans AS cp
CROSS APPLY sys.dm_exec_sql_text(plan_handle)
WHERE cp.cacheobjtype = N'Compiled Plan'
AND cp.objtype = N'Adhoc'
AND cp.usecounts = 1
ORDER BY cp.size_in_bytes DESC;


open cur_plancache_bloatqry
fetch from cur_plancache_bloatqry into
@adhocQue_QueryText,
@adhocQue_Qplan_size_byte

while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@adhocQue_QueryText as varchar(4000))+'</td><td>'+cast(@adhocQue_Qplan_size_byte as varchar(500))+'</td>'+'</tr>'
fetch from cur_plancache_bloatqry into
@adhocQue_QueryText,
@adhocQue_Qplan_size_byte
end
close cur_plancache_bloatqry
deallocate cur_plancache_bloatqry
print'</table><br/>'

print '<table >
<tr>
<td><strong>SQL Ad-Hoc Query Plan cache Utilization by TOP 50:-<br>
</strong>-- Gives you the text and size of single-use ad-hoc queries
that waste space in plan cache<br>-- SQL Server Agent creates lots of
ad-hoc, single use query plans in SQL Server 2005<br>-- Enabling forced
parameterization for the database can help<br></td>
</tr>
</table>
<p> </p>'

/*
SQL Server 2005 TokenAndPermUserStore cache information query
*/



print N'<H3>SQL Server 2005 TokenAndPermUserStore cache information</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>SecurityTokenCacheSize(kb)</strong></th></tr>'

declare cur_tkenpermcache_info cursor local for
SELECT SUM(single_pages_kb + multi_pages_kb) AS "SecurityTokenCacheSize(kb)"
FROM sys.dm_os_memory_clerks
WHERE name = 'TokenAndPermUserStore'

open cur_tkenpermcache_info

fetch from cur_tkenpermcache_info into
@tokempermcachesizekb
while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@tokempermcachesizekb as varchar(200))+'</td>'+'</tr>'
fetch from cur_tkenpermcache_info into
@tokempermcachesizekb
end
close cur_tkenpermcache_info
deallocate cur_tkenpermcache_info

print'</table><br/>'

print N'<H3>Monitor the number of entries that are removed in the cache store during the clock hand movement</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Name</strong></th>'+
'<th><strong>Type</strong></th>'+
'<th><strong>clock_hand</strong></th>'+
'<th><strong>clock_status</strong></th>'+
'<th><strong>rounds_count</strong></th>'+
'<th><strong>removed_all_rounds_count</strong></th>'+
'<th><strong>removed_last_round_count</strong></th>'+
'<th><strong>updated_last_round_count</strong></th>'+
N'<th><strong>last_round_start_time</strong></th></tr>'
declare cur_clockcount_tkenperm cursor local for
select name,type,clock_hand,clock_status,rounds_count,removed_all_rounds_count
,removed_last_round_count,updated_last_round_count,last_round_start_time from sys.dm_os_memory_cache_clock_hands where name='TokenAndPermUserStore'

open cur_clockcount_tkenperm
fetch from cur_clockcount_tkenperm into
@clocktokenname ,
@clocktyoe ,
@clockhand ,
@clock_status ,
@clockroundcounts,
@clockremovedallroundcount,
@clockremovedlastroundcount,
@clockupdatedlastroundcount,
@clocklastroundstarttime

while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@clocktokenname as varchar(200))+'</td><td>'+cast(@clocktyoe as varchar(200))+'</td><td>'+cast(@clockhand as varchar(200))+'</td><td>'+cast(@clock_status as varchar(200))+'</td><td>'+cast(@clockroundcounts as varchar(200))+'</td><td>'+cast(@clockremovedallroundcount as varchar(200))+'</td><td>'+cast(@clockremovedlastroundcount as varchar(200))+'</td><td>'+cast(@clockupdatedlastroundcount as varchar(200))+'<td>'+cast(@clocklastroundstarttime as varchar(200))+'</td>'+'</tr>'
fetch from cur_clockcount_tkenperm into
@clocktokenname ,
@clocktyoe ,
@clockhand ,
@clock_status ,
@clockroundcounts,
@clockremovedallroundcount,
@clockremovedlastroundcount,
@clockupdatedlastroundcount,
@clocklastroundstarttime
end

 close cur_clockcount_tkenperm
 deallocate cur_clockcount_tkenperm
 print'</table><br/>'
print'<table >
<tr>
<td><strong><span >SQL Server 2005
TokenAndPermUserStore cache information:-</span><br >
</strong>--TokenAndPermUserStore is one of the many caches present in
the SQL Server 2005 memory architecture. As the name implies, this cache
stores various security related information used by the SQL Server
Engine.<br>--These tokens represent information about cumulative
permission checks for queries.<br>--There are several indicators you can
monitor to determine if you are running into this class of problems.<br>
1. The amount of memory used by this security token cache<br>2. The
number of entries present in this security token cache<br>3. The extent
of contention on this security token cache<br>--There is no specific
threshold for this size beyond which the problem starts to happen. The
characteristic you need to monitor is the rate at which this cache size
is growing.<br>--If you are encountering problems with this cache, then
you will notice that as the size of the cache grows, the nature of the
problems you experience becomes worse. On a sample server that
experienced this problem, the cache grew at a rate approximately 1MB per
min to reach close to 1.2 GB. We have seen the problem starting to show
up even when the size of this cache reaches several hundred MB.<br>--The
symptoms that you want to correlate with the above data points include a
combination of the following:<br>1. Queries which normally finish faster
take a long time<br>2. CPU usage of SQL Server process is relatively
higher. CPU usage could come down after remaining high for a period of
time.<br>3. Connections from your applications keep increasing
(specifically in connection pool environments)<br>4. You encounter
connection or query timeouts<br>--In Microsoft SQL Server 2005,
performance issues may occur and CPU usage may increase when the size of
the TokenAndPermUserStore cache store increases to several hundred
megabytes. To address these issues, SQL Server 2005 Service Pack 3
enables you to customize the quota for the TokenAndPermUserStore cache
store.<br>--Quota defines the threshold for the number of entries in the
cache store. As soon as a new entry is added that exceeds the quota, an
internal clock hand movement is made that decrements the cost of each
entry in the store, and those entries whose cost reaches zero are
released. <br>--You can monitor the number of entries that are removed
in the cache store during the clock hand movement. To do this, query the
sys.dm_os_memory_cache_clock_hands Dynamic Management View.<br>
<a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;959823" target="_blank">
http://support.microsoft.com/default.aspx?scid=kb;EN-US;959823</a></td>
</tr>
</table><br/>'


/*
Trace Information about this SQL Server Instance.
*/


print N'<H3>SQL Server enable trace information</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>TraceFlag Name</strong></th>'+
'<th><strong>Status</strong></th>'+
'<th><strong>Global</strong></th>'+
N'<th><strong>Session</strong></th></tr>'
set nocount on
create table #traceinfo(flag varchar(20),Status varchar(10),Global varchar(10),Session varchar(10))
INSERT INTO #traceinfo EXECUTE ('DBCC TRACESTATUS(-1)')

declare cur_trace_info cursor local for select flag,Status,Global,Session from #traceinfo
open cur_trace_info
fetch from cur_trace_info
into
@flagname,
@flagstatus,
@flagglobal,
@flagsesion

while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@flagname as varchar(20))+'</td><td>'+cast(@flagstatus as varchar(20))+'</td><td>'+cast(@flagglobal as varchar(20))+'</td><td>'+cast(@flagsesion as varchar(20))+'</td>'+'</tr>'
fetch from cur_trace_info
into
@flagname,
@flagstatus,
@flagglobal,
@flagsesion
end
close cur_trace_info
deallocate cur_trace_info
drop table #traceinfo
 print'</table><br/>'
print'<table>
<tr>
<td>--For More information about the traceflag please visit following link
<a href="http://msdn.microsoft.com/en-us/library/ms188396.aspx" target="_blank">
Trace Flag Information</a></td>
</tr>
</table><br/>'



/*
Script for getting Top 20 SP ordered bu total worker time to find out most expensive sp by total worker time
indication could be CPU pressure.
The following example returns information about the top five queries ranked by average CPU time. This example aggregates the queries according to their query hash so that logically equivalent queries are grouped by their cumulative resource consumption.


*/


print N'<H3>SQL Server Top 10 SP ordered by Total Worker time:-</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>SP Name/Text</strong></th>'+
'<th><strong>Total Worker Time in Microsecond</strong></th>'+
'<th><strong>Average Worker Time in Microsecond</strong></th>'+
'<th><strong>Execution Count</strong></th>'+
'<th><strong>Calls /Second</strong></th>'+
'<th><strong>Average Elapsed Time in Microsecond</strong></th>'+
'<th><strong>Max Logical Reads</strong></th>'+
'<th><strong>Max Logical Writes</strong></th>'+
N'<th><strong>Age in Cache(Min)</strong></th></tr>'

declare cur_topspcpu_info cursor local for
SELECT TOP(10) qt.[text] AS [SP Name],
qs.total_worker_time AS [TotalWorkerTimeinmicroseconds],
qs.total_worker_time/qs.execution_count AS [AvgWorkerTimeinmicroseconds],
qs.execution_count AS [Execution Count],
NULLIF(qs.execution_count/DATEDIFF(Second, qs.creation_time,
GETDATE()), 1) AS [Calls/Second],
ISNULL(qs.total_elapsed_time/qs.execution_count, 0)
AS [AvgElapsedTimemicroseconds],
qs.max_logical_reads, qs.max_logical_writes,
DATEDIFF(Minute, qs.creation_time, GETDATE()) AS [Age in Cache]
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.[sql_handle]) AS qt
--WHERE qt.[dbid] = DB_ID() -- Filter by current database
ORDER BY qs.total_worker_time DESC;

open cur_topspcpu_info
fetch from cur_topspcpu_info into
@topspbycpu_spname,
@topspbycpu_totalworkertimeinmicros ,
@topspbycpu_Avgworkertimeinmicros ,
@topspbycpu_Executioncount ,
@topspbycpu_callsecond ,
@topspbycpu_averageelapsedtimeinmicros ,
@topspbycpu_maxlogicalread ,
@topspbycpu_maxlogicalwrites ,
@topspbycpu_ageincache


while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@topspbycpu_spname as varchar(1000))+
'</td><td>'+cast(@topspbycpu_totalworkertimeinmicros as varchar(200))+
'</td><td>'+cast(@topspbycpu_Avgworkertimeinmicros as varchar(200))+
'</td><td>'+cast(@topspbycpu_Executioncount as varchar(20))+
'</td><td>'+ISNULL(cast(@topspbycpu_callsecond as varchar(20)),0)+
'</td><td>'+cast(@topspbycpu_averageelapsedtimeinmicros as varchar(20))+
'</td><td>'+cast(@topspbycpu_maxlogicalread as varchar(20))+
'</td><td>'+cast(@topspbycpu_maxlogicalwrites as varchar(20))+
'</td><td>'+cast(@topspbycpu_ageincache as varchar(20))+'</td>'+'</tr>'
fetch from cur_topspcpu_info into
@topspbycpu_spname,
@topspbycpu_totalworkertimeinmicros ,
@topspbycpu_Avgworkertimeinmicros ,
@topspbycpu_Executioncount ,
@topspbycpu_callsecond ,
@topspbycpu_averageelapsedtimeinmicros ,
@topspbycpu_maxlogicalread ,
@topspbycpu_maxlogicalwrites ,
@topspbycpu_ageincache

end
close cur_topspcpu_info
deallocate cur_topspcpu_info
 print'</table><br/>'
 print N'<table >
<tr>
<td><strong>SQL Server Top 10 SP ordered by Total Worker time:-</strong><br>
--Above table shows the top 10 stored procedures sorted by total worker
time (which equates to CPU pressure). This will tell you the most
expensive stored procedures from a CPU perspective</td>
</tr>
</table>'



 /*

SQL Server Scheduler Information and NUMA related Information if parent node has more than one vlaue other than 0 and 32 and 64
then it indicate that you have NUMA architecture available with your server

 */




print N'<H3>SQL Server Scheduler stats and NUMA Stats :-</H3>'
print N'<table cellspacing="1" cellpadding="1" border="1">'+
N'<tr><th><strong>Parent Node ID/Text</strong></th>'+
'<th><strong>Scheduler ID</strong></th>'+
'<th><strong>CPU ID</strong></th>'+
'<th><strong>Schedler Status</strong></th>'+
'<th><strong>Is Online</strong></th>'+
'<th><strong>Is Idle</strong></th>'+
'<th><strong>Preemptive Switches Count:-</strong></th>'+
'<th><strong>Context Switches Count:-</strong></th>'+
'<th><strong>Idle Switches Count</strong></th>'+
'<th><strong>Current Tasks Count</strong></th>'+
'<th><strong>Runnable Tasks Count</strong></th>'+
'<th><strong>Current Workers Count</strong></th>'+
'<th><strong>Pending Disk IO Count</strong></th>'+
'<th><strong>Failed to Create Workerthread Count</strong></th>'+
N'<th><strong>Active Workers Count</strong></th></tr>'

declare cur_sqlschedule_info cursor local for
select parent_node_id,scheduler_id,cpu_id,status,is_online,is_idle,
preemptive_switches_count,
context_switches_count,
idle_switches_count,
current_tasks_count,
runnable_tasks_count,
current_workers_count,
active_workers_count,
pending_disk_io_count,
failed_to_create_worker

 from sys.dm_os_schedulers

 open cur_sqlschedule_info
 fetch from cur_sqlschedule_info into
@sqlschedule_parenenodeid,
@sqlschedule_schdulerid,
@sqlschedule_cpuid,
@sqlschedule_status,
@sqlschedule_isonline ,
@sqlschedule_isidle ,
@sqlschedule_preemptiveswtichescounts ,
@sqlschedule_contextswtichescounts ,
@sqlschedule_idleswtichescounts ,
@sqlschedule_currenttaskcounts ,
@sqlschedule_runnabletaskcounts ,
@sqlschedule_currentworkercounts ,
@sqlschedule_activeworkercounts,
@sqlschedule_pendingiocounts,
@sqlschedule_failedtocreate


while @@FETCH_STATUS>=0
 begin
print '<tr><td>'+cast(@sqlschedule_parenenodeid as varchar(20))+'</td><td>'+cast(@sqlschedule_schdulerid as varchar(20))+'</td><td>'+cast(@sqlschedule_cpuid as varchar(20))+'</td><td>'+cast(@sqlschedule_status as varchar(20))+'</td><td>'+cast(@sqlschedule_isonline as varchar(20))+'</td><td>'+cast(@sqlschedule_isidle as varchar(200))+'</td><td>'+cast(@sqlschedule_preemptiveswtichescounts as varchar(20))+'</td><td>'+cast(@sqlschedule_contextswtichescounts as varchar(20))+'</td><td>'+cast(@sqlschedule_idleswtichescounts as varchar(20))+'</td><td>'+cast(@sqlschedule_currenttaskcounts as varchar(20))+'</td><td>'+cast(@sqlschedule_runnabletaskcounts as varchar(20))+'</td><td>'+cast(@sqlschedule_currentworkercounts as varchar(20))+'</td><td>'+cast(@sqlschedule_failedtocreate as varchar(20))+'</td><td>'+cast(@sqlschedule_pendingiocounts as varchar(20))+'</td><td>'+cast(@sqlschedule_activeworkercounts as varchar(20))+'</td>'+'</tr>'

 fetch from cur_sqlschedule_info into
@sqlschedule_parenenodeid,
@sqlschedule_schdulerid,
@sqlschedule_cpuid,
@sqlschedule_status,
@sqlschedule_isonline ,
@sqlschedule_isidle ,
@sqlschedule_preemptiveswtichescounts ,
@sqlschedule_contextswtichescounts ,
@sqlschedule_idleswtichescounts ,
@sqlschedule_currenttaskcounts ,
@sqlschedule_runnabletaskcounts ,
@sqlschedule_currentworkercounts ,
@sqlschedule_activeworkercounts,
@sqlschedule_pendingiocounts,
@sqlschedule_failedtocreate

end
close cur_sqlschedule_info
deallocate cur_sqlschedule_info
 print'</table><br/>'
 print '<table >
<tr>
<td><strong>SQL Server Scheduler and NUMA Related Information:-<br>
</strong>--Non-uniform memory access (NUMA) is enabled on your SQL
Server instance.<br>--For more information about NUMA please refer to
the following links<br>
<a href="http://msdn.microsoft.com/en-in/library/ms178144(v=sql.105).aspx">
http://msdn.microsoft.com/en-in/library/ms178144(v=sql.105).aspx</a><br>
<a href="http://msdn.microsoft.com/en-us/library/ms345357.aspx">
http://msdn.microsoft.com/en-us/library/ms345357.aspx</a></td>
</tr>
</table>'

Comments

Popular posts from this blog

Index Clean-Up Scripts

forgot sa password and no logins are added

The SQL Server DBA’s Guide to Teradata