Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set database to single user mode
Message
From
24/06/2013 07:12:52
 
 
To
17/06/2013 20:56:38
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Application:
Desktop
Miscellaneous
Thread ID:
01576584
Message ID:
01576967
Views:
36
I my apps a user can send a message to everyone logged in to get out for maintenance. at the same time a semaphore file is created.
in the login process the existence of that semaphore file will prevent everyone to login

once everypne is logged out the user is alone on the system and can do whatever s/he wants (well, there are social restrictions :-) )

Peter





>>>We have a backup function built in our c/s application that creates a backup file of one database, using SQL Server 2008 R2.
>>>At this moment we do not check if another user is using the database and perhaps is doing updates, which could be a problem when doing a backup at the same time. It is possible to set the database to single user mode, but other users won't get notified and would be logged off. Is there a way to check if other users are logged on, and if no other user is logged on, then we could set the database to single user mode to prevent someone else to log on until the backup is finished.
>>
>>This may not be the exact reply you were expecting but I am curious to know why you would like to backup like this. I have never had any use like that to do the backup. They are all done online at the precised time I have indicated from a .NET robot task, with or without anyone connected to the database, and usually they are several of them everytime a backup is done.
>
>I agree that a backup is something that is typically done on system level, not on application level. In this specific case, it is a function that the users use to create a snapshot before posting the monthly transaction files irreversibly to history and update all balances to open the next month. There is no practical way to create the possibility to re-open the closed months, but what happens in practice is that the users close the month and afterwards realize that they forgot something and would like to go back in time before the posting. So we introduced this backup/restore function so the users can create this snapshot and restore just before the posting happens. Sometimes the users go back and forward multiple times until everything is perfect. And that often after hours when the system admin is already long at home.
Peter Cortiel
Previous
Reply
Map
View

Click here to load this message in the networking platform