Sql-server – Can’t Delete Database

sql serversql-server-2008

My problem is that I want to delete a DB from our production server. It is a test DB that needed to be there for some reason, so the mdf and ldf are on LUNs that are insecure and oftentime lost connection to the server, not like our production LUNs that are OK.

The problem is that I can't delete the database. It throws:

El sistema operativo ha devuelto el error 1117(failed to retrieve text for this error. Reason: 15105) en SQL Server durante leer en el desplazamiento 0x00000687a10000 del archivo 'T:\XXX_XXXXX_xx.mdf'

We are using SQL Server 2008 [10.0.5500.0].

It won't let me go into DB settings or read from tables. I can't manually delete the files either. I think a server restart should help. Today is Tuesday and we got a schechuled restart on Saturday 04.

Have any of you encontered this issue?

Best Answer

That just means it can't find that file at the moment. Either wait for when the drive to be available, or, as Martin suggested, try setting the database offline: ALTER DATABASE FOO SET OFFLINE

If that works, you should be able to follow it up with a DROP: DROP DATABASE FOO.

Then delete the files at your leisure.