in

UGISS Community

Il sito della community dello User Group Italiano di SQL Server

Errori rilevati da DBCC CHECKDB

Last post 12-17-2007 19.36 by sgovoni. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-14-2007 9.14

    • sgovoni
    • Top 10 Contributor
      Male
    • Joined on 10-18-2007
    • Posts 171
    • Points 2.635

    Errori rilevati da DBCC CHECKDB

    Ciao a tutti,

    mi trovo in questa situazione: il comando DBCC CHECKDB eseguito su un database (di produzione che lavorava con SQL Server 2000) rileva questi errori:

    Server: Msg 8905, Level 16, State 1, Line 1
    Extent (1:1217784) in database ID 8 is marked allocated in the GAM, but no SGAM or IAM has allocated it.
    DBCC results for 'DBA2'.
    CHECKDB found 1 allocation errors and 0 consistency errors not associated with any single object.
    DBCC results for 'sysobjects'.

    ........

     

    Server: Msg 8978, Level 16, State 1, Line 1
    Table error: Object ID 1017144952, index ID 1. Page (1:208) is missing a reference from previous page (1:1217788). Possible chain linkage problem.
    Server: Msg 8976, Level 16, State 1, Line 1
    Table error: Object ID 1017144952, index ID 1. Page (1:1217784) was not seen in the scan although its parent (1:1010393) and previous (1:1217559) refer to it. Check any previous errors.
    Server: Msg 8980, Level 16, State 1, Line 1
    Table error: Object ID 1017144952, index ID 1. Index node page (1:1010393), slot 210 refers to child page (1:1217785) and previous child (1:1217784), but they were not encountered.
    Server: Msg 8980, Level 16, State 1, Line 1
    Table error: Object ID 1017144952, index ID 1. Index node page (1:1010393), slot 211 refers to child page (1:1217786) and previous child (1:1217785), but they were not encountered.
    Server: Msg 8980, Level 16, State 1, Line 1
    Table error: Object ID 1017144952, index ID 1. Index node page (1:1010393), slot 212 refers to child page (1:1217787) and previous child (1:1217786), but they were not encountered.
    Server: Msg 8980, Level 16, State 1, Line 1
    Table error: Object ID 1017144952, index ID 1. Index node page (1:1010393), slot 213 refers to child page (1:1217788) and previous child (1:1217787), but they were not encountered.
    Server: Msg 8978, Level 16, State 1, Line 1
    Table error: Object ID 1017144952, index ID 33. Page (1:359487) is missing a reference from previous page (1:1059923). Possible chain linkage problem.

    CHECKDB found 0 allocation errors and 7 consistency errors in table 'MAG_' (object ID 1017144952).
    ....

    DBCC results for 'GIA_'.
    Server: Msg 8956, Level 16, State 1, Line 1
    Index row (1:894614:285) with values (ART = 23637 and MAG = 5 and COD = 0 and ID = 146568) points to the data row identified by ().
    Server: Msg 8952, Level 16, State 1, Line 1
    Table error: Database 'DBA2', index '_IDX001' (ID 1189579276) (index ID 2). Extra or invalid key for the keys:
    .....
    e termina con

    CHECKDB found 1 allocation errors and 15 consistency errors in database 'DBA2'.

    Pensavo a queste soluzioni:

    1. Restore di un database vuoto, eliminazione di tutti i vincoli di integrità referenziale, copia dei dati dal database rovinato al database vuoto tabella per per tabella e applicazione delle integrità referenziali sul database in cui sono stati copiati i dati
    2. Utilizzo di repair_allow_data_loss, ma temo la perdita di dati
    3. ???

    Il recovery model del DB è Simple e ho i backup dei giorni scorsi

    Avete atri suggerimenti ?

    Una volta recuperato il database ricercare il problema a monte ossia nell'hardware.

     Grazie, ciao

    Sergio

    Filed under: ,
    • Post Points: 20
  • 12-17-2007 18.50 In reply to

    • dmauri
    • Top 10 Contributor
      Male
    • Joined on 05-14-2007
    • Novate Milanese
    • Posts 1.179
    • Points 15.440

    Re: Errori rilevati da DBCC CHECKDB

    sgovoni:
    Avete atri suggerimenti ?

    Si, prima di passare alle maniere drastiche prova a ricostruire gli indici. Non credo che la cosa ti possa aiutare ad esser sincero visto che hai degli errori sull'indexid = 1 che rappresenta l'indice cluster, ossia la tabella stessa. Cmq un tentativo lo farei.

    Evita fino a che ci sono altre speranze (I backup Smile) l'opzione 2.

    Se i backup sono buoni ed il database è grosso ti consiglio di provare ad effettuare dei page-level restore che ti aiuta a diminuire di molto di tempi di restore.

    L'opzione 1 la puoi fare nel modo migliore con un tool come il Red Gate Data Compare oppure con Visual Studio DB PRO.

     

     

    Davide Mauri
    Microsoft MVP - SQL Server, MCP, MCAD, MCDBA, MCT - http://www.davidemauri.it
    Socio Fondatore e Mentor di Solid Quality Learning Italy - http://www.solidq.com
    Presidente di UGISS: User Group Italiano Sql Server - http://www.ugiss.org
    • Post Points: 20
  • 12-17-2007 19.36 In reply to

    • sgovoni
    • Top 10 Contributor
      Male
    • Joined on 10-18-2007
    • Posts 171
    • Points 2.635

    Re: Errori rilevati da DBCC CHECKDB

    Alcuni errori (7) si sono risolti con la ricostruzione indici DBCC DBREINDEX() della tabella incriminata. Sto provando a ricostruire gli indici anche sulla tabella in cui c'è l'errore nell'IndexID = 1 ma la ricostruzione ci sta mettendo parecchio tempo (la tabella coinvolta è una della più popolate).

    Ti faccio sapere come va a finire... nel frattempo inizio a dare un'occhiata al tool che mi hai suggerito.

    Grazie, ciao

    Sergio 

    • Post Points: 5
Page 1 of 1 (3 items)
(C) 2007 User Group Italiano di SQL Server