When I sorted out the test environment, I encountered a problem where the database could not be deleted.
The following error is reported:
Alter failed for Database 'fastsearchadmindatabase'. (Microsoft. SqlServer. Smo)
------------------------------
Additional information:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft. SqlServer. ConnectionInfo)
------------------------------
Changes to the state or options of database 'fastsearchadmindatabase' can not be made at this time. The database is in single-user mode, and a user is currently connected to it.
Alter database statement failed. (Microsoft SQL Server, Error: 5064)
Solution
======================================
Run the following SQL query statement to obtain the DBID of the problematic database.
select db_id('FASTSearchAdminDatabase')
Queries the session currently connected to the database.
select * from sys.sysprocesses where dbid = 30
Kill it
kill 54
Then we can connect to the database to modify the single user mode to multiuser mode.
alter database [FASTSearchAdminDatabase] set multi_user
Okay, the database can be deleted.
Update
This time I tried to Restore the SSP DB, and the result was always reported that other users are using this DB, so they could not Restore the DB.
After the above method is used, a new session is generated after the session is killed.
The solution is very simple. The network that constantly tries to connect to this SQL is disconnected and restored successfully.
Remember to restore the disconnected network.