Restore without Checkdb

  • Hello,

    I wonder if it is possible to run "restore database " without DBCC CHECKDB because when I do a restore, there is always a CHECKDB

    RESTORE DATABASE [test]

    FROM DISK = N'C:\test_backup.bak'

    WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 10

    Thx

  • I dont think the above restore command will run dbcc checkdb. Also , RESTORE will not run DBCC CHECKDB unless you are using a user built in script / trigger which will run DBCC CHECKDB before restoring the database. This two commands are different from each other.

    RESTORE will restore the DB from the Backup while DBCC CHECKDB will do a DB consistency check on a Database.

    "More Green More Oxygen !! Plant a tree today"

  • Restore never runs a checkDB automatically. What you're likely seeing is a message in the error log that states

    CHECKDB for database 'Testing' finished without errors on 2010-05-24 06:44:53.317 (local time).

    Do note that the date and time it lists will be sometime in the past. It's telling you when checkDB last ran successfully on that database.

    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
  • Hello,

    thank you for these answers.

    The initial problem is that the backup takes 18 minutes while the restore takes 50 minutes.

    Why so much difference?

    Thx

  • chauchs (7/9/2010)


    The initial problem is that the backup takes 18 minutes while the restore takes 50 minutes.

    Why so much difference?

    Is the backed up database replicated? If so, and you don't specify KEEP_REPLICATION in the RESTORE statement then SQL Server will drop all objects related to replication after the initial RESTORE is completed. This can take a while depending on the number of replicated tables.

    You can check the progress of the restore by querying column percent_complete in sys.dm_exec_requests for the session_id performing the restore. Does is use 50 minutes to reach 100%?

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

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