This seems like a good option. Are you doing an ALTER DATABASE with ROLLBACK IMMEDIATE, in the background so as to stop the active transactions?

Thanks

Chris
ChrisAVWood
0

Comments

3 comments

  • petey
    Yes, e.g.
    USE master ALTER DATABASE pubs SET OFFLINE WITH ROLLBACK IMMEDIATE ALTER DATABASE pubs SET ONLINE
    
    petey
    0
  • ChrisAVWood
    Glad to hear that Petey. In the off chance that a long running transaction needs to be rolled back that will take a long time will V 6 wait or will it give up after a set period of time?

    Thanks

    Chris

    Note. Our approach when we need to take an SQL Backup backup file and restore it to another database is to set the database to single user and rollback immed similar to you. On occasion we had problems with orphan DTC spids that stopped the alter database from finishing. In fact just last Friday I waited over 40 minutes before the alter database took effect because someting was holding it and got 952 messages showing the database in transition.
    ChrisAVWood
    0
  • petey
    The ALTER DATABASE command is ran in the same batch as the RESTORE command, so it'll wait. We'll need to see how that goes.
    petey
    0

Add comment

Please sign in to leave a comment.