none
Do all SPID get killed before a database restore? RRS feed

Answers

  • Hi Mr. Shaw,

    a few more information would be helpful, wouldn't it? It's quite rude not to use a "Thank you for your support". We all here are doing a volunteer job and will not be paid by Microsoft! Keep that in mind for future requests!

    You don't have to kill all processes but can set the database in OFFLINE status before recovery:

    -- Set database offline
    ALTER DATABASE [YourDB] SET OFFLINE WITH ROLLBACK IMMEDIATE;
    GO
    
    -- Restore database
    RESTORE DATABASE [YourDB] FROM DISK = N'Your Database File' WITH REPLACE;


    MCM - SQL Server 2008
    MCSE - SQL Server 2012
    db Berater GmbH
    SQL Server Blog (german only)

    • Marked as answer by Mr Shaw Monday, February 23, 2015 7:08 PM
    Monday, February 23, 2015 6:45 PM
  • Before restoring database exclusive access is obtained on database and all transactions related to that DB are blocked. No spid gets killed unless you yourself kill it by selecting option or killing it manually

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Technet Wiki Article

    MVP



    Monday, February 23, 2015 6:46 PM
    Moderator

All replies

  • Hi Mr. Shaw,

    a few more information would be helpful, wouldn't it? It's quite rude not to use a "Thank you for your support". We all here are doing a volunteer job and will not be paid by Microsoft! Keep that in mind for future requests!

    You don't have to kill all processes but can set the database in OFFLINE status before recovery:

    -- Set database offline
    ALTER DATABASE [YourDB] SET OFFLINE WITH ROLLBACK IMMEDIATE;
    GO
    
    -- Restore database
    RESTORE DATABASE [YourDB] FROM DISK = N'Your Database File' WITH REPLACE;


    MCM - SQL Server 2008
    MCSE - SQL Server 2012
    db Berater GmbH
    SQL Server Blog (german only)

    • Marked as answer by Mr Shaw Monday, February 23, 2015 7:08 PM
    Monday, February 23, 2015 6:45 PM
  • Before restoring database exclusive access is obtained on database and all transactions related to that DB are blocked. No spid gets killed unless you yourself kill it by selecting option or killing it manually

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Technet Wiki Article

    MVP



    Monday, February 23, 2015 6:46 PM
    Moderator
  • Sorry, I am usually quite polite.

    Thank you for you help.


    Mr Shaw

    Monday, February 23, 2015 6:53 PM
  • Sorry, I am usually quite polite.

    Thank you for you help.


    Mr Shaw

    We are not saying that you are rude but requesting you to raise single thread for one question and add as much information as you have. This will help us in providing better solution since we cannot see your system and can only read your questions and judge

    thanks for understanding


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Technet Wiki Article

    MVP

    Monday, February 23, 2015 6:57 PM
    Moderator