• GilaMonster (2/27/2014)


    No good news then.

    The DB is damaged in such a way that CheckDB can't run, that makes the corruption irreparable. At this point I'd normally say 'restore from backup', but...

    The DB can't be fixed, you're going to have to recreate it.

    Script all objects from the damaged database. Don't forget permissions, constraints, indexes, etc. Some objects may well fail to script. Get what you can.

    Export all data out. BCP out is probably a good option. Some tables will almost certainly fail. You may have to export tables in chunks, range filters on the clustered index key to avoid reading damaged pages. Get what data you can.

    Assuming you can get anything at all out, use the scripts and exported data to create a new DB. This will not be quick, likely days of work.

    Once you've got the new DB up, get a backup strategy in place and point out to the customer (politely), that all of this work could have been avoided if they'd had backups.

    Additionally... Corruption doesn't just happen for no reason. There's likely something wrong somewhere in the IO subsystem. Do your investigations, check logs, update drivers, update firmware, etc, etc. Otherwise this could all happen again in a few months.

    thanks, but I think the problem is worse than that

    when I try to generate script, nothing to get

    when I try to export data, same message 'SQL Server detected a logical consistency-based I/O error' again

    when I expand folder table and store procedure, all gone

    I must find another way to export data, please let me known if you have any idea

    Is this solution worth to try ?

    kenneth.mofokeng (2/26/2014)


    Since you don't have backup , try to repair the database,

    TRY

    ALTER DATABASE corrupted_db SET SINGLE_USER WITH ROLLBACK IMMEDIATE

    DBCC ChECKDB ('corrupted_db', REPAIR_ALLOW_DATA_LOSS)

    ALTER DATABASE corrupted_db SET MULTI_USER

    CAUTION : There is a high chance of data loss

    If you mange to get database online, make sure you implement database backup strategy