Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2004-09-14 : 14:53:21
|
| I want to gracefully logoff users and prevent new connections to the database at a specific time of day so I can do maintenance on the database. If the connection is "sleeping" kill it, If after 20 minutes of waiting kill all, I would like to work with the database with multiple connections but on a single user account.References to the proper sp's and/or articles on handling this process so users do not think the "Database" has failed and is having scheduled maintenance performed would be optimal...I have done this in the past by controlling the front end app via a flag set by a sp but I don't have that control here. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-09-14 : 14:57:44
|
| You would use ALTER DATABASE SET SINGLE_USER WITH ROLLBACK AFTER 1200.Look up ALTER DATABASE in BOL for more details.Tara |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2004-09-14 : 15:08:20
|
| Ok... I thought single user was single connection? Is it Id based? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-09-14 : 15:09:38
|
| Why do you need multiple connections to do database maintenance?Tara |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2004-09-14 : 15:13:51
|
| It look like Restricted User might also work. Is their a way to broadcast "Maintenance being performed... Contact cb at" information for any user attempting a new connection? Again I will be performing this maintenance on a specific database but other dbs exist on the system ie reporting versus transactions. |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2004-09-14 : 15:15:49
|
| Often times it is related to Application Upgrades that require new or modified db objects... This would provide the team with simple regression testing to ensure all objects they require have been moved prior to releasing to the "public" |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2004-09-14 : 15:17:59
|
| During long development cycles where dev/qa/production are in different states some code may or may not make the cutoff and developers are not always aware of all of the db's objects uses. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-09-14 : 15:18:38
|
| I guess you could do a net send command, but don't you have an e-mail list of something to notify users about things like this?Tara |
 |
|
|
clarkbaker1964
Constraint Violating Yak Guru
428 Posts |
Posted - 2004-09-14 : 15:22:46
|
| If the application was using NT or User specific Id's that may work with custom tables... Hmmm... the app has been developed using App specific logins. |
 |
|
|
|
|
|