2016年9月7日 星期三

SQL Server Performance study resources (SQL Server效能-學習資源)

SQL Server Performance study resources
SQL Server效能-學習資源
from my MSDN blog - September 7, 2016

查詢處理架構:
Query Processing Architecture

效能監控與分析:
Monitor and Tune for Performance

opicTask
Monitor SQL Server ComponentsRequired steps to monitor any SQL Server component.
Performance Monitoring and Tuning ToolsLists the monitoring and tuning tools available with SQL Server.
Establish a Performance BaselineHow to establish a performance baseline.
Isolate Performance ProblemsIsolate database performance problems.
Identify BottlenecksMonitor and track server performance to identify bottlenecks.
Monitor CPU Usage
Monitor Disk Usage
Monitor Memory Usage
Server Performance and Activity MonitoringUse SQL Server and Windows performance and activity monitoring tools.
Open Activity Monitor (SQL Server Management Studio) 活動監視器
https://msdn.microsoft.com/en-us/library/ms175518.aspx
Microsoft® SQL Server® 2012 Performance Dashboard Reports
https://www.microsoft.com/en-us/download/details.aspx?id=29063
Display and Save Execution PlansDisplay and save execution plans to a file in XML format.

Query Tuning(語法優化,前面2篇很重要)

Chapter 14 — Improving SQL Server Performance

SQL Server
Optimizing SQL Server Query Performance
Maciej Pilecki

Query Tuning

Understanding how SQL Server executes a query
August 1st, 2013

目前正在執行的Query
Determine the Currently Executing Statement in a Long Running SQL Stored Procedure

SELECT  requests.session_id,
         requests.status,
         requests.command,
         requests.statement_start_offset,
         requests.statement_end_offset,
         requests.total_elapsed_time,
         details.text
 FROM    sys.dm_exec_requests requests
 CROSS APPLY sys.dm_exec_sql_text (requests.plan_handle) details
 WHERE   requests.session_id > 50
 ORDER BY total_elapsed_time DESC

Status:
sys.dm_exec_sessions (Transact-SQL)
Status of the session. Possible values:
 Running - Currently running one or more requests
 Sleeping - Currently running no requests
 Dormant – Session has been reset because of connection pooling and is now in prelogin state.
 Preconnect - Session is in the Resource Governor classifier.
Is not nullable.

sys.dm_exec_requests (Transact-SQL)
Status of the request. This can be one of the following:
Background
Running
Runnable
Sleeping
Suspended
Is not nullable.

Different Status of a SPID in SQL Server and What do they mean
How It Works: What is a Sleeping / Awaiting Command Session

Wait Type:
Wait statistics, or please tell me where it hurts
Doctor, this SQL Server appears to be sick….
Case Study: Part 1: CXPACKET Wait Stats & ‘max degree of parallelism’ Option: Introduction to Using Wait Stats to Identify & Remediate Query Parallelism Bottlenecks
Troubleshooting ASYNC_NETWORK_IO, NETWORKIO
What is WRITELOG waittype and how to troubleshoot and fix this wait in SQL Server
What’s that HTDELETE wait type?
Meditation on SQL Trace performance Impact and Wait types
REPL_SCHEMA_ACCESS wait type
sys.dm_os_wait_stats (Transact-SQL)
The SQL Server Wait Type Repository…
Best Performer: Distributed query (Four-part) or OPENQUERY when executing linked server queries in SQL Server
issues where too many connections running distributed queries end up in a SOSHOST_MUTEX wait while SQL Server is collecting data distribution statistics from the remote server.

透過SQL Profiler trace分析:
Troubleshooting and Analysis with Traces

書名:SQL Server效能調校
書號:PG21414  作者:陳祥輝、陳臆如、黃浩 ISBN: 978-986-201-902-3
定價:NT$450元  印刷:單色 頁數:272頁
書籍規格:17*23 上市日:2014/3/30 譯者:(無)
http://www.drmaster.com.tw/Bookinfo.asp?BookID=PG21414

SQL Server Performance Tuning 效能調校
http://www.delightpress.com.tw/book.aspx?book_id=SKUD00026
分類| 資料庫
作者| 胡百敬‧姚巧玫‧周妙謙  日盛金控  劉承修
出版日期| 2014-06-06

沒有留言:

Copy or Backup Command - robocopy

  robocopy D:\Backup E:\Backup /MIR /MT:100 /LOG+:C:\Logs\robocopy.log /MIR  鏡像目錄樹(包含 空的子目錄 ), 確保目標目錄與來源目錄完全相符,並比對刪除目標中不存在於來源中的任何檔案或目錄, /MT:...