sqlserver的日常检查脚本归结
2012-02-15 12:23:49 来源:WEB开发网ltrim(physical_memory_in_bytes / 1024 / 1024) as physical_memory_mb,
ltrim(virtual_memory_in_bytes / 1024 / 1024) as virtual_memory_mb,
ltrim(bpool_committed * 8 / 1024) as bpool_committed_mb,
ltrim(bpool_commit_target * 8 / 1024) as bpool_target_mb,
ltrim(bpool_visible * 8 / 1024) as bpool_visible_mb
from sys.dm_os_sys_info
go
print ' '
print ' '
print '-------------------------------------------------------'
print '17.4I/O 瓶颈'
print '-------------------------------------------------------'
select wait_type, ltrim(waiting_tasks_count) as waiting_tasks_count , ltrim(wait_time_ms) as wait_time_ms ,
ltrim(signal_wait_time_ms) as signal_wait_time_ms, ltrim(wait_time_ms / waiting_tasks_count) as avgtime
from sys.dm_os_wait_stats
where wait_type like 'PAGEIOLATCH%' and waiting_tasks_count > 0
order by wait_type
go
print ' '
print ' '
print '-------------------------------------------------------'
print '17.5查找当前挂起的 I/O 请求'
print '-------------------------------------------------------'
print '正常情况下不返回任何值'
select
database_id,
file_id,
io_stall,
io_pending_ms_ticks,
scheduler_address
from sys.dm_io_virtual_file_stats(NULL, NULL)t1,
sys.dm_io_pending_io_requests as t2
where t1.file_handle = t2.io_handle
go
print ' '
print ' '
print '-------------------------------------------------------'
print '17.6查看IO相关查询读取次数'
print '-------------------------------------------------------'
select top 5 (total_logical_reads/execution_count) as avg_logical_reads,
(total_logical_writes/execution_count) as avg_logical_writes,
(total_physical_reads/execution_count) as avg_physical_reads,
Execution_count, statement_start_offset, p.query_plan, q.text
- ››sql server自动生成批量执行SQL脚本的批处理
- ››sql server 2008亿万数据性能优化
- ››SQL Server 2008清空数据库日志方法
- ››sqlserver安装和简单的使用
- ››SQL Sever 2008 R2 数据库管理
- ››SQL SERVER无法安装成功,sqlstp.log文件提示[未发...
- ››Sql Server中通过父记录查找出所有关联的子记录
- ››SqlServer触发器、存储过程和函数
- ››SQL Server 中的事务(含义,属性,管理)
- ››Sqlite数据库插入和读取图片数据
- ››Sql server 2005拒绝了对对象 'xx表' (数...
- ››Sql server 2005拒绝了对对象 'xx表' (数...
更多精彩
赞助商链接