Making database Corrupt on purpose

  • Running Win XP, SQL 2000 Dev Sp3a

    I'm currently playing around creating my "GRAND" database maintenance system.

    So far everything runs fine, I run all the DBCC checks, backup the database, reports any errors, etc...

    One problem I do have is, how do I know the error handling/reporting for my DBCC checks works correctly?

    Does anyone know how I can make a database corrupt so that DBCC reports an error?

    I've already tried replacing the log file in the midst of a transaction. This gives me the following,

    Error: 9003, Severity: 20, State: 1

    The LSN (5:282:9) passed to log scan in database 'corrupt' is invalid..

    Error: 3414, Severity: 21, State: 1

    Database 'corrupt' (database ID 11) could not recover. Contact Technical Support..

    Upon resetting the database status and restarting I get,

    Starting up database 'corrupt'.

    Bypassing recovery for database 'corrupt' because it is marked SUSPECT.

    But when I run DBCC CHECKCATALOG I get the following,

    Server: Msg 926, Level 10, State 1, Line 1

    Database 'corrupt' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information.

    Any ideas welcome.

    --------------------
    Colt 45 - the original point and click interface

  • This was removed by the editor as SPAM

  • Do a forum search.

    I asked the same question some months ago and got an interesting script. But Mr. Murphy came right in so I can't find it anymore.

     

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 3 posts - 1 through 2 (of 2 total)

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