URGENT:Indexes removed

  • Guys,

    I've come across a problem at one of ourr sites.

    Every single index (about 200) has been dropped from a database and several primary keys have been dropped.

    now i'm pretty sure it's someone who's run some stupid optisation tool or someother and it's failed before it starts creating new indexes.

    has anyone seen this as a bug?

    MVDBA

  • HI,

    Do restore an old copy as a new database and Get the Key information from the System Tables and run in the Db where its missing. Thats all i see as a solution.

    You can refer SysIndexes,SysForeignkeys,SysObjects tables to Create the Indexes and the foreign keys Script for the missing one.

    Else try Redgate. Its a  good one is such scenarios.

    Jeswanth

     

    --------------------------------

  • If optimization job was used, it would drop and create indexes table by table and in one big transaction. If anything fails, it should roll back. 

  • This sounds more like someone may have done it on purpose - they may not have intended those results.  As Azzam said, any optimisation would rollback if it failed.

    -SQLBill

  • Hello Mike,

    There may be an easier way but I would take the simple old fashioned approach. Restore a backup under a different name. Script the indexes. Chop everything else out of the script and apply it to your production database.

    Best wishes,

    Barry O'Connell

  • fortunatley as part of all upgrade work we do for that customer we always script out the database design in case we need to make changes

    so i've got a script with every index and key for the database.

    it almost looks like someone was useing a tuning appllication that has disconnected from the database mid process, but...... I can't prove it and the customer wants me to investigate if it's a bug rather than deliberate or stupidity....

    go figure, they'd rather blame it on a bug than slap someones wrist!!!

    MVDBA

  • I feel the discussion is leading to a wrong way. Instead of discussing the ways to retrieve the db to a proper shape it’s ridiculous to post such allegations against his own colleagues in such a nice forum. It should have limited to the company it self and only the technical part should have posted here.

    I feel even if some one has done it purposefully, the person were able to do because of the inefficient security policy of the organization.

    This discussion has only brought the way this company works. it didnt help any one in any way..

    Interestingly i happend to see this script just before the day this post appeared may be some one tried this script and it crashed in between

    http://www.sqlservercentral.com/scripts/contributions/1541.asp

    and there was no transactions to handle the crisis.

    Jeswanth

    --------------------------------

  • funnily enough thats my script!!!!

    i know you're all jumping to conclusions here...... but i post a lot of scripts!!! and this one has been no-where near that particular customer...

    the issue isn't with security.. unfortunatley.. we know thats poor, but it's not our server, we're just the consultants trying to dig a customer out of a mess.

    and yes we are deviating from the point which was "IS THERE A KNOWN BUG OR HAS ANYONE EXPERIENCED ANYTHING SIMILAR???"

    this would be really helpfull if you have, as we already know how to rebuild the database.

    and by the way - we've disected the transaction log backups with both LOG PI and APEX and there's no trace of a drop index or alter table in sight.. I've also tried deleete from sysindexes and sysobjects, but still nothing.

    Cheers guys

    MVDBA

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply