database restore problem

  • I got deadlock issue when I tried to restore the database:

    Here is the command:

    RESTORE DATABASE [trackit65] FROM DISK = N'C:\test\trackit65_it_cw.bak' WITH FILE = 1, MOVE N'TRACKIT65_IT' TO

    N'C:\SQLData\TRACKIT65_IT.mdf', MOVE N'TRACKIT65_IT_log' TO N'C:\SQLData\TRACKIT65_IT_log.LDF', NOUNLOAD, REPLACE, STATS = 10

    And here is the message I got:

    10 percent processed.

    20 percent processed.

    30 percent processed.

    40 percent processed.

    50 percent processed.

    60 percent processed.

    70 percent processed.

    80 percent processed.

    90 percent processed.

    100 percent processed.

    Processed 45992 pages for database 'trackit65', file 'TRACKIT65_IT' on file 1.

    Processed 118 pages for database 'trackit65', file 'TRACKIT65_IT_log' on file 1.

    Msg 1205, Level 13, State 56, Line 1

    Transaction (Process ID 51) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.

    Converting database 'trackit65' from version 539 to the current version 611.

    Database 'trackit65' running the upgrade step from version 539 to version 551.

    Database 'trackit65' running the upgrade step from version 551 to version 552.

    Database 'trackit65' running the upgrade step from version 552 to version 553.

    Database 'trackit65' running the upgrade step from version 553 to version 554.

    Database 'trackit65' running the upgrade step from version 554 to version 589.

    Database 'trackit65' running the upgrade step from version 589 to version 590.

    Database 'trackit65' running the upgrade step from version 590 to version 593.

    Database 'trackit65' running the upgrade step from version 593 to version 597.

    Database 'trackit65' running the upgrade step from version 597 to version 604.

    Database 'trackit65' running the upgrade step from version 604 to version 605.

    Database 'trackit65' running the upgrade step from version 605 to version 606.

    Database 'trackit65' running the upgrade step from version 606 to version 607.

    Database 'trackit65' running the upgrade step from version 607 to version 608.

    Database 'trackit65' running the upgrade step from version 608 to version 609.

    Database 'trackit65' running the upgrade step from version 609 to version 610.

    Database 'trackit65' running the upgrade step from version 610 to version 611.

    RESTORE DATABASE successfully processed 46110 pages in 30.672 seconds (12.315 MB/sec).

  • Last statements says that restore completed.

    Run dbcc checkdb to make sure.

    Alex S
  • DBCC CheckDB result is good. But I want to know why that error happened. I tried 10 times and every time that error happened. There are no other users connected to the server at all.

    I ran the sql profile to trace but it didn't tell me anything...

    I tried to restore other databases, they are all good.

  • Run this:

    RESTORE DATABASE [trackit65] FROM DISK = N'C:\test\trackit65_it_cw.bak'

    WITH FILE = 1, MOVE N'TRACKIT65_IT' TO

    N'C:\SQLData\TRACKIT65_IT.mdf', MOVE N'TRACKIT65_IT_log' TO N'C:\SQLData\TRACKIT65_IT_log.LDF', NOUNLOAD, REPLACE, RECOVERY, STATS = 10

    Alex S
  • Thanks but same error.

  • Interesting...

    do you see anything when you run dbcc opentran?

    Run the same script but give it a different database name and remove replace.

    if you still get the error you should restart sql.

    And be sure in management studio you dont have the query open in that db.

    Alex S
  • Thanks but still no luck....no open transactions ...restarting the server doesn't help either. And the same result to restore to a different database.

Viewing 7 posts - 1 through 6 (of 6 total)

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