G
Guest
I'd like to make a tool that non-technicians could invoke if there was a
defacement or destruction of our database data for whatever reason and an
expert wasn't around to tend to things. The sequence would run something
like this:
1) Take IIS offline if necessary and drop existing DB connections
2) Back up current database to [timestamp]_[dbname]_dropped.bak
3) Restore from a known good backup
4) put IIS online if necessary
I'd imagine this can be done via script. Items 1) and 4) are the biggest
mystery. From my experiences working with the SQL Server GUI, existing
connections must be closed to the DB before backup/restore ops, and the only
reliable way I've found to do this is to stop IIS. Perhaps there is a way to
force things entirely in script. Script would be preferable if it is a
reliable way to accomplish what I'm trying to do.
Can someone suggest approaches and ideally a resource or two to read
through?
Thanks.
-KF
defacement or destruction of our database data for whatever reason and an
expert wasn't around to tend to things. The sequence would run something
like this:
1) Take IIS offline if necessary and drop existing DB connections
2) Back up current database to [timestamp]_[dbname]_dropped.bak
3) Restore from a known good backup
4) put IIS online if necessary
I'd imagine this can be done via script. Items 1) and 4) are the biggest
mystery. From my experiences working with the SQL Server GUI, existing
connections must be closed to the DB before backup/restore ops, and the only
reliable way I've found to do this is to stop IIS. Perhaps there is a way to
force things entirely in script. Script would be preferable if it is a
reliable way to accomplish what I'm trying to do.
Can someone suggest approaches and ideally a resource or two to read
through?
Thanks.
-KF