目前,我的數據庫處於單用戶模式。當我嘗試擴大我的數據庫,我得到一個錯誤:退出單用戶模式
The database 'my_db' is not accessible.(ObjectExplorer)
此外,當我嘗試刪除數據庫中,我得到的錯誤:
Changes to the state or options of database 'my_db' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.
如何退出的單出用戶模式?我沒有任何用戶使用這個數據庫。
當我嘗試瀏覽我的網站IIS,我得到的錯誤是:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
我覺得好像在單用戶模式是導致此。
當我使用'sp_who2'命令時,我沒有看到任何DBName連接到'my_db'我沒有殺死任何這些連接。在運行命令後,我得到相同的錯誤= [: '此時無法更改數據庫'my_db'的狀態或選項。數據庫處於單用戶模式,並且當前用戶已連接到該用戶。 Msg 5069,Level 16,State 1,Line 1 ALTER DATABASE語句失敗' – Liondancer
您是否確定自己在master中,sp_who2沒有顯示任何具有database = my_db的行,並且您的對象資源管理器不在my_db上。 –
嘗試,斷開並連接SSMS。有些東西必須連接到該數據庫。另一種選擇是連接專用管理控制檯(DAC)。這假定你是一個系統管理員。然後殺死有問題的spid。 –