瑞星卡卡安全论坛技术交流区系统软件 sql2000数据库运行不正常的应急处理

1   1  /  1  页   跳转

sql2000数据库运行不正常的应急处理

sql2000数据库运行不正常的应急处理

数据库运行不正常的应急处理
当数据库存在损坏时,会出现运行不正常现象,如在收银操作
结帐存盘时,系统提示“系统忙请稍后再试!”等。按以下步骤处理:
检查数据库是否存在损坏,在数据库工具查询分析器里执行以
下语句:
DBCC CHECKDB('Name')
执行后可在查询结果栏的最后几行中看到有无错误的提示,并
会提示试图修复时的修复级别,如果提示数据库出错(存在损坏),则开始修复操作。
第一步,停止系统运行,在数据库服务器上,只运行查询分析
器,并执行以下语句:
//将目标数据库置于单用户模式:
sp_dboption 'Name','single user',true
//试用最安全模式修复数据库:
DBCC CHECKDB('Name',REPAIR_REBUILD)
//执行后再检查数据库,并查看提示:
DBCC CHECKDB('Name')
如果检查结果已经没有错误,则修复完成,否则执行更高级别
的修复,此种修复有可能使得已经损坏的数据丢失:
DBCC CHECKDB('Name',REPAIR_ALLOW_DATA_LOSS)*
//执行完再次检查数据库
DBCC CHECKDB('Name')
如果检查后数据库已经正常,则将数据库恢复多用户模式,执行以下语句:
sp_dboption 'Name','single user',false
*注:在执行           
DBCC CHECKDB('Name',REPAIR_ALLOW_DATA_LOSS)语句后,
可以检看执行的提示信息,检查修复时有哪几张表的数据发生了丢失,则可以在修复后有目的的检查相关数据,并针对情况纠正数据。

2.置疑
当出现运行异常,并在企业管理器中看到目标数据库的状态为
置疑时,执行以下操作步骤:
  1.分离
在数据库的企业管理器中将置疑的数据库分离,不必理睬报错
信息
  2.附加
尝试附加,如附加成功,则检查数据库是否正常,如已经正常,
则可以继续使用数据库;否则,执行下一步操作:
  3.MS-DOS:chkdsk e:/R    (修复硬盘索引)
进入命令提示符模式,执行chkdsk e:/R检查并修复硬盘,然
后再次附加;如附加失败,则执行:
  4.删除ldf文件,再附加
如附加数据库再次失败,则执行伪造操作:
  5.将.mdf文件改名,创建同名同目录新库
  6.停止SQL服务,删除新的mdf文件,将原文件名字改回
  7.启动SQL服务。
  8.运行查询分析器,选择master,单步运行SqL
A、  Use Master
Go
sp_configure 'allow updates', 1
reconfigure with override
Go

B、  update sysdatabases set status = 32768 where name = 'XXX'

C、 sp_dboption 'XXX', 'single user', 'true'

  9.停止SQL服务,启动SQL服务。
此时,目标数据库状态为只读、紧急恢复,可能打不开表,不
用理睬,执行以下操作:
  10.用百年软件数据库管理工具建新库(库名另定),并创建年月数据,如200312:
    spCreateTable '200312'
  11.清理新库数据,删除以下表内数据:

  12.将修复的原数据库中的数据导入新库的表中,按以下顺序:
最后编辑2005-09-28 15:55:08
分享到:
gototop
 

1.tbSpda,tbBmda,tbCsda,tbZyda,tbQx
1--------

delete  from tbsysmsg
delete tbzyda
delete tbqx
delete from tbReport
delete from tbReport_Sort
2--------
insert into  tbsysmsg select * from xdedname..tbsysmsg
insert into  tbzyda select * from xdedname..tbzyda
insert into  tbzyqx select * from xdedname..tbzyqx
insert into  tbqx select * from xdedname..tbqx
3--------
insert into  tbspda select * from xdedname..tbspda
insert into  tbcsda select * from xdedname..tbcsda
insert into  tbbmda select * from xdedname..tbbmda
4--------
insert into  tbgysdz select * from xdedname..tbgysdz
insert into  tbsptm select * from xdedname..tbsptm
5-------
insert into  tbwdz select * from xdedname..tbwdz
insert into  tbdjbmflda select * from xdedname..tbdjbmflda
insert into  tbdjbmfldz select * from xdedname..tbdjbmfldz
------如果导人不成功就在软件里建会员档案
insert into  tbhyda select * from xdedname..tbhyda

insert into  tblsdkz select * from xdedname..tblsdkz
insert into  tbnormalreport select * from xdedname..tbnormalreport
insert into  tbpdrz select * from xdedname..tbpdrz
insert into  tbreport select * from xdedname..tbreport
insert into  tbreport_sort select * from xdedname..tbreport_sort
insert into  tbspddzb select * from xdedname..tbspddzb
insert into  tbspddcb select * from xdedname..tbspddcb
insert into  tbspfzfl select * from xdedname..tbspfzfl
insert into  tbspfzfldz select * from xdedname..tbspfzfldz
insert into  tbspfzflfzdz select * from xdedname..tbspfzflfzdz
insert into  tbspfzflm select * from xdedname..tbspfzflm
insert into  tbsppdzb select * from xdedname..tbsppdzb
insert into  tbsppdcb select * from xdedname..tbsppdcb
insert into  tbsptj select * from xdedname..tbsptj
insert into  tbwgys select * from xdedname..tbwgys
insert into  tbxsxl select * from xdedname..tbxsxl
insert into  tbxsxlqk select * from xdedname..tbxsxlqk
insert into  tbyxjjsxda select * from xdedname..tbyxjjsxda
insert into  tbyxjjsxjsls select * from xdedname..tbyxjjsxjsls
insert into  tbkbsp select * from xdedname..tbkbso
    2.导入所有非年月表(先主后从)
    3.导入所有带年月表(先主后从)
语句为:
Use newname

insert into tb200410_csdad select* from bizmis_Data..tb200410_csdad
insert into tb200410_czrz select* from bizmis_Data..tb200410_czrz
insert into tb200410_rhj select * from bizmis_Data..tb200410_rhj
insert into tb200410_yhj select* from bizmis_Data..tb200410_yhj
insert into tb200410_sptj select* from bizmis_Data..tb200410_sptj
insert into tb200410_spsyzb select* from bizmis_Data..tb200410_spsyzb
insert into tb200410_spsycb select* from bizmis_Data..tb200410_spsycb

insert into tb200410_spzyzb select* from bizmis_Data..tb200410_spzyzb
insert into tb200410_spzycb select* from bizmis_Data..tb200410_spzycb

insert into tb200410_spgjzb select* from bizmis_Data..tb200410_spgjzb
insert into tb200410_spgjcb select* from bizmis_Data..tb200410_spgjcb

insert into tb200410_xsmxzb select* from bizmis_Data..tb200410_xsmxzb
insert into tb200410_xsmxcb select* from bizmis_Data..tb200410_xsmxcb

insert into tb200410_wgmxb select* from bizmis_Data..tb200410_wgmxb

insert into tb200410_hyczmx select* from bizmis_Data..tb200410_hyczmx
insert into tb200410_hykxfmx select* from bizmis_Data..tb200410_hykxfmx
insert into tb200410_hyyhj select* from bizmis_Data..tb200410_hyyhj


insert into tb200410_spdj_zb select* from bizmis_Data..tb200410_spdj_zb
insert into tb200410_spdj_bmgysdz select* from bizmis_Data..tb200410_spdj_bmgysdz
insert into tb200410_spdj_gysdz select* from bizmis_Data..tb200410_spdj_gysdz
insert into tb200410_spdj_kbsp select* from bizmis_Data..tb200410_spdj_kbsp
insert into tb200410_spdj_khjg select* from bizmis_Data..tb200410_spdj_khjg
insert into tb200410_spdj_lsdjg select* from bizmis_Data..tb200410_spdj_lsdjg
insert into tb200410_spdj_lsdkz select* from bizmis_Data..tb200410_spdj_lsdkz
insert into tb200410_spdj_plzj select* from bizmis_Data..tb200410_spdj_plzj
insert into tb200410_spdj_spda select* from bizmis_Data..tb200410_spdj_spda
insert into tb200410_spdj_sptj select* from bizmis_Data..tb200410_spdj_sptj
insert into tb200410_spdj_sptm select* from bizmis_Data..tb200410_spdj_sptm
insert into tb200410_spdj_xsxl select* from bizmis_Data..tb200410_spdj_xsxl


insert into tb200410_spxxs select* from bizmis_Data..tb200410_spxxs
insert into tb200410_syyrhj select* from bizmis_Data..tb200410_syyrhj




insert into tb200410_bzqmx select* from bizmis_Data..tb200410_bzqmx
insert into tb200410_ckfz select* from bizmis_Data..tb200410_ckfz
insert into tb200410_ckslrhj select* from bizmis_Data..tb200410_ckslrhj
insert into tb200410_ckszd select* from bizmis_Data..tb200410_ckszd
insert into tb200410_ddzx_cgsqdbf select* from bizmis_Data..tb200410_ddzx_cgsqdbf
insert into tb200410_ddzx_zysqdbf select* from bizmis_Data..tb200410_ddzx_zysqdbf
insert into tb200410_dyccjjb select* from bizmis_Data..tb200410_dyccjjb
insert into tb200410_dycckhbmcb select* from bizmis_Data..tb200410_dycckhbmcb
insert into tb200410_dycczb select* from bizmis_Data..tb200410_dycczb
insert into tb200410_fptjdcb select* from bizmis_Data..tb200410_fptjdcb
insert into tb200410_fptjdcycb select* from bizmis_Data..tb200410_fptjdcycb
insert into tb200410_fptjdzb select* from bizmis_Data..tb200410_fptjdzb
insert into tb200410_fpzfmx select* from bizmis_Data..tb200410_fpzfmx
insert into tb200410_gysbmfl select* from bizmis_Data..tb200410_gysbmfl
insert into tb200410_gysfl select* from bizmis_Data..tb200410_gysfl

insert into tb200410_jsfk select* from bizmis_Data..tb200410_jsfk
insert into tb200410_jsfksp select* from bizmis_Data..tb200410_jsfksp
insert into tb200410_jsyfzk select* from bizmis_Data..tb200410_jsyfzk
insert into tb200410_kcslrhj select* from bizmis_Data..tb200410_kcslrhj
insert into tb200410_kcslyhj select* from bizmis_Data..tb200410_kcslyhj

insert into tb200410_khazshxx select* from bizmis_Data..tb200410_khazshxx
insert into tb200410_mdkhskmx select* from bizmis_Data..tb200410_mdkhskmx
insert into tb200410_mdkhtzmx select* from bizmis_Data..tb200410_mdkhtzmx
insert into tb200410_mdkhwlrhj select* from bizmis_Data..tb200410_mdkhwlrhj
insert into tb200410_mdkhwltzmx select* from bizmis_Data..tb200410_mdkhwltzmx
insert into tb200410_mdkhwlyhj select* from bizmis_Data..tb200410_mdkhwlyhj
insert into tb200410_nbxszb select* from bizmis_Data..tb200410_nbxszb
insert into tb200410_nbxscb select* from bizmis_Data..tb200410_nbxscb
insert into tb200410_pfpdzx select* from bizmis_Data..tb200410_pfpdzc
insert into tb200410_rfpssh select* from bizmis_Data..tb200410_rfpssh
insert into tb200410_scdsjgd select* from bizmis_Data..tb200410_scdsjgd
insert into tb200410_sdxs select* from bizmis_Data..tb200410_sdxs

insert into tb200410_sfxmmx select* from bizmis_Data..tb200410_sfxmmx
insert into tb200410_skmxzb select* from bizmis_Data..tb200410_skmxzb
insert into tb200410_skmxcb select* from bizmis_Data..tb200410_xkmxcb
insert into tb200410_spbczb select* from bizmis_Data..tb200410_spbczb
insert into tb200410_spbccb select* from bizmis_Data..tb200410_spbccb
insert into tb200410_spddzb select* from bizmis_Data..tb200410_spddzb

insert into tb200410_spddfzcb select* from bizmis_Data..tb200410_spddfzcb
insert into tb200410_spddcb select* from bizmis_Data..tb200410_spddcb

insert into tb200410_spfzfld select* from bizmis_Data..tb200410_spfzfld
insert into tb200410_spjgzb select* from bizmis_Data..tb200410_spjgzb
insert into tb200410_spjgcb select* from bizmis_Data..tb200410_spjgcb
insert into tb200410_spjxkcb select* from bizmis_Data..tb200410_spjxkcd
insert into tb200410_spyhdbf select* from bizmis_Data..tb200410_spyhdbf

insert into tb200410_sxcgjs select* from bizmis_Data..tb200410_sxcgjs
insert into tb200410_sxsjgyssphj select* from bizmis_Data..tb200410_sxsjgyssphj
insert into tb200410_sxsjgyswlhj select* from bizmis_Data..tb200410_sxsjgyswlhj

insert into tb200410_sxsjwft select* from bizmis_Data..tb200410_sxsjwft

insert into tb200410_sxsjxstz select* from bizmis_Data..tb200410_sxsjxstz
insert into tb200410_sxsjystz select* from bizmis_Data..tb200410_sxsjystz
insert into tb200410_tdsfb select* from bizmis_Data..tb200410_tdsfb
insert into tb200410_tdyszk select* from bizmis_Data..tb200410_tdyszk

insert into tb200410_tjjzb select* from bizmis_Data..tb200410_tjjzb
insert into tb200410_tjjcb select* from bizmis_Data..tb200410_tjjcb
insert into tb200410_tjrz select* from bizmis_Data..tb200410_tjrz
insert into tb200410_txmx select* from bizmis_Data..tb200410_txmx
insert into tb200410_txszb select* from bizmis_Data..tb200410_txszb
insert into tb200410_txscb select* from bizmis_Data..tb200410_txscb
insert into tb200410_xskjpz select* from bizmis_Data..tb200410_xskjpz
insert into tb200410_xxtz select* from bizmis_Data..tb200410_xxtz
insert into tb200410_xykzfxx select* from bizmis_Data..tb200410_xykzfxx
insert into tb200410_ygys select* from bizmis_Data..tb200410_ygys
insert into tb200410_ykzzs select* from bizmis_Data..tb200410_ykzzs

insert into tb200410_yskmxb select* from bizmis_Data..tb200410_yskmxb

insert into tb200410_ysyfrhj select* from bizmis_Data..tb200410_ysyfrhj
insert into tb200410_ysyfyhj select* from bizmis_Data..tb200410_ysyfyhj
insert into tb200410_yxjjsxd select* from bizmis_Data..tb200410_yxjjsxd
insert into tb200410_yxsmxzb select* from bizmis_Data..tb200410_yxsmxzb
insert into tb200410_yxsmxcb select* from bizmis_Data..tb200410_yxsmxcb
insert into tb200410_yyyrhj select* from bizmis_Data..tb200410_yyyrhj
insert into tb200410_zbhykxfmx select* from bizmis_Data..tb200410_zbyykxfmx
insert into tb200410_zbtjjzb select* from bizmis_Data..tb200410_zbtjjzb
insert into tb200410_zbtjjcb select* from bizmis_Data..tb200410_zbtjjcb
insert into tb200410_zptz select* from bizmis_Data..tb200410_zptz
insert into tb200410_zrrmx select* from bizmis_Data..tb200410_zrrmx…………
……………
………………
数据导入完成后,将中间层服务器连接至新数据库上,并运行前后台程序,检查运行状况。


数据库文件或其他文件误删的恢复

当发生误操作而删除或丢失文件时,可使用FinalDataNt10(中文版)工具或FinalDataEntprise20(英文版)工具恢复文件。注意以下要点:
一、当发生文件丢失时,首先明确目标文件所在的硬盘位置,如C盘、D盘;并停止对目标分区的任何操作,以防磁道被覆盖。
二、将恢复工具安装至目标分区外的另一个分区,如目标盘符为D盘,则安装至C盘。
三、运行恢复工具,对整个目标分区进行全面扫描,扫描完成后在恢复工具界面上查找目标文件。
四、选中所需要恢复的文件,将目标文件保存至另一个磁盘分区。
五、检查保存后的文件使用是否正常,如果使用正常,则可以恢复正常的系统操作。
gototop
 

:end:
gototop
 
1   1  /  1  页   跳转
页面顶部
Powered by Discuz!NT