Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια
σε

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

SQL 2000 index corruption

Îåêßíçóå áðü ôï ìÝëïò dimkasta. Τελευταία δημοσίευση από το μέλος dimkasta στις 12-04-2006, 19:38. Υπάρχουν 3 απαντήσεις.
Ταξινόμηση Δημοσιεύσεων: Προηγούμενο Επόμενο
  •  10-04-2006, 10:45 11745

    SQL 2000 index corruption

    Καλημέρα σε όλους.

    Αντιμετωπίζω ένα πρόβλημα με κάποιες εγγραφές σε έναν πίνακα. Όταν πάω να τις ανοίξω, παίρνω σφάλματα. Το dbcc checkdb επιστρέφει σε μερικές περιπτώσεις:

    Server: Msg 8956, Level 16, State 1, Line 1
    Index row (1:18449:58) with values (ReqID = 6356 and StepID = 49251) points to the data row identified by ().

    σε δύο πίνακες.

    Η λύση που μου προτείνανε είναι η παρακάτω:

    This error occurs when the non-clustered index indicated by the index ID is corrupt. The corruption is detected when a process tries to delete a nonexistent row. This is synonomous with an error 644. Refer to SQL Books Online also for more information.

     Execute DBCC CHECKDB without a repair clause to determine the extent of the damage. Then, execute DBCC CHECKDB with REPAIR_REBUILD clause to correct the damage. If problems persist, either drop and re-create the index (as shown below) or export data out of database, recreate the objects, and import data back in.

     To drop and re-create the index:

     1. Record the value of index page and index ID specified in the error text. 

    2. Identify which table and index correspond to the index page number. 

    3. Note the object ID.

    If the object with the error is a system table (the object ID is less than 100), you cannot drop the index. Execute DBCC CHECKDB with the REPAIR_REBUILD clause or restore the database from a known clean backup.

    4. If the object ID is greater than 100, drop and re-create the index using the table name and index name obtained in Step 1. In most cases, this will clear the corruption. 

    5. Execute DBCC CHECKDB with the REPAIR_REBUILD clause on the affected database to verify that all problems have been resolved. 

    Υπάρχουνε τίποτα πράγματα που πρέπει να προσέξω όταν το κάνω αυτό. Χρειάζεται να το δοκιμάσω σε τέστ περιβάλλον ΄΄η είναι ασφαλές? Υπάρχει μήπως κανένας πιο ασφαλής τρόπος? Επίσης θα έχει τίποτα επιπτώσεις στην χρήση της εφαρμογής από τους χρήστες?

    Ευχαριστώ εκ των προτέρων


    Simple Photography
  •  10-04-2006, 17:05 11756 σε απάντηση της 11745

    Απ: SQL 2000 index corruption

    Εγώ, σε κάτι τέτοια, είμαι παραδοσιακός τύπος. Θα έκανα export τα data σε πίνακες με ίδιο schema, σε άλλη βάση και μετά drop τους πίνακες. Κατόπιν, recreate τους πίνακες (χωρίς indexes), import τα δεδομένα και create indexes.

    Βέβαια, το θέμα που θα πρέπει να σε προβληματίσει είναι το πως δημιουργήθηκαν αυτά τα corrupted indexes. Είναι καινούργιοι οι δίσκοι; Έχουν συμβεί τίποτα διακοπές ρεύματος (αν και πάλι ο SQL Server έχει το recovery για να μπορεί να αντιμετωπίζει τέτοιες καταστάσεις); Μήπως να κάνεις ένα surface scan για bad sectors;
    Vir prudens non contra ventum mingit
  •  12-04-2006, 16:11 11832 σε απάντηση της 11745

    Απ: SQL 2000 index corruption

    Συνήθως το DROP INDEX διορθώνει την κατάσταση , καλό θα είναι πάντως ναι έχεις και BACKUP αν τρέξεις DBCC CHECKDB με REPAIR_REBUILD.
    Sex is like programing; One mistake, and you will have to support it for the rest of your life…
  •  12-04-2006, 19:38 11838 σε απάντηση της 11832

    Απ: SQL 2000 index corruption

    dbcc dbreindex(tablename, '',70)

    και το πρόβλημα λύθηκε χωρίς πρόβλημα και κίνδυνο.

    Αναλαμβάνει να κάνει μόνο του όλα τα drοp και create.

    Καλού κακού ένα backup και εκτέλεση σε ώρα που δεν χρησιμοποιείται η εφαρμογή είναι πάντα οφέλιμα...

    Πολύ χρήσιμο ειδικά για καταστάσεις που δεν είστε εξοικειωμένοι με το σχήμα
    Simple Photography
Προβολή Τροφοδοσίας RSS με μορφή XML
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems