Saturday, October 22, 2016

attach / detach mssql 2008 sql server manager



An external consult wrote a guide on how to copy a database. Step two was detach the database using Sql Server Manager. After the detach the database was not visible in the SQL Server Manager...



Not much to do but write a mail to the service provider asking to have the database attached again. The service porviders answer: Not posisble to attach again since the SQL Server security has been violated".



Rolling back to last backup is not the option I want to use.



Can any one give feedback if this seems logic and reasonable to assume that a detached database in a SQL Server 2008 accessed through SQL Server Manager cannot be reattached. It was done by rightclicking the database and choosing detach.




-- update --



Based on the comments below I update the question with the server setup.



There are two dedicated servers:



srv1: Web server with remote desktop and an Sql Server Manager



srv2: Sql server that can be accessed through the Sql Server Manager on the web server




-- update2 --



After a restart of the server the DBA could suddenly do the attachment of the database. And I guess that after the restart it was a simple task. So all of your answer were rigth! It seems that I can only mark one as a correct answer so I marked the first answer correct. But all are correct answer.



Thanks a lot. Without posting the link to this thread then we might had so suffer while watching our database beeing restored by a backup :-) Thanks a lot.



BR. Anders


Answer



If you know the location of the mdf and ldf files and if you have either sysadmin or dbcreator roles then you can just attach the db yourself using sp_attach_db. If you don't have these things and your service provider refuses to take this action then I would be looking for a new service provider.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...