October 22, 2008 at 8:22 pm
there is any command in sql to shut down the database.shutdown means take offline.only db_owner has that rights.
October 22, 2008 at 9:05 pm
ALTER DATABASE [MyTests1] SET OFFLINE
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
October 23, 2008 at 9:01 am
You can also set it to READ_ONLY if you want access to it, but don't want anyone to be able to change the data.
(Not what you asked, but just as FYI)
October 23, 2008 at 10:26 am
mohinidba (10/22/2008)
there is any command in sql to shut down the database.shutdown means take offline.only db_owner has that rights.
Why? What are you trying to do?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 23, 2008 at 2:22 pm
Good question Gail..:cool:
mohini why would you need to take the DB offline :hehe:. If you only want to restrict access then go ahead and set it in Single User mode
alter database [db_name] set SINGLE_USER
Hope this helps..
Thanks!!
The_SQL_DBA
MCTS
"Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."
October 26, 2008 at 4:51 pm
i got one pwp in this i need to shutdown the db .my task is migraton of db from one host to another host .
October 27, 2008 at 12:42 am
If you're trying to move the DB, detach it. If you do it through management studio, you can specify to drop all connections first. Then you can move the files safely and reattach them.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply