FIX: ????? ????? ???????? "?????? ?????? ?????" ??? ???? ???? ??? ????? ?????? "????? ????????" ?? SQL Server 2008

?????? ????????? ?????? ?????????
???? ???????: 970014 - ??? ???????? ???? ????? ????? ??? ???????.
Microsoft ?????? ????????? Microsoft SQL Server 2008 ???? ???? ??????? ???????. ??? ????????? ???????? ????? ?? ????? ???? ???? ????????? ??????? ????? ???? ??????? ?????? ???? ?? ??????? ?? SQL Server 2008 ??????? ???????.
????? ???? | ?? ????

???????

?? Microsoft SQL Server 2008 ??? ????? ???? "????? ????????" ? ????? ?????? "????? ?????? ????????" ????? ??? ???? ???? ?? ?? ?????? ????? ?????.

???????? ??? ???? ?? ???? ????? ??????????? ??????? ??? ???? ?????? ????? ?? ???? snapshots.notable_query_plan ?? snapshots.notable_query_text:
SELECT COUNT(*)
FROM snapshots.notable_query_plan AS qp 
        WHERE NOT EXISTS (
            SELECT * 
            FROM snapshots.query_stats AS qs
            WHERE qs.[sql_handle] = qp.[sql_handle] AND qs.plan_handle = qp.plan_handle 
                AND qs.plan_generation_num = qp.plan_generation_num 
                AND qs.statement_start_offset = qp.statement_start_offset 
                AND qs.statement_end_offset = qp.statement_end_offset 
                AND qs.creation_time = qp.creation_time);
SELECT COUNT(*)
FROM snapshots.notable_query_text AS qt
WHERE NOT EXISTS (
            SELECT * 
            FROM snapshots.query_stats AS qs
            WHERE qs.[sql_handle] = qt.[sql_handle]);

?????

????? ????? ????? ??? ??? ???????? ???? ?????? ?? ????? ???? ?????. ??? ???? ?????? ??? ????????? ??????? ?? ????????? ?? ?????? ?? ????? ???? ?????. ????? ?? ??? ??? ??? ?????? ?????? ????? ????? ???.

????

SQL Server 2008

??? ??? ??????? ????? ??? ??? ??? ?????? ???? ????? SQL Server 2008.

?? ????? ??????? ????? ???? ??????? ????? ?? 6 ??????? ????????. ????? ?? ????????? ??? ????? ?????? ??? ???? ??????? ???????? ??? ?? SQL Server 2008 ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
971490???? ??????? ???????? 6 SQL Server 2008
?????? ??? ????????? ???????? ????? ?? ????? ????? ???? ???? ????????? ??????? ????? ???? ??????? ?????? ???? ?? ??????? ?? SQL Server 2008 ??????? ???????. ???? ???? ???????? ????? ???? ????? ??????? ???? ????? ??? ??? ??????? ??????. ????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
956909???? SQL Server 2008 ???? ?? ??????? ??? ????? SQL Server 2008

SQL Server 2008 ?????? ????? ?????? Service Pack 1

??? ??? ??????? ????? ??? ??? ??? ?????? SQL Server 2008 ?????? ????? ?????? Service Pack 1.

?? ????? ??????? ????? ???? ??????? ????? ?? ??????? ???????? 4 ?? SQL Server 2008 ?????? ????? ?????? Service Pack 1. ????? ?? ????????? ??? ???? ??????? ???????? ??? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
973602???? ??????? ???????? 4 SQL Server 2008 ?????? ????? ?????? Service Pack 1
?????? ??? ????????? ???????? ????? ?? ????? ????? ???? ???? ????????? ??????? ????? ???? ??????? ?????? ???? ?? ??????? ?? SQL Server 2008 ??????? ???????. ???? Microsoft ?????? ????? ???? ????? ??????? ???? ????? ??? ??? ??????? ??????. ????? ?? ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
970365???? SQL Server 2008 ???? ?? ??????? ??? ????? SQL Server 2008 ?????? ????? ?????? Service Pack 1
Microsoft SQL Server 2008 ??? ????? ????????? ??????? ??? ???? SQL Server ?????. ??? ????? ??????? ???? SQL Server 2008 ?????? ????? ?????? Service Pack 1 ??? ????? SQL Server 2008 ?????? ????? ?????? Service Pack 1. ???? ???????? ??? ????? ????????? ??????? ???????? ?? ???? ???? ?? SQL Server ?? ???? ???? ?? SQL Server ???????.

???? ??????

To work around this problem, use the following scripts in the Management Data Warehouse database to delete these orphan rows:
-- Purge snapshots.notable_query_plan table 
DECLARE @delete_batch_size bigint;
    DECLARE @rows_affected int;
    SET @delete_batch_size = 500;
    SET @rows_affected = @delete_batch_size;
    WHILE (@rows_affected = @delete_batch_size)
    BEGIN
        DELETE TOP (@delete_batch_size) snapshots.notable_query_plan 
        FROM snapshots.notable_query_plan AS qp 
        WHERE NOT EXISTS (
            SELECT * 
            FROM snapshots.query_stats AS qs
            WHERE qs.[sql_handle] = qp.[sql_handle] AND qs.plan_handle = qp.plan_handle 
                AND qs.plan_generation_num = qp.plan_generation_num 
                AND qs.statement_start_offset = qp.statement_start_offset 
                AND qs.statement_end_offset = qp.statement_end_offset 
                AND qs.creation_time = qp.creation_time);
        SET @rows_affected = @@ROWCOUNT;
        RAISERROR ('Deleted %d orphaned rows from snapshots.notable_query_plan', 0, 1, @rows_affected) WITH NOWAIT;
    END;

    -- Purge snapshots.notable_query_text table
    SET @rows_affected = @delete_batch_size;
    WHILE (@rows_affected = @delete_batch_size)
    BEGIN
        DELETE TOP (@delete_batch_size) snapshots.notable_query_text 
        FROM snapshots.notable_query_text AS qt
        WHERE NOT EXISTS (
            SELECT * 
            FROM snapshots.query_stats AS qs
            WHERE qs.[sql_handle] = qt.[sql_handle]);
        SET @rows_affected = @@ROWCOUNT;
        RAISERROR ('Deleted %d orphaned rows from snapshots.notable_query_text', 0, 1, @rows_affected) WITH NOWAIT;
    END;

?????

???? Microsoft ?? ??? ????? ?? ?????? Microsoft ??????? ?? ??? "????? ???".

?????

????? ?? ????????? ??? "????? ????? ??????" ?? SQL Server ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
935897????? "????? ????? ??????" ?? ???? SQL Server ?????? ????????? ??????? ??????? ?? ??????? ????


????? ?? ????????? ??? ???? ??????? ???????? SQL Server "? ???? ??? ??? ??????? ?????? ?????? ??" ????? ??????? ?? Microsoft:
822499???? ????? ????? ??? ??????? ????? Microsoft SQL Server


????? ?? ????????? ??? ??????? ????? ??????? "? ???? ??? ??? ??????? ?????? ?????? ??" ????? ??????? ?? Microsoft:
824684??? ????????? ???????? ????????? ?? ??? ??????? ????? Microsoft

???????

???? ???????: 970014 - ????? ??? ??????: 28/???/1430 - ??????: 1.1
????? ???
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Workgroup
????? ??????: 
kbmt kbsurveynew kbexpertiseadvanced kbqfe kbfix KB970014 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????970014

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

 

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