如何修复处于“Suspect(挂起)”的数据库
来源:互联网 发布:linux 父目录 编辑:程序博客网 时间:2024/06/10 19:35
非常有用, 亲自测试
Sometimes when you connect to your database server, you may find it in suspect mode. Your database server won’t allow you to perform any operation on that database until the database is repaired.
A database can go in suspect mode for many reasons like improper shutdown of the database server, corruption of the database files etc.
To get the exact reason of a database going into suspect mode can be found using the following query,
DBCC CHECKDB (‘YourDBname’) WITH NO_INFOMSGS, ALL_ERRORMSGS
Output of the above query will give the errors in the database.
To repair the database, run the following queries in Query Analyzer,
- EXEC sp_resetstatus ‘yourDBname’;
- ALTER DATABASE yourDBname SET EMERGENCY
- DBCC checkdb(‘yourDBname’)
- ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
- DBCC CheckDB (‘yourDBname’, REPAIR_ALLOW_DATA_LOSS)
- ALTER DATABASE yourDBname SET MULTI_USER
and you are done.
You should keep one thing in mind while using the above queries that the repair mode used here , REPAIR_ALLOW_DATA_LOSS, is a one way operation i.e. once the database is repaired all the actions performed by these queries can’t be undone. There is no way to go back to the previous state of the database. So as a precautionary step you should take backup of your database before executing above mentioned queries.
- 如何修复处于“Suspect(挂起)”的数据库
- MS SQLServer 2008数据库处于SUSPECT情况下的处理
- 数据库处于suspect状态(执行sp_helpdb检测),无法自动恢复的处理
- 关于SQLserver2016数据库处于恢复挂起状态的解决方案
- 数据库suspect的处理办法
- MS-SQLSERVER数据库SUSPECT状态如何解决
- MS-SQLSERVER数据库SUSPECT状态如何解决
- MS-SQLSERVER数据库SUSPECT状态如何解决
- 数据库SUSPECT(置疑)状态如何解决
- MS-SQLSERVER数据库SUSPECT状态如何解决
- 修复SQLServer2005/2008/2012数据库质疑/Suspect状态
- 【SQL】数据库变为\"SUSPECT\"状态的解决方法
- 数据库被SUSPECT(置疑)解决方案
- 重建em时,数据库会处于挂起状态quiesce mode
- MS-SQLSERVER数据库SUSPECT状态如何解决(转)
- MSSQL 数据库被标记为SUSPECT状态,如何恢复?
- 解决sybase ase数据库被标记为“suspect”的方法
- 数据库是为suspect(质疑) 的处理办法
- HDU 1081 To The Max 动态规划
- 在android的spinner中,实现取VALUE值和TEXT值。
- Ubuntu_Samba服务器配置
- cocos2d-x 3.0 引用第三方库 及编译成apk时android mk文件写法
- OK6410 uboot改造成能使用FTP加载内核和NFS加载文件系统
- 如何修复处于“Suspect(挂起)”的数据库
- 【POJ】1502 MPI Maelstrom 最短路
- enum与typedef enum的用法
- 存储过程中使用事务Transaction实例
- 窗口显示类
- Mina、Netty、Twisted一起学(四):定制自己的协议
- poj 1127(线段相交)
- RtlAdjustPrivilege 一行代码提升进程权限
- OK6410 linux内核移植