怎样修复INTERBASE数据库?

lovecat_sc 2003-01-08 04:50:19
现有一ITERBASE数据库,查询其中一表时出现如下错误:
General SQL error.
database file appears corrupt()
bad checksum
checksum error on database page 5284
在DELPHI的SQL EXPLORER中能看到该表数据,但到2000多行后就不行了,又出现民上错误。请问有无方法修复?
...全文
167 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
erickleung 2003-01-15
  • 打赏
  • 举报
回复
假如这不是突然停电, 而数据库却是在windows server上, 加上把 forecd write 关掉. 一般情形下可以用 interbase上的
gfix 及 gbak 修好.

首先把数据文件备份, 不要在生产文件直接修复!!
$ cp atlas.gdb atlas_test.gdb (Linux)
copy atlas.gdb atlas_test.gdb (windows)

$ gfix -v -f atlas_test.gdb
Mend database corruption. Only do this if the previous step reported database corruption.

$ gfix -m -i atlas_test.gdb
Check to see if corruption was mended.

$ gfix -v -f atlas_test.gdb
If gfix still reports database corruption, we need to take further steps to repair the database.

若 gfix无效, 可以再用 gbak 作备份, 然後修复
The backup/restore procedure will create a new database with no old record versions, no page fragmentation, and newly-formed indices and transaction log.


Back up database.
备份:
$ gbak -g -b -z -v atlas_test.gdb atlas.gbk

If there is corruption in record versions of a limbo transaction, then you may need to include the -l switch to the above gbak command to ignore limbo transactions.
Create new database from backup. This should create a pristine database, with newly-made indices, no old record versions, etc.

$ gbak -c -v -z atlas.gbk atlas_new.gdb
Check to see if new database is corrupt.

$ gfix -v -f atlas_new.gdb
lqflg 2003-01-14
  • 打赏
  • 举报
回复
运行IBConsole中菜单:
database->maintenance->validation就可以修复
lqflg 2003-01-14
  • 打赏
  • 举报
回复
运行IBConsole中菜单:
database->maintenance->validation
jsg_jn 2003-01-13
  • 打赏
  • 举报
回复
备份恢复一下

2,209

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 其他数据库
社区管理员
  • 其他数据库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧