Bring SQL Server database online

感情迁移 提交于 2019-11-30 09:22:23

I think you're going to need to login with the SA account, or some other account with sysadmin privileges, and then run your code to put it back online. While you're in there, add sysadmin to your account, too. If you don't own the database, you may need to talk to someone else to get the SA password, or ask them to do it for you. Unless you don't have the SA password or it's been dumbed down for security reasons.

Your error is too generic to be usable. Do you actually have the rights to alter the database (I guess you do if you managed to bring it offline)? Can you access teh SQL logs (accessible in the tree via Management > SQL Server logs)? Are you sure the user who is executing the script is the one you expect?

Also, you can try any of the following * restart the service then retry * Use the mouse GUI o bring it online (right click on the DB, Tasks, Bring Online)

Had same problem, same error. Even logged on as SA and returned same error. On both problem database the owner was not SA.

Solved by attaching the database. This gives you the opportunity to rename the database was well assign an owner. Assigned owner as SA.

Detached failed database the renamed the newly attached database to the original name. A lesson in always give SA ownership of new databases.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!