Force Corruption with WRITEPAGE in master database, demo purpose

  • I'm trying to force corruption in my master database. I am able to when I restore the master as another database 'mastercurruption', the put server into single user mode and restore from the mastercurrption database backup, sql server instance shuts down... I take it out of single user, then I start the database instance up and it works, WITH a bunch of corruption

    so i am thinking I am not causing corruption in the right places.

    for example.

    There are 3 rows in 1 pages for object "MSreplication_options".

    Has anyone tried to actually corrupt the master database?

    How did you do it?

    I learned this technique from Paul Randals excellent blog articles and pluralsight course on recovery and database curruption.

    http://www.sqlskills.com/blogs/paul/dbcc-writepage/

    https://app.pluralsight.com/library/courses/sqlserver-database-corruption/table-of-contents

  • Just had a thought, I could restore a backup from a totally different database over the master....lol

  • Shut down SQL, open master.mdf in my hex editor. Scribble zeros over places in the first ~100k of the file. Save. Start SQL, watch SQL fail to start.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • I'd imagine, if one was inclined to, they could use the DAC in single user mode to directly edit some of the meta sys tables in master.

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

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