有问题文章留言 看内容决定收费与免费
另外接收数据库质疑 勒索病毒数据恢复等项目。

修复数据库错误,如何解决?

【问】修复数据库错误,如何解决?
【适用版本】商云8 【模块】基本档案 【点击数】253
【知识编号】P2017081700012
【问题描述】使用siss提供的数据库修复语句还时出现一下错误

【答】 请在数据库修复语句中加入以下语句执行,可多执行几次,
DBCC CHECKTABLE(t_im_flow, REPAIR_REBUILD )
DBCC CHECKTABLE(t_im_flow, repair_allow_data_loss )
也可先备份数据库执行以下语句修复索引和自增列,修复索引和自增列语句可以与数据库修复语句交替执行,若仍不能正常修复说明数据库损坏比较严重,建议建议联系专业数据库修复公司修复,或还原之前备份使用,或将基础数据导出后建新库使用,请确认,谢谢支持!
–修复自增列语句:
use hbposv8
go
declare @tablename varchar(100)
declare  test_cur cursor for
select object_name(id) from syscolumns
where status=128
open test_cur
fetch test_cur into @tablename
while @@fetch_status=0
begin  
   DBCC CHECKIDENT (@tablename, RESEED)  
   fetch test_cur into @tablename
end
close test_cur
deallocate test_cur
go
—修复索引
use hbposv8
go
declare @tablename varchar(100)
declare  test_cur cursor for
select object_name(id) from sysobjects
where type =’U’
open test_cur
fetch test_cur into @tablename
while @@fetch_status=0
begin  
   DBCC DBREINDEX(@tablename)
   fetch test_cur into @tablename
end
close test_cur
deallocate test_cur
go

赞(0)
未经允许不得转载:思迅软件知识库 » 修复数据库错误,如何解决?
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址