How to overwrite a database with a restore without manually changing DB state?

foobar2devnull

ADSM.ORG Member
Joined
Nov 30, 2010
Messages
122
Reaction score
1
Points
0
Location
Belgium
TSM Server 6.2.2.0 | TSM Clients 6.2.2.0 | TDP MS SQL 5.5.4.2

Dear,

Is there a way to restore over an existing database without first having to set the database to "single user mode" in the MS SQL Server Management Studio? By changing the state of the database, all users get disconnected and the database can be overwritten.

I can restore a DB to another location, but I can't figure out how to overwrite a database with a restore without first having to change the state of the database manually. Shouldn't the TDP do that for me?

Thanks for your help!
 
Or, before the restore you can kill the sessions that connected to the database.
 
Hi,

Thanks for your answer. Putting the DB in single user mode does in effect, kill all connections to the DB. I was just wondering why the TDP does not do this? Are you saying that before restoring a DB one should manually kill all connections to it from the SQL Manager?
 
Could someone confirm this for me? Do I really have to manually kill all connections to the DB before overwriting it? The TDP will not do this even though there is an option to overwrite?

Any feedback is welcome! :)
 
I also have to kill connections to the DB with the SQL management studio when restoring over an existing database, Otherwise restore fails with database in use.
I doubt the TDP does this.
 
TSM Server 6.2.2.0 | TSM Clients 6.2.2.0 | TDP MS SQL 5.5.4.2

Dear,

Is there a way to restore over an existing database without first having to set the database to "single user mode" in the MS SQL Server Management Studio? By changing the state of the database, all users get disconnected and the database can be overwritten.

I can restore a DB to another location, but I can't figure out how to overwrite a database with a restore without first having to change the state of the database manually. Shouldn't the TDP do that for me?

Thanks for your help!
I am wondering this myself. Does anyone know? Do I really have to change the state of the database manually? If someone can help me figure this out I would really appreciate it. I really need to restore a database for a payroll utility that I am developing. Thank you very much.
 
Last edited:
Back
Top