กระบวนการ
master.dbo.sysprocessesตารางใน Microsoft SQL Server 2000 และ SQL Server 2005 มีตารางระบบที่ประกอบด้วยรายละเอียดเกี่ยวกับกระบวนการเซิร์ฟเวอร์ที่ใช้งานอยู่หมายเลข (SPIDs) ที่รันใน SQL Server
ถ้าคุณใช้ SQL Server 2005 คุณยังสามารถเข้าถึงตารางนี้ โดยใช้การ
sys.sysprocessesการดูความเข้ากันได้
กระบวนการ
waittypeคอลัมน์
lastwaittypeคอลัมน์
waittimeคอลัมน์ และ
waitresourceคอลัมน์นี้
master.dbo.sysprocessessystem table provide information
about the resources that the processes are waiting on.
This article
lists the possible lastwaittype values, the associated waittype values, and a
brief description of their meanings.
กระบวนการ
master.dbo.sysprocessessystem table that is stored in the
masterdatabase of your instance of SQL Server contains the following columns that
help the system administrator monitor the processes for resource contention
scenarios and blocking problems:
- waittype: แบบwaittypefield is a reserved internal binary column. The
value in thewaittypefield indicates the type of resource that the connection
is waiting on.
- lastwaittype: แบบlastwaittypefield is a string representation of thewaittypeเขตข้อมูล: กระบวนการlastwaittypefield indicates the last waittype or the
current waittype of a SPID. If the value of thewaittypecolumn for an SPID is
0x0000, the SPID is not currently waiting on any resource.
ในกรณีนี้lastwaittypecolumn indicates the last waittype that the SPID
has experienced. However, if the value of thewaittypecolumn for an SPID is
non-zero, the values in thelastwaittypecolumn and thewaittypecolumn for the SPID are equal. These values indicate the current wait
state for the SPID.
หมายเหตุ:The UMSTHREAD waittype is an exception to this rule. See the description of UMSTHREAD in the "Other waittypes" section for additional details. - waittime: แบบwaittimecolumn provides the number of milliseconds that the
SPID has been waiting with the current waittype.
- waitresource: The waitresource column provides more detailed information about
the specific resource that the SPID is waiting on.
The later sections in this article describe some of the
waittypes that are supported by SQL Server and that are frequently logged in
the
master.dbo.sysprocessesตารางระบบ
LOCK waittypes
The following table lists the LOCK waittypes
in the
master.dbo.sysprocessessystem table in SQL Server 2000 and SQL Server 2005.
ยุบตารางนี้ขยายตารางนี้
| Lastwaittype | Waittype | คำอธิบาย: |
|---|
| LCK_M_SCH_S | 0x01 | Schema stability |
| LCK_M_SCH_M | 0x02 | Schema modification |
| LCK_M_S | 0x03 | ใช้ร่วมกัน |
| LCK_M_U | 0x04 | การปรับปรุง |
| LCK_M_X | 0x05 | Exclusive |
| LCK_M_IS | 0x06 | Intent-Share |
| LCK_M_IU | 0x07 | Intent-Update |
| LCK_M_IX | 0x08 | Intent-Exclusive |
| LCK_M_SIU | 0x09 | Shared intent to update |
| LCK_M_SIX | 0x0a | Share-Intent-Exclusive |
| LCK_M_UIX | 0x0b | Update-Intent-Exclusive |
| LCK_M_BU | 0x0c | Bulk Update |
| LCK_M_RS_S | 0x0d | Range-share-share |
| LCK_M_RS_U | 0x0e | Range-share-Update |
| LCK_M_RI_NL | 0x0F | Range-Insert-NULL |
| LCK_M_RI_S | 0x10 | Range-Insert-Shared |
| LCK_M_RI_U | 0x11 | Range-Insert-Update |
| LCK_M_RI_X | 0x12 | Range-Insert-Exclusive |
| LCK_M_RX_S | 0x13 | Range-exclusive-Shared |
| LCK_M_RX_U | 0x14 | Range-exclusive-update |
| LCK_M_RX_X | 0x15 | Range-exclusive-exclusive |
For more information about the LOCK types that are
supported in SQL Server 2000 and SQL Server 2005, see the following topics in SQL Server Books
Online:
- Understanding
locking in SQL Server
- Lock
compatibility
Additionally, if an SPID is
waiting on the LOCK waittypes and the corresponding value in the
waittimecolumn that is logged in the
master.dbo.sysprocessessystem table is very high, you
must troubleshoot the blocking problems for your instance of SQL
Server.
สำหรับข้อมูลเพิ่มเติม ให้คลิกหมายเลขบทความต่อไปนี้ เพื่อดูบทความในฐานความรู้ของ Microsoft::
224453
(http://support.microsoft.com/kb/224453/
)
การศึกษา และการแก้ไขปัญหาการบล็อคของ 2000 หรือ SQL Server 7.0
LATCH waittypes
A latch is a short-term lightweight synchronization object. The
following list describes the different types of latches:
- Non-buffer (Non-BUF) latch: The non-buffer latches provide synchronization services to
in-memory data structures or provide re-entrancy protection for
concurrency-sensitive code lines. These latches can be used for a variety of
things, but they are not used to synchronize access to buffer pages.
- Buffer (BUF) latch: The buffer latches are used to synchronize access to BUF
structures and their associated database pages. The typical buffer latching
occurs during operations that require serialization on a buffer page, (during a page split or during the allocation of a new page, for example). These
latches are not held for the duration of a transaction. These are indicated in themaster.dbo.sysprocessestable by the PAGELATCH waittypes.
For more information about one of the possible causes of BUF latch contention, click the following article number to view the article in the Microsoft Knowledge Base:328551
(http://support.microsoft.com/kb/328551/
)
การแก้ไข: การปรับปรุงการเกิดพร้อมกันสำหรับฐานข้อมูล tempdb
- IO latch: The IO latches are a subset of BUF latches that are used when
the buffer and associated data page or the index page is in the middle of an IO
operation. PAGEIOLATCH waittypes are used for disk-to-memory transfers and a significant waittime for these waittypes suggests disk I/O
subsystem issues.
The following table lists the different latch waittypes that
you may notice in the
master.dbo.sysprocessessystem table in SQL Server 2000 and SQL Server 2005.
ยุบตารางนี้ขยายตารางนี้
| Lastwaittype | Waittype | คำอธิบาย: |
|---|
| LATCH_NL | 0x400 | Null latch |
| LATCH_KP | 0x401 | Keep latch |
| LATCH_SH | 0x402 | Shared latch |
| LATCH_UP | 0x403 | Update latch |
| LATCH_EX | 0x404 | Exclusive latch |
| LATCH_DT | 0x405 | Destroy latch |
| PAGELATCH_NL | 0x410 | Null buffer page
latch |
| PAGELATCH_KP | 0x411 | Keep buffer page
latch |
| PAGELATCH_SH | 0x412 | Shared buffer page
latch |
| PAGELATCH_UP | 0x413 | Update buffer page
latch |
| PAGELATCH_EX | 0x414 | Exclusive buffer page
latch |
| PAGELATCH_DT | 0x415 | Destroy buffer page
latch |
| PAGEIOLATCH_NL | 0x420 | Null buffer page I/O
latch |
| PAGEIOLATCH_KP | 0x421 | Keep buffer page I/O
latch |
| PAGEIOLATCH_SH | 0x422 | Shared buffer page I/O
latch |
| PAGEIOLATCH_UP | 0x423 | Update buffer page I/O
latch |
| PAGEIOLATCH_EX | 0x424 | Exclusive buffer page
I/O latch |
| PAGEIOLATCH_DT | 0x425 | Destroy buffer page I/O
latch |
เริ่มการทำงานกับ SQL Server 2000 SP4 คอลัมน์ waitresource สำหรับ latches การระยะไม่บ่อยที่สุด Latch_XX latches ถูกบรรจุ โดยใช้ค่าในตารางต่อไปนี้ ก่อนที่จะ SQL Server 2000 SP4 มีไม่มีวิธีการเพื่อระบุเหตุผลว่า latches ระยะไม่ได้ถูกเก็บไว้ โดยไม่มีการเพิ่มเติม invasive วินิจฉัย เช่น userdump แบบ waittype หรือ waitresource ควรสามารถดู โดยใช้การ waittime waittime ระบุในมิลลิวินาทีนานได้ถูกรอเธรด
ยุบตารางนี้ขยายตารางนี้
| Waitresource | คำอธิบาย: | การแก้ไขปัญหา |
| fcb fgcb_alloc | เก็บ latches Latch_XX เหล่านี้มีไว้เมื่อเพจที่ถูกปันส่วนจากแฟ้ม ว่าส่วนขยายที่สม่ำเสมอ หรือผสมกัน นอกจากนี้ยังมีการเก็บไว้ latches ในระหว่างการดำเนินการปันส่วน เช่นเติบ และลดขนาดแฟ้ม เปลี่ยนชื่อ หรือลบไฟล์ หรือเพิ่ม หรือลบแฟ้ม | ตรวจสอบว่า แฟ้มใด ๆ ที่มีการลดขนาด หรือเติบ ขึ้นต้น ด้วย SQL Server 2000 SP4 อ็อพชัน Autogrow จะถูกบันทึกไว้ใน errorlog ถ้าใช้มากกว่า 30 วินาที ideally ตัวเลือก Autogrow ที่ควรใช้เป็นการสำรองข้อมูล และคุณควรใช้ความจุ prudent ที่วางแผนเพื่อหลีกเลี่ยงการนักรันไทม์ของเติบแฟ้ม คุณยังสามารถเปลี่ยนค่าเริ่มต้น 10 เปอร์เซ็นต์ที่ autogrow ขนาดแบบถาวร เราไม่แนะนำให้ คุณใช้ Autoshrink ที่อยู่ในการผลิต แฟ้มใน filegroup นี้อาจยังสามารถออกจำนวนการร้องขอสำหรับการปันส่วนไว้ คุณสามารถเพิ่มแฟ้มเพิ่มเติมใน filegroup นั้น |
| สืบค้นกลับ trace_controller trace_io_sync | latches Latch_XX เหล่านี้ถูกเก็บไว้สำหรับการซิงโครไนซ์ในการดำเนินการสืบค้นกลับ profiler การดำเนินการ Sychronization รวมเริ่มต้น หยุด การตั้งค่าสถานะการสืบค้นกลับ และซิงโครไนส์ผู้อ่านและเขียน | ระบุข้อมูลใด ๆ profiler ที่กำลังทำงาน พยายามหลีกเลี่ยงการรันการสืบค้นกลับ profiler มากกว่าหนึ่งในเวลาเดียวกัน เมื่อเริ่มต้นการสืบค้นกลับการ profiler การสืบค้นกลับที่ถูกบันทึกไว้ในแฟ้มบันทึกเหตุการณ์ของโปรแกรมประยุกต์ นอกจากนี้ คุณสามารถใช้แบบสอบถามต่อไปนี้ในตัววิเคราะห์คำถาม SQL เพื่อดูข้อมูลที่ใช้งานอยู่SELECT * FROM ::fn_trace_getinfo(NULL) |
| parallel_page_supplier | latches Latch_XX เหล่านี้ใช้สำหรับการซิงโครไนส์เรียกของเพจสำหรับการสอบถามพอร์ตขนาน latch นี้บ่งชี้ว่า แบบสอบถามกำลังทำงานไปพร้อม ๆ และอาจทำงานปกติ | ปรับแต่งการสอบถามถ้าคอลัมน์ waittime ค่ามีขนาดใหญ่ และแบบสอบถามกำลังทำไม่ดี |
| ides | waitresource latch ของ IDES ถูกใช้ เมื่อเพ PFS ถูกสแกนเพื่อค้นหาพื้นที่ว่าง และ เมื่อมีการปรับปรุงเพ PFS เพื่อสะท้อนถึงการปันส่วนและ deallocations หน้า latch นี้ยังถูกใช้เมื่อมีการปันส่วนหน้าเดียวกับวัตถุที่มีอยู่ | ตรวจสอบว่า คุณมีดัชนีที่คลัสเตอร์บนวัตถุมีการสอบถาม |
waittypes อื่น ๆ
ตารางต่อไปนี้แสดงรายการ waittypes อื่น ๆ ที่คุณอาจพบในการ
master.dbo.sysprocessesตารางระบบใน SQL Server 2000 และ SQL Server 2005
ยุบตารางนี้ขยายตารางนี้
| Lastwaittype | Waittype | คำอธิบาย: |
|---|
| โหมดสลีป | 0x20 | waittype นี้บ่งชี้ว่า SPID กำลังรอเวลาที่ระบุ และมีสถานะที่พบโดยทั่วไปสำหรับเธรดพื้นหลังที่ประมวลผลการ lazywrites, checkpoints หรือเหตุการณ์การสืบค้นกลับ profiler ฝั่งเซิร์ฟเวอร์ |
| io_completion | 0x21 | waittype นี้บ่งชี้ว่า SPID ที่กำลังรอการร้องขอ I/O ให้เสร็จสมบูรณ์ เมื่อคุณสังเกตเห็น waittype นี้สำหรับการ SPID ในนั้นsysprocessesตารางระบบ คุณต้องระบุ bottlenecks ดิสก์ โดยใช้เคาน์เตอร์การตรวจสอบประสิทธิภาพการทำงาน การสืบค้นกลับ profiler ฟังก์ชัน valued ตารางระบบ fn_virtualfilestats และตัวเลือก SHOWPLAN เพื่อวิเคราะห์แผนแบบสอบถามที่สอดคล้องกับ SPID นั้น คุณสามารถลด waittype นี้ได้ โดยการเพิ่มแบนด์วิดท์ของ I/O เพิ่มเติม หรือดุล I/O ไปยังไดรฟ์อื่น คุณสามารถจะลด I/O โดยใช้การจัดทำดัชนี หาค่าแผนการสอบถามไม่ถูกต้อง และค้นหาไวต่อแรงกดหน่วยความจำ |
| async_io_completion | 0x22 | waittype นี้บ่งชี้ว่า SPID ที่กำลังรอสำหรับการร้องขอ I/O แบบอะซิงโครนัสให้เสร็จสมบูรณ์ เช่นเดียวกับ IO_COMPLETION waittype, waittype นี้ยังระบุ I/O ข้อ bottleneck คุณอาจเห็น waittype นี้สำหรับ SPIDs ในระหว่างการดำเนินการที่รันเป็นเวลานาน ฉัน/O-ขอบงาน เช่นการสำรองข้อมูล สร้างฐานข้อมูล ฐาน ข้อมูลที่มีการเปลี่ยนแปลง หรือ autogrow ฐานข้อมูล waittype นี้ยังอาจบ่งชี้ bottlenecks ดิสก์ |
| resource_semaphore | 0x40 | waittype นี้บ่งชี้ว่า SPID ที่กำลังรอทรัพยากร ที่นี่ SPIDs โดยทั่วไปจะรอการร้องขอหน่วยความจำสำหรับการเรียงลำดับหรือการดำเนินการแปลงแป้นพิมพ์ในระหว่างการดำเนินการแบบสอบถาม waittype นี้ยังอาจระบุว่า หน่วยความจำไวต่อแรงกดอยู่ในส่วนของเก็บบัฟเฟอร์ที่มองเห็นได้ |
| dtc | 0x41 | waittype นี้บ่งชี้ว่า SPID ที่กำลังรอบนที่ Microsoft แจกจ่ายธุรกรรม Coordinator การบริการ (MS DTC) |
| oledb | 0x42 | waittype นี้บ่งชี้ว่า SPID มีทำงานกับฟังก์ชันเรียกไปยังผู้ให้บริการ OLE DB และกำลังรอสำหรับฟังก์ชันการส่งค่าข้อมูลที่จำเป็น waittype นี้อาจจะระบุว่า SPID ที่กำลังรอการเรียกกระบวนการระยะไกลหรือแบบสอบถามเซิร์ฟเวอร์ที่ถูกเชื่อมโยงกับข้อมูลที่ต้องการส่งคืนสินค้า SPID ยังอาจจะกำลังรอสำหรับคำสั่งที่มีการใส่ขนาดใหญ่หรือแบบสอบถามการค้นหาแบบเต็มเพื่อส่งค่าข้อมูลที่จำเป็น
OLEDB waittype ถูกใช้เพื่อบ่งชี้ที่แตกต่างกันหลาย ๆ รอสถานะ การรวม: แบบสอบถามเซิร์ฟเวอร์ แบบสอบถามการค้นหาแบบเต็ม คำสั่งที่มีการใส่ขนาดใหญ่ สืบ Profiler ฝั่งไคลเอ็นต์ materialization ตารางเสมือนเหมือนกับตาราง sysprocesses ตัวอ่านบันทึก และ CHECKDB DBCC ที่เชื่อมโยง |
| RESOURCE_QUEUE | 0x44 | This is an ordinary idle
state for background threads in SQL Server. |
| ASYNC_DISKPOOL_LOCK | 0x45 | You may notice this
waittype during the long-running I/O-bound operations such as creating,
expanding, or dropping a database file. |
| UMSTHREAD | 0x46 | This waittype indicates that a
batch has been received from a client application but that there are no worker
threads that are available to service the request. If you consistently see 0x0046 waittypes for multiple SPIDs, there is a significant bottleneck elsewhere in the system that is using all the available worker threads. หมายเหตุที่นั้นwaittimecolumn is always 0 for the UMSTHREAD waittype, and thelastwaittypecolumn may erroneously show the name of a different waittype instead of UMSTHREAD." |
| WRITELOG | 0x81 | This waittype indicates that
the SPID is waiting for a transaction log I/O request to complete. This
waittype may also indicate a possible disk bottleneck. |
PSS_CHILD EXCHANGE CXPACKET | 0x101 0x200 0x208 | These waittypes are all involved in parallel query execution. These
waittypes indicate that the SPID is waiting on a parallel process to complete
or start. |
| PAGESUPP | 0x209 | This waittype tracks the wait
time that is incurred because of the required serialization in distributing rows to
multiple callers in a parallel scan. |
| CURSOR | 0x20C | This waittype indicates that the
SPID is participating in the thread synchronization while it uses asynchronous
cursors. กระบวนการsp_configure cursorthresholdconfiguration setting may determine
when a cursor is created asynchronously. |
| DBTABLE | 0x202 | This waittype indicates that a
thread is waiting to perform a checkpoint and another thread is already
checkpointing the database. |
| EC | 0x203 | This waittype indicates that the
SPID is waiting for access to execution context. |
| TEMPOBJ | 0x204 | This waittype indicates that
the SPID is waiting to drop a temporary object that is still being used. |
| XACTLOCKINFO | 0x205 | This waittype indicates
that the SPID is waiting to perform maintenance on its lock list. |
| LOGMGR | 0x206 | This waittype is used when the
SPID tries to shut down a database and waits for the pending transaction log
I/O requests to complete. |
| CMEMTHREAD | 0x207 | This waittype indicates that
the SPID is waiting for access to a thread-safe memory object. The
serialization makes sure that while the users are allocating or freeing the
memory from the memory object, any other SPIDs that are trying to perform the
same task have to wait, and the CMEMTHREAD waittype is set when the SPIDs are
waiting.
You may notice this waittype in many scenarios. However,
this waittype is most frequently logged when the ad hoc query plans are being
quickly inserted into a procedure cache from many different connections to the
instance of SQL Server. You can address this bottleneck by limiting the data that must be inserted or removed from the procedure cache, such as
explicitly parameterizing the queries so that the queries can be reused or
using stored procedures where appropriate. |
| SHUTDOWN | 0x20A | This waittype indicates that a
SHUTDOWN command has been issued by the SPID, and the SPID is waiting for
active queries to complete. |
| WAITFOR | 0x20B | This waittype indicates that
the SPID is sleeping because of a WAITFOR DELAY Transact-SQL
statement. |
| NETWORKIO | 0x800 | This waittype indicates that
the SPID is waiting for the client application to fetch the data before the
SPID can send more results to the client application. |
สำหรับข้อมูลเพิ่มเติม ให้คลิกหมายเลขบทความต่อไปนี้ เพื่อดูบทความในฐานความรู้ของ Microsoft::
244455
(http://support.microsoft.com/kb/244455/
)
Definition of sysprocesses waittype and lastwaittype fields for SQL Server 7.0
สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการ
master.dbo.sysprocessessystem table in SQL Server 2000, visit the following Microsoft Web
site:
For
more information about the latches in SQL Server 2000, visit the following
Microsoft Web site:
หมายเลขบทความ (Article ID): 822101 - รีวิวครั้งสุดท้าย: 14 มกราคม 2554 - Revision: 4.0
ใช้กับ
- Microsoft SQL Server 2000 Standard Edition
- Microsoft SQL Server 2005 Standard Edition
- Microsoft SQL Server 2005 Express Edition
- Microsoft SQL Server 2005 Developer Edition
- Microsoft SQL 2005 Server Enterprise
- Microsoft SQL 2005 Server Workgroup
| kbsystemdata kbfield kbdatabase kbinfo kbmt KB822101 KbMtth |
แปลโดยคอมพิวเตอร์ข้อมูลสำคัญ: บทความนี้แปลโดยซอฟต์แวร์การแปลด้วยคอมพิวเตอร์ของ Microsoft แทนที่จะเป็นนักแปลที่เป็นบุคคล Microsoft มีบทความที่แปลโดยนักแปลและบทความที่แปลด้วยคอมพิวเตอร์ เพื่อให้คุณสามารถเข้าถึงบทความทั้งหมดในฐานความรู้ของเรา ในภาษาของคุณเอง อย่างไรก็ตาม บทความที่แปลด้วยคอมพิวเตอร์นั้นอาจมีข้อบกพร่อง โดยอาจมีข้อผิดพลาดในคำศัพท์ รูปแบบการใช้ภาษาและไวยากรณ์ เช่นเดียวกับกรณีที่ชาวต่างชาติพูดผิดเมื่อพูดภาษาของคุณ Microsoft ไม่มีส่วนรับผิดชอบต่อความคลาดเคลื่อน ความผิดพลาดหรือความเสียหายที่เกิดจากการแปลเนื้อหาผิดพลาด หรือการใช้บทแปลของลูกค้า และ Microsoft มีการปรับปรุงซอฟต์แวร์การแปลด้วยคอมพิวเตอร์อยู่เป็นประจำ
ต่อไปนี้เป็นฉบับภาษาอังกฤษของบทความนี้:
822101
(http://support.microsoft.com/kb/822101/en-us/
)