Files
chill_notes/数据库/SQLSERVER 数据库恢复挂起的解决办法.md
2026-04-21 17:42:54 +08:00

17 lines
362 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
如果你的数据库还处于挂起状态请把我下面代码的test改为你的库名然后执行完刷新就正常了
USE master
GO
```sql
ALTER DATABASE test SET SINGLE_USER
GO
ALTER DATABASE test SET EMERGENCY
GO
```
DBCC CHECKDB(test,REPAIR_ALLOW_DATA_LOSS)
go
```sql
ALTER DATABASE test SET ONLINE
GO
ALTER DATABASE test SET MULTI_USER
GO
```