Force Corruption with WRITEPAGE in master database, demo purpose

  • alanspeckman

    Hall of Fame

    Points: 3344

    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.

  • alanspeckman

    Hall of Fame

    Points: 3344

    Just had a thought, I could restore a backup from a totally different database over the

  • Gail Shaw

    SSC Guru

    Points: 1004484

    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
  • benjamin.reyes


    Points: 5249

    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 4 (of 4 total)

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