Sometimes there are active connections preventing a database from making offline.
If you have got SMWS open remotely accessing the DB then this could prevent from making it offline.
You can use the following to make it offline.
This will kill all connections and will close database.
ALTER DATABASE database-name SET OFFLINE WITH ROLLBACK IMMEDIATE
ALTER DATABASE <dbname> SET OFFLINE WITH ROLLBACK IMMEDIATE
o find connections, use sys.sysprocesses
USE master SELECT * FROM sys.sysprocesses WHERE dbid = DB_ID(‘MyDB’)
To force disconnections, use ROLLBACK IMMEDIATE
USE masterALTER DATABASE MyDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE