The
master.dbo.sysprocessestable in Microsoft SQL Server 2000 and SQL Server 2005 is a system table
that contains information about the active server process IDs (SPIDs) that are
running on SQL Server.
If you are using SQL Server 2005, you can also access this table by using the
sys.sysprocessescompatibility view.
The
waittypecolumn, the
lastwaittypecolumn, the
waittimecolumn,
and the
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.
The
master.dbo.sysprocessessystem table that is stored in the
??????database 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????? ??? Thelastwaittypefield 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 | ????? |
| 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/
)
SQL Server 7.0 ?? 2000 ????????? ?????? ?? ??? ???? ?? ?? ?????
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/
)
FIX: tempdb ??????? ?? ??? Concurrency ?????????????
- 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, ???? ??????? ???-Buf latches, Latch_XX ?? ??? waitresource ????? latches, ????????? ??? SQL Server 2000 SP4, ???? ?? ???? ??? ???? ?? ?? ???-buf latches ???? ???? invasive ?????, ???? ??? userdump held ?? ??? ?? ?? ????????? ???? ?? ??? ??? ????? ???? ??? Waittype ?? waitresource waittime ?? ????? ???? ???? ?? ???? ?????? Waittime ??? ????????? ???? ?? ????????? ????? ????? ????????? ?? ???? ??? ???
?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
| Waitresource | ?????: | ?????? ?????? |
| FCB FGCB_ALLOC | ?? Latch_XX latches ??? held ??????? ?? ???? ????? ?? ?????? ??? ?? ?? ?? ?? ????-???? ?? ?????????? ???? ??? ????? ????????, ???? growing ?? ???? ????? ?? shrinking, ?? ??? ????? ?? ???? ???? ?? ??? ?? ??? ?? ???? ????? ?? ??????? ?? ????? latches held ?? ??? ???? | ????????? ???? ?? ???? ??? ?? ??????? shrinking ?? growing ???? SQL Server 2000 SP4 ?? ??? ??????? ?? ??? ??, Autogrow ?????? ???? ??? errorlog ??? ??? ??? 30 ????? ?? ???? ???? ??? Ideally, Autogrow ?????? ?? ????? ?? ??? ??? ????? ???? ???? ?????, ?? ?? ????? growing ?? ?????? penalty ?? ???? ?? ??? ????? prudent ?????? ?? ????? ???? ?????? ?? ??? ??????? ???? ?? ??? ?? autogrow 10 ??????? ??????? ??? ??? ???? ???? ?? ??????? ???? ?? ??????? ??? Autoshrink ?? ??? ??????? ?? ?? filegroup ??? ?? ???? ?? ?? ???? ???? allocations ?? ??? ?? ??????? ?? ???? ??????? ?? filegroup ??? ???? ???? ???? |
| ????? TRACE_CONTROLLER TRACE_IO_SYNC | ?? Latch_XX latches profiler ????? ???????? ??? ????????????? ?????????? ?? ??? held ?? ??? ???? Sychronization ???????? ????? ??????? ????, ?????, ????? ?????? ??? ????, ?? ???? ?? ????? ?????????? ???? ?? ??? ??? | ???? ?? ?? ??? profiler traces ?? ????? ????? ?? ?? ??? ??? ?? ?? ???? profiler ????? ?? ??? ?? ???? ?? ?????? ????? ?? ??? profiler ????? ??????? ???? ??? ??, ????? ????????? ????? ??? ??? ??? ?? ??? ??? ??, ?? ????? ?? ???? ????? ?????? SQL ?????? ???????? ??? ?????? traces ????? ?? ????SELECT * FROM ::fn_trace_getinfo(NULL) |
| PARALLEL_PAGE_SUPPLIER | ?? Latch_XX latches ???? ?? ??? ?????? ?????? ?? ??? ??????? ?? ?????????? ???? ?? ??? ????? ???? ???? ??? ?? latch ????? ???? ?? ?? ?????? ?????? ??? ?? ??? ?? ?? ??????? ???? ?? ???? | ?????? ???? ??? waittime ????? ?? ?? ???? ??? ??, ?? ?????? poorly ?? ??? ??? |
| IDES | IDES latch waitresource ????? ???? ???? ?? ?? PFS ????? ????? ????? ?????? ?? ??? ????? ???? ?? ?? ?? PFS ????? allocations ?? ??????? ?? deallocations ?? ??????????? ???? ?? ??? ?????? ??? ??? ????? ?????? ???? ?? ??? ???? ?????? ???????? ??? ?? ?? latch ?? ????? ??? ??? | ????????? ???? ?? ???? ??? question ???????? ?? ??? ????? ??????????? ??? |
???? 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 SPID ???? ?? ??? ???? ?????? ??????? ?? ???????? ???? ?? ??? ???????? ?????? ????????, profiler ?????, fn_virtualfilestats ?????? ???? valued ?????? ?? SHOWPLAN ?????? ?? ????? ??? ?? ???????? i/O ????????? ?? ?????? ?? ????? ???????? ?? i/O ?? ?????? ?????? ?? waittype ??? ???? ???? ?? ?? ???? ??? ?? ??????????? ?? ????? ???? ??? i/O ?? ??, ??? ?????? ??????? ?? ?????, ?? ?????? ???? ?? ??? ?????? |
| ASYNC_IO_COMPLETION | 0x22 | ?? waittype ????? ???? ?? ?? SPID ????? ???? ?? ??? ?????????? i/O ?????? ?? ??? ????????? ?? ??? ??? ????? ???? IO_COMPLETION waittype ?? ??? ?? waittype ?? ?? ?? i/O bottleneck. ?? ??? ???? ??? ?? waittype SPID ?? ??? ???? ???? I/O-????? ???????????, ???? ?? ?????, ??????? ?????, ???????? ???????, ?? ??????? autogrow ?? ?????? ?? waittype ????? bottlenecks ?? ?? ????? ?? ???? ??? |
| RESOURCE_SEMAPHORE | 0x40 | ?? waittype ????? ???? ?? ?? SPID ???? ?????? ?? ????????? ?? ??? ??? ????, SPID ????????: ????????? ????? ?? ?????? ???????? ?? ????? ?????? ???????? ?? ??? ?????? ?? ??????? ???? ?? ???? ?? waittype ?? ????? ?? ???? ?? ?? ?????? ???? ???? ??? ??? ??? ??? ??? ????? ??? |
| DTC | 0x41 | ?? waittype ????? ???? ?? ?? SPID Microsoft ?????? ?????? Coordinator ?? ????????? ?? ??? ?? (MS DTC) ????? |
| OLEDB | 0x42 | ?? waittype ????? ???? ?? ?? ??? SPID ??? ?????? ?? ??? ???? ?? ??? ??? OLE DB ??????? ????? ?? ?? ?????? ???? ?? ???? ???? ?? ??? ?????? ?? ??? ????????? ?? ??? ??? ?? waittype ?? SPID ?????? ???? ?? ???? ???? ?? ??? ?????? ????????? ??? ?? ???? ??? ?? ????? ?????? ?? ??? ????????? ?? ??? ?? ?? ????? ?? ?? ???? ??? SPID ?????? ???? ?? ???? ???? ?? ??? ???? ?????? ??? ???????? ???? ???? ?? ????? ??? ?????? ?? ??? ??????????? ?? ???? ?? ???? ?? ???? ???
OLEDB waittype several ????? ????????? ??????, ?????? ????? ???? ?? ??? ????? ???? ???? ??: ????? ????????, ?????-??? ??? ????????, ???? ?????? ??? ???????? ???? ????, ???????-???? Profiler traces, ?? ??? sysprocesses ??????, ??? ???? ?? DBCC CHECKDB ??????? ???????? materialization ?? ???? ?? ??? |
| RESOURCE_QUEUE | 0x44 | ?? SQL ????? ??? ??????? ?? ????????? ?? ??? ?? ??????? ? ????????? ? ?????? ??? |
| ASYNC_DISKPOOL_LOCK | 0x45 | ?? ?? waittype ???? ?????, ??????? ????, ?? ???? ??????? ????? ?? ?????? ???? ???? I/O-????? ??????????? ?? ????? ????? ?? ???? ??? |
| UMSTHREAD | 0x46 | ?? waittype ????? ???? ?? ?? ?? ??? ?? ??????? ????????? ?? ??????? ???? ??? ?? ????? ?? ??? ?? ?????? ???? ?? ??? ?????? ????? ????? ???? ??? ??? ?? consistently ????? 0x0046 waittypes ?????? SPID ?? ???, ?? ?????????? bottleneck elsewhere ??? ?? ?????? ?? ?? ??? ?????? ????? ????? ?? ????? ?? ??? ??? ?? ???waittime????? UMSTHREAD waittype ?? ??? 0 ????? ?? ??lastwaittype????? ?? ???? ?? erroneously ?????? UMSTHREAD ?? ????? ?? ?? ????? waittype ?? ???." |
| WRITELOG | 0x81 | ?? waittype ????? ???? ?? ?? SPID ????? ???? ?? ??? ????????? ??? i/O ?????? ?? ??? ????????? ?? ??? ??? 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. Thesp_configure ?cursorthreshold?configuration 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 | ?? waittype ????? ???? ?? ?? SPID ?? ???? ??? WAITFOR ????? Transact-SQL sleeping ?? ???? |
| NETWORKIO | 0x800 | ?? waittype ????? ???? ?? ?? SPID SPID ??????? ????????? ?? ??? ?? ???? ?????? ?? ??? ???? ?? ???? ???? ?? fetch ???? ?? ??? ??????? ????????? ?? ??? ????????? ?? ??? ??? |
???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
244455
(http://support.microsoft.com/kb/244455/
)
SQL Server 7.0 ?? ??? sysprocesses waittype ?? lastwaittype ????? ?? ????????
?? ???? ??? ???????? ??????? ?? ???
master.dbo.sysprocessesSQL Server 2000 ??? ?????? ???? ?? ????? Microsoft ??? ???? ?? ????:
??? SQL Server 2000 latches ?? ???? ??? ???? ??????? ?? ??? ????? Microsoft ??? ???? ?? ????:
???? ID: 822101 - ????? ???????: 05 ?????? 2010 - ??????: 2.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 Server 2005 Enterprise Edition
- Microsoft SQL Server 2005 Workgroup Edition
| kbsystemdata kbfield kbdatabase kbinfo kbmt KB822101 KbMthi |
???? ?????? ??????????????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:
822101
(http://support.microsoft.com/kb/822101/en-us/
)