I'm just trying to rename a created database on a 2019 MS SQL running on RDS. I have a database named mydb
that for multi-tenant purposes, I need to rename to mydb2
as a workaround for hardcoded values in the app. However, in SSMS, when i try to rename the database, I get this error:
TITLE: Microsoft SQL Server Management Studio
------------------------------
Unable to rename mydb2. (ObjectExplorer)
------------------------------
ADDITIONAL INFORMATION:
Rename failed for Database 'mydb'. (Microsoft.SqlServer.Smo)
For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.47021.0&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Rename+Database&LinkId=20476
------------------------------
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
User does not have permission to alter database 'mydb', the database does not exist, or the database is not in a state that allows access checks. (Microsoft SQL Server, Error: 5011)
For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-5011-database-engine-error
------------------------------
BUTTONS:
OK
------------------------------
An using for forceful ways like changing the db to single-access, then altering the db doesn't work either because the error says my admin
user doesn't have permissions to change that on a table.
Is the background user rdsadmin
logged in and preventing me from changing this?
Could I restart the service and close any zombie connections?
Maybe I make a copy of the database and give it another name? These seems like overkill but I'm not sure what permissions on RDS are preventing me.