Backup fails due to damaged MSDB database

  • We have a test machine (SQLServer 2000 on Windows 2000) which due to a previous disk error is reaching the end of it's life.

    The transaction log for the test database had grown in excess of 17GB due to all backups failing on the server. I have now changed the recovery model to simple as full recovery isn't a requirement.

    However, I then tried to take a full backup of the database and it failed due to an checksum error in the msdb database. I am assuming that this is occuring at the end of the backup when it tries to record the history in the msdb database.

    I had a quick attempt at rebuilding the system databases but that failed with a -3 code - i haven't invesitgated further, but it might be I'm using the wrong version of sqlserver cd!

    More out of interest than anything, what is the best way to continue when the msdb is damaged?

    Ideally, I would a take a full backup of the test database instead trying to move a 17GB ldf across the network to a new box

    Thanks

    David

  • Two suggestions

    1. Shrink its log file;

    2. Backup msdb again;

    Or

    1. Export data;

    2. Rebuild msdb;

  • I assume other backups work (for user databases)?

    I'm not sure what you can do other than rebuild msdb from scratch. Or restore from a previous backup.

    I'd script out jobs, alerts, packages. Everything else (backup history, job history), probably isn't important.

    Then either reinstall SQL, install it on a VM and steal msdb.mdf/ldf, and the run your scripts.

  • Thanks for the replies.

    However I don't think I explained the issue very well 🙂

    It's not the backing up of the MSDB which is the issue, it's the fact I can't back up the user database.

    When I try to backup a user database the progress bar moves along nicely, but towards the end I get a message saying that a torn page error is reported in the msdb database and no backup is created.

    What I am wondering is... is it possible to do a backup without it trying to record the history in the msdb database?

    ( After the disk errors were first reported, the physical machine did go virtual - but this took the errors and all!)

    Thanks again,

    David

  • Do you have a backup of MSDB?

    If you recreate the database, you'll loose all your jobs, DTS packages and a few other things. They're all stored in MSDB.

    If you don't have a backup, run

    DBCC CHECKDB ('MSDB') WITH No_INFOMSGS

    and see what it says.

    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
  • That is what I mean.

    Two suggestions

    If it is the disk issue

    1. Shrink its log file;

    2. Backup msdb again;

    Or, if it a disk or datbase corruption issue

    1. Export data (you can export data to a table in other database);

    2. Rebuild msdb;

    3. Import data back.

    If you cannot export data, and cannot backup the database, you may lose your data.

  • There's no option to skip writing to msdb backuphistory in the backup database command, so I'm afraid you can't get away with it. So, you'll have to go with what they suggested to restore/rebuild msdb as you have a torn page detected in it. Or you may just detach the db and move it, which takes longer, if you're not interested in msdb and saving its data.

    _____________
    Donn Policarpio

  • If you use SQL 7, you may try to expand your database. There is a bug there. But first of all, you had better try your best without changing your existing datbase.

  • I dealt with a similar issue last fall and had to recreate the msdb database. There were no backups, I was not aware of the SQL Server, so I also had to recreate all the jobs. Needless to say I am monitoring this SQL Server now.:D

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

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