Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon RDS SQL Server bring database online

Tags:

Having successfully taken a database instance offline using the Management Studio I then attempted it bring that same database back online both using the Management Studio and by executing the following script.

ALTER DATABASE [dbname] SET ONLINE 

This results in the following error

User does not have permission to alter database 'dbname', the database does not exist, or the database is not in a state that allows access checks.

like image 828
bcleary Avatar asked Aug 30 '12 15:08

bcleary


People also ask

Can you host SQL database online?

If you want your web site to be able to store and retrieve data from a database, your web server should have access to a database-system that uses the SQL language. If your web server is hosted by an Internet Service Provider (ISP), you will have to look for SQL hosting plans.

How do I connect to an SQL database online?

Start the SQL Server, in the dialog window for the Server name enters the name of the instance that you want to connect with. From the Authentication drop down box, select the SQL Server Authentication and for the field Login and the Password enter your credentials then click the Connect button.


1 Answers

Turns out that on RDS you can use the standard SQL script above to take an instance offline, but Amazon require you to execute a stored procedure to bring it back online;

EXEC rdsadmin.dbo.rds_set_database_online dbname 

See here for more http://docs.amazonwebservices.com/AmazonRDS/latest/UserGuide/Appendix.SQLServer.CommonDBATasks.html

like image 146
bcleary Avatar answered Sep 21 '22 15:09

bcleary