Tempdb ??????? ?? ??? concurrency ?????????????

???? ?????? ???? ??????
???? ID: 328551 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
BUG #: 362099 (SHILOH_BUGS)
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

?????

??tempdb??????? ???? ????? ???? ???? ??, SQL Server contention ????? ?? ???? ?? ?? ??????? ?? ?????? ???? ?? ?????? ???? ???

??sysprocesses?????? ???? ?????? waitresource ?? ???? ?? ?????? ?? ??? ??? "2: 1: 1" (PFS ?????) ?? "2: 1: 3" (SGAM ?????)? Contention ?? ??? ??, ?? ???? ?? ?? ?? ???? ?? ?? ??????? ?? ???? ??????? ?????????? appearing SQL ????? ?? ????


?? ???????? ???? ?? ????? ????tempdb:
  • ????? ?? (??????? ?? ???????) ?? ??????? ????? ???????? ?????? ???
  • ?????? ?? ?? ????? ???? ???tempdb?????? ?? ???????? ?? ????
  • ????? ?? ??????? ???????? ??? ?????
  • ORDER BY ??? ?? ?? ??????? ???????? ??? ?????
  • ????? ???????? ?? ?? ???? BY ??? ?? ??? ?????? ???
  • ??? ????? ?? ??????? ??????? ?? ??? ?????
?? ?????????? ?? ???? ?? ?????????? ????? contention ???????? ?? ??? ?? ?? ???? ???

????

???????? ?? ???????, ?? ????? ?? (2) ????? ?????? ??? ??????? ???? ?? ?????? ?? ?? ???????? ?? ????? ???? ???? ?? ????? ?? ??????????? ?? ??? ????? ??? (IAM), ?? ????? ?? ???????? ?? ??? ???? ????? ?? ???? SQL ????? ???? ??????? ????? ??? (SGAM) ?? ????? ???? ????-???? extents ????? ?????? ???????? SGAM ????? ????? ?? ???? ???? 4 ?????????? ???

????-???? ???? ?? ?? ??? ?? ?????? ?? ??? ?? ??? ??? SQL ????? ????? ????? ????? (PFS) ????? ?? ????-???? ????? ??? ?? ?????? ???? ?? ??? ????? ?? ?? ????? ?? ??? ????? ???? ?????? PFS ????? ?? ???????? ????? ?? ?????? ????? ????? ?? ????? ???? ??, ?? ???????? PFS ????? ???? 8000 ????? ????? ????? PFS ?? SGAM ??????? ???; ??? ???????? ???? ?? ??? ??????? ????????????? ???? ?? ?? ???? ??????? ?? ??? ?? ???? modifiers stall ?? ???? ????

SQL ????? ?????? ???? ?? ??? ??? ??????? ????? ?? ??? ??? ???? ??, ?? ?? ????? ??????? ????? ?? ?? ????? ?? SGAM ????? ?? ??? ?? ?????? SGAM ????? ?? intense contention ??? ?? several ??????? ????? allocations underway, ??? ?? ?? ???? ?? "?????" ??? ??? ????? ???????? ???? ?? ???? ????

???:De-allocation ?????????? ?? ??????? ?????, ???? ??? contention ???? ?? ??? ?????? ?? ???? ??? ?? ?? ???? ?????

????? ????? ??????? SQL ????? (SGAM, GAM, PFS, IAM) ?????? ????? ?? ???? ??? ???? ????? ?? ??? ?? ???? ?? "??????" ??? ??????

????????

?? ??? ????? ?????? contention ?? ?? ???? ?? ???tempdb?? ???? ????? ?? ??? ??, ?? ??? ????? ?? ???? ????:
  1. ????? ?? SQL Server 2000 ?????? ??? 3 (SP3) ??? ??? ???, ?? ??? ???????? ???? 8.00.0765 ??? ?? ?????? ??????? ??? 8.00.0818? ????? ?? SQL Server SP2 ??? ??? ???, ?? ??? 8.00.0702 ???????? ?? ???? ?????

    ?? ??????? ????? ????? ?? ?????? ???:

    8.00.0765
    814916FIX: ??? ?????? ??? ?? ??????? ?? ??? ???? ????? ???? ?? ???? ??
    8.00.0818
    HTTP://www.Microsoft.com/technet/Security/bulletin/MS03-031.mspx
    8.00.0702
    328551FIX: tempdb ??????? ?? ??? Concurrency ?????????????
  2. ????? ???? ??????????? ????-T1118.

    ???:???? ?? ??? ?????-T1118?? ?? ?? Microsoft SQL Server 2005 ?? SQL Server 2008 ??? ??????? ?????? ??? ???????, ??? ?? SQL Server 2005 ?? SQL Server 2008 ??? ??? ???, ?? ???? ??? ???? ??? ???????? ?? ???? ???? ?? ????
  3. ?? ?????? ?????tempdb???? ?????? ?????????? ?? ?????? ?? ?? ?? ?? ????? ??? ???? ???? ?? ??? ??, ??????? ?????? ???? ??????? ?? ???, "?? ???????" ??? ?????..
???:?? ????? Microsoft SQL Server 7.0 ???? ?? ??? ?? ???? ????? ??????? ????? ?? ?? ?? SQL Server 7.0 ?? ??? ??? ????????; ?????, ??? 1 ???? ???? ???? ???

?? ??? regard ??? 2, ????? ???? - Microsoft SQL Server 7.0, ?? ??? T1118 ?? ????? ???? ?? ???? ?? ????? ???? ?? ????? ????, ????? ?? ????? ???? ?? Microsoft ???????? ??? ?????:
813492FIX: ????? ??????????? ???? SQL Server 7.0 ?? ?? ????? ???? 1118 ????? ??

?????? ??? ???????

?? ?????? ?? ?? ???? ?? ??? Microsoft SQL Server 2000 ?? ??? ?????? ?????? ??? ??????? ????? ???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
290211?????? SQL Server 2000 ?????? ??? ?? ??????? ???? ?? ??? ???? ????

???????? ???????

???????? 8.00.0702

?? ????????? ?? ????????? ??????? ??? ?? ????? ????????? (?? ??? ?? ????? ?????????) ??? ?? ????? ?????? ??? ???????? ???.. ?? ??????? ?? ??? ?????? ?? ???, ??????? ????????? ??? (UTC) ??? ???????? ??.. ?? ?? ????? ??????? ????? ???, ?? ?? ??????? ??? ??? ?????? ???? ???? ??.. "UTC ?? ??????? ??? ??? ???? ????? ?? ???, ???????? ??? ??? ""?????? ?? ??? ???"" ??? """"??? ???????"" "??? ????????? ?? ??????????? ???? ??? ???? ???
   Date         Time   Version         Size       File name
   ----------------------------------------------------------------
   30-Aug-2002  21:08                    786,432  Distmdl.ldf
   30-Aug-2002  21:08                  2,359,296  Distmdl.mdf
   09-Oct-2002  00:54                        544  Drop_repl_hotfix.sql
   02-Jul-2002  15:35  2000.80.650.0     107,088  Impprov.dll      
   19-Jul-2002  16:56                    774,516  Instdist.sql
   08-Oct-2002  23:56                     12,615  Inst_repl_hotfix.sql
   20-Aug-2002  16:24  2000.80.679.0     111,172  Logread.exe      
   07-Apr-2002  02:08  2000.80.606.0      62,024  Odsole70.dll     
   03-Jan-2002  01:59                     18,185  Qfe356326.sql
   20-Aug-2002  16:47  2000.80.679.0     135,748  Qrdrsvc.exe      
   26-Aug-2002  22:49  2000.80.679.0     406,088  Rdistcom.dll     
   04-Oct-2001  01:36                    437,302  Replcom.sql
   20-Aug-2002  16:33  2000.80.679.0     152,136  Replmerg.exe     
   19-Nov-2001  20:36                    993,945  Replmerg.sql
   05-Nov-2002  23:48  2000.80.700.0     221,768  Replprov.dll     
   04-Oct-2001  01:36                    986,906  Replsys.sql
   04-Oct-2001  01:36                    881,228  Repltran.sql
   26-Aug-2002  22:49  2000.80.679.0     283,208  Rinitcom.dll     
   16-Sep-2002  22:31                    390,045  Securityhotfix.sql
   26-Aug-2002  22:49  2000.80.679.0      28,672  Sqlagent.dll     
   26-Aug-2002  18:39  2000.80.679.0     311,872  Sqlagent.exe     
   28-Aug-2002  16:32  2000.80.679.0      49,152  Sqlagent.rll
   26-Aug-2002  22:49  2000.80.679.0      53,824  Sqlcmdss.dll     
   28-Aug-2002  16:40  2000.80.679.0      12,288  Sqlcmdss.rll
   24-Oct-2002  17:37  2000.80.695.0     176,696  Sqlmap70.dll     
   11-Nov-2002  09:52  2000.80.702.0   7,471,185  Sqlservr.exe     
   11-Nov-2002  09:51                 12,633,088  Sqlservr.pdb
   01-Nov-2002  18:56  2000.80.698.0      45,644  Sqlvdi.dll       
   01-Nov-2002  18:00  2000.80.697.0      82,492  Ssnetlib.dll     
   07-Apr-2002  02:08  2000.80.606.0      70,208  Xplog70.dll      
   07-Apr-2002  02:08  2000.80.606.0      53,828  Xpqueue.dll      
   07-Apr-2002  02:08  2000.80.606.0     156,228  Xprepl.dll       
   12-Jul-2002  01:00  2000.80.658.0     279,104  Xpstar.dll       
   16-Sep-2002  23:12  2000.80.686.0      98,872  Xpweb70.dll   
				
???
  • ????? ??????????, ?? ?????? ???????? ?? ?????? ??????? ??? ???????? ??????? ?? ?? ???? ???
  • ???????? 8.00.0702 ???? ?? SQL Server 2000 SP2 ???? ?? ???????? ?? ??? ??? ??? ?? SQL Server 2000 SP3 ?? ??????? ???? ??, ?? SQL Server 2000 SP3 8.00.0765 ????? ??????? ????????

??????

Microsoft ?? ?????? ?? ?? ?? ?? ?? Microsoft ???????? ??? ?? ?????? ?? ?? "???? ???? ???? ???" ?????? ???????? ???.. ?? ?????? ?? ???? ???? Microsoft SQL Server 2000 ?????? ??? 4 ??? ??? ???? ??? ???

???? ???????

?? ???? ???????? 8.00.0702 ???? contention

???????? 8.00.0702 introduces ????-???? ????? allocations ?? ??? ??? ????? ????? ?????????? ??? ????? ?? ??? ??????? ????? ?? ???? ???????? ?????? ????-???? ????? ????? ?? ??? ????? (??? ?? ?? ???? ????? ????? ??)? ?? avoids train ?? ??? ???? ??? SGAMs ?? ?????? ?? ?? ??????? ????? ?? ??? ???????? ??? ???? ?? ????? ?????? contention ?????? ??? SGAM ?? ??? ??? ????? ?????????? ????? ?????-????? ??, ?? ??? ???? ???? ?? ??? ???????? ??? honor ???? ??? Microsoft ??????? ???? ?? ?? ?? ?????tempdb???? ???? ?? ??? ???? ???????

Contention ???? ???? - T1118 ????? ??????????? ????? ??

???? ???? ?? ???? ?? ?? ????? ????-T1118contention ?? ?? ???? ??:
  • -T1118???? ?????????-????? ?????? ???
  • ????? ????-T1118SQL ????? ?? ??? ???? ??? ????????? ???????? ????? ?? ????? ???? ?? SQL Server ???? ?? ??? ????????? ????????? ?????
  • -T1118????? ?? ???? ??? ??? ????? allocations ??????? ???
  • ??? ????? allocations ?? ??????? ?? ????? ?? ?? contention SGAM ????? ?? ?? ?????
  • with:-T1118turned ON, almost all new allocations are performed from a GAM page (for example, 2:1:2) that allocates eight (8) pages (1 extent) at a time to a object as opposed to a single page from an extent for the first eight (8) pages of an object, without the trace flag.
  • The IAM pages still use the single page allocations from the SGAM page, even with-T1118turned ON. However, when combined with hotfix 8.00.0702 and increasedtempdbdata files, the net effect is a reduction in contention on the SGAM page. For space concerns, see the "Disadvantages" section of this article.
???:When the trace flag 1118 is turned on for your instance of SQL Server 2000, you may not be able to successfully restore a SQL Server 7.0 database.???? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
837938You may receive an error message when you try to restore a SQL Server 7.0 database backup on an instance of SQL Server 2000

Increase the number of tempdb data files with equal sizing

If the data file size oftempdbis 5 GB, and the Log file size is 5 GB, the recommendation is to increase the single datafile to 10 (each of 500 MB to maintain equal sizing), and leave the log file as is. Having the different data files on separate disks would be good. However, this is not required and they can co-exist on the same disk.

The optimal number oftempdbdata files depends on the degree of contention seen intempdb. As a starting point, you can configure thetempdbSQL ?? ??? ????? ???? ??? ?????????? ?? ?????? ?? ?? ?? ?? ????? ???? ?? ??? ?????? ???? ??? ???????? (?????? ?? ???, ?? 32 16 proc), ?? ??? ????????? ?????? 10 ???? ?? ???? Contention ?? ???? ??, ??? ?? ?? ???? ??????? ?? ?????? ????? ?? ??? ???? ??? ?? ???? ???

???:?? ?????????? ?? ?? ????-??? ???????? ?? ???? ???? ???

???? ?????? ?? ???? ???? ?????????? ?? ??????? ???????? ??? ?????????? ??????? ?? ???? ?? ?????? ??? ??? ???? ?????? ?? ????? ???? ?? ???? ???? ???, ???????? ??? ?????????? ??? ??????? ?? ???, ???? ???? ?? ?? ?? ???? ??????? ?? ????? ?? ???????? defeating allocations spreading ?? ????? ?? ???? ???? GAM allocations ?? ??? ????? ?? ????? ???? ?? ?????? ???? ???

Auto-grow ??tempdb???? ?????? ?? ???????? ??? ?????????? ?? ??? ????????? ?? ???? ???? ?????, ?? ??? ????? ????? ?? ??? auto-grow ?????? ?? ??? ???? ?? ??? ?? ???? ??tempdb???? ??????? ??? auto-grow ?????? ??? ?? ???? ??, ???? ?????? ????????? ???? ?? ????? ?? ??? ????? ????? ?? ?????????? ??? ????? ?? ?? ????? ?? ??? ??? ???????? ??? ???? ???? ?????? ?? ????? ?? ???tempdb.

Contention ???? tempdb ???? ?? ?????? ?? ?????? ??????? ?? ???? ???? ????? ??

???? ?? ???? increasing ?????? ?? ?? ???? ??tempdb???? ?????? ?? ???? ???? ?? ??? contention ?? ?? ???? ??:
  • ?? ??? ?? ???? ???? ?? ???tempdb, ???? ??? ???? ?? GAM ?????, ?? ?? SGAM ????? ????? ?? ???????? 4 GB ?? ????
  • ?? ??? ?? ?? ???? ?? ??? ???? ??????? ?? ?????? ?? ??????tempdb?? ?? ???? GAM ?? SGAM ????? ???? ?? ???????? ????? ?? ??? ??????? ????? ???
  • GAM ?? ??? ????? ?????????? ???? ?? ???? ?? ???? (?? ?????? ???????) ?? ??? ??? ?? ????? ????? ??????? ??? ??????? ?? ?????? ?? ???????? ??? honoring ???? ???? ?????, ??? ???? ??? 10 ????? sized ?????? ???, ???? ????? ??, File1 ?? File2, ?? ????? File3 ?? ??? ??? ?? ??????
  • ?? ????? ??? ??????? ????? ?? ??? ??? ?? ??? ??? ??????? GAM ??????? ?? ?????? ?? ??????? PFS ????? ?? ?????? contention ?? ?? ???

Disadvantages

???? downside ???? ?? ??? ????????? ???? ????? ??? ?? ?? ?? ??????? ?? ???? ????? ????????? ?? ???? ???? ?? ????? ?? ??? ???? ???:
  • ?? ?????????? ?? ?? ?????????? ??????? ??? ???? ???? ????
  • ????????? ?? ??? ?? ?? ?????????? ??? ?????? ?? ?? ?? ?? 64 KB.
??? ?? ????????? ???? ???, ?? ?? 64 KB ?????? ?? ???? ?? (8 ????? * 8 KB = 64 KB) ??? ???????? ???? ???? 8 KB ????? ?? ???????? ???? ??, ?? ??? ?????? wasting ?????? 56 KB. However, if the new object uses more than 64 KB (8 pages) in it's lifetime, there is no downside with the trace flag. Therefore, in a worst case scenario, SQL Server may end up allocating seven (7) additional pages during the first allocation only for new objects that never grow beyond one (1) page.

??????

For more information about GAM, SGAM, PFS, and IAM, see the following SQL Server 2000 Books Online topics:
  • "Managing Space Used by Objects"
  • "Managing Extent Allocations and Free Space"
  • "Table and Index Architecture"
  • "Heap Structures"

???

???? ID: 328551 - ????? ???????: 03 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Personal Edition
  • Microsoft SQL Server 2000 Workgroup Edition
??????: 
kbhotfixserver kbqfe kbsqlserv2000presp4fix kbfix kbbug kbmt KB328551 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:328551

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com