哈爾濱海月數(shù)據(jù)恢復(fù),技術(shù)亞洲領(lǐng)先 設(shè)為首頁(yè)加入收藏RSS訂閱
中國(guó)區(qū):哈爾濱(總部)鄭州福建深圳沈陽(yáng)合肥大連包頭淄博上海廣州
    南京杭州嘉興武漢濟(jì)南青島新疆太原
亞太區(qū):印度韓國(guó)泰國(guó)新加坡馬來(lái)西亞澳大利亞
Windows
運(yùn)行中的數(shù)據(jù)庫(kù)文件恢復(fù)

  測(cè)試平臺(tái):rhel 4.6 and ids10.00uc3r1

  相關(guān)命令:lsof用于顯示打開(kāi)的文件(list open file),此軟件在其他系統(tǒng)中可能需要另行安裝.

  dd用于覆蓋及復(fù)制文件(convert and copy a file).

  測(cè)試?yán)?

  在正在運(yùn)行的數(shù)據(jù)庫(kù)服務(wù)器中(如下)

  [informix@netsky datafile]$ onstat -d

  IBM Informix Dynamic Server Version 10.00.UC3R1 -- On-Line -- Up 00:56:19 -- 28228 Kbytes

  Dbspaces

  address number flags fchunk nchunks pgsize flags owner name

  4442e7e0 1        0x1       1         1         2048     N informix rootdbs

  4442ec90 2        0x2001 2         1          2048     N T informix tempdbs

  4442ede8 3        0x1        3        1          2048      N informix logdbs

  44523630 4        0x1        4        1          2048     N informix phydbs

  44523788 5       0x1         5        1          2048     N informix workdbs

  445238e0 6       0x1         6        1           2048     N informix testdbs0

  44523a38 7       0x1         7        1           2048     N informix testdbs1

  44523b90 8       0x1         8       1            2048     N informix testdbs2

  44523ce8 9        0x1         9       1            2048    N informix testdbs3

  44523e40 10      0x1        10     1             2048     N informix testdbs4

  10 active, 2047 maximum

  Chunks

  address chunk/dbs offset size free bpages flags pathname

  4442e938 1 1 20 20000 12108 PO-- /opt/informix/datafile/rootdbs

  445342f0 2 2 20 20000 19947 PO-- /opt/informix/datafile/tempdbs

  44534478 3 3 20 20450 397 PO-- /opt/informix/datafile/logdbs

  44534600 4 4 20 20450 19397 PO-- /opt/informix/datafile/phydbs

  44534788 5 5 20 51150 39948 PO-- /opt/informix/datafile/workdbs

  44534910 6 6 0 20000 19911 PO-- /opt/informix/datafile/testdbs0

  44534a98 7 7 0 20000 19947 PO-- /opt/informix/datafile/testdbs1

  44534c20 8 8 0 20000 19947 PO-- /opt/informix/datafile/testdbs2

  44534da8 9 9 0 20000 19947 PO-- /opt/informix/datafile/testdbs3

  4442eb08 10 10 0 20000 19947 PO-- /opt/informix/datafile/testdbs4

  10 active, 2047 maximum

  NOTE: The values in the "size" and "free" columns for DBspace chunks are

  displayed in terms of "pgsize" of the DBspace to which they belong.

  Expanded chunk capacity mode: disabled

  往testdbs0中增加一些測(cè)試數(shù)據(jù)

  informix@netsky ~]$ dbaccess dbmon -

  Database selected.

  >create table ttt (id char(10)) in testdbs0;

  >insert into ttt values('000');

  >insert into ttt values('111');

  做onmode -c強(qiáng)制完全checkpoint,把數(shù)據(jù)刷回磁盤.

  然后刪除數(shù)據(jù)塊testdbs0

  [informix@netsky datafile]$ ll

  drwxrwxr-x 2 informix informix 4096 Nov 27 06:06 bakup

  -rw-rw---- 1 informix informix 41922560 Feb 10 00:06 logdbs

  -rw-rw---- 1 informix informix 41922560 Feb 9 23:14 phydbs

  -rw-rw---- 1 informix informix 41000960 Feb 10 00:06 rootdbs

  -rw-rw---- 1 informix informix 41000960 Feb 9 23:17 tempdbs

  -rw-rw---- 1 informix informix 40960000 Nov 27 06:01 testdbs1 --testdbs0被刪除.

  -rw-rw---- 1 informix informix 104796160 Feb 9 23:13 workdbs

  此時(shí)可以通過(guò)lsof查找數(shù)據(jù)庫(kù)打開(kāi)的文件testdbs0,可以看到該文件已經(jīng)被標(biāo)識(shí)刪除了.

  [root@netsky datafile]# lsof | egrep '(COMMAND|deleted)'

  COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

  oninit 23864 root 261u REG 253,0 40960000 620162 /opt/informix/datafile/testdbs0 (deleted)

  oninit 23868 root 258u REG 253,0 40960000 620162 /opt/informix/datafile/testdbs0 (deleted)

  此時(shí)再查看testdbs0上的數(shù)據(jù),并往testdbs0中增加一些數(shù)據(jù).

  informix@netsky ~]$ dbaccess dbmon -

  Database selected.

  > select * from ttt;

  id

  000

  111

  2 row(s) retrieved.

  > insert into ttt values('333');

  1 row(s) inserted.

  做onmode -c強(qiáng)制完全checkpoint,把數(shù)據(jù)刷回磁盤.

  然后把已經(jīng)刪除的testdbs0恢復(fù)出來(lái)備份.

  在這里,結(jié)合lsof的輸出信息PID進(jìn)入相應(yīng)的目錄,再通過(guò)FD號(hào)進(jìn)行dd恢復(fù).

  [root@netsky fd]# cd /proc/23864/fd

  [root@netsky fd]# ll

  total 13

  lr-x------ 1 root root 64 Feb 9 23:36 0 -> /opt/informix/msg/en_us/0333/olmsglog.iem

  lrwx------ 1 root root 64 Feb 9 23:36 1 -> /dev/pts/2

  lrwx------ 1 root root 64 Feb 9 23:36 2 -> /dev/pts/2

  lrwx------ 1 root root 64 Feb 9 23:36 256 -> /opt/informix/datafile/rootdbs

  lrwx------ 1 root root 64 Feb 9 23:36 257 -> /opt/informix/datafile/tempdbs

  lrwx------ 1 root root 64 Feb 9 23:36 258 -> /opt/informix/datafile/logdbs

  lrwx------ 1 root root 64 Feb 9 23:36 259 -> /opt/informix/datafile/phydbs

  lrwx------ 1 root root 64 Feb 9 23:36 260 -> /opt/informix/datafile/workdbs

  lrwx------ 1 root root 64 Feb 9 23:36 261 -> /opt/informix/datafile/testdbs0 (deleted)

  lrwx------ 1 root root 64 Feb 9 23:36 262 -> /opt/informix/datafile/testdbs1

  lrwx------ 1 root root 64 Feb 9 23:36 263 -> /opt/informix/datafile/testdbs2

  lrwx------ 1 root root 64 Feb 9 23:36 264 -> /opt/informix/datafile/testdbs3

  lrwx------ 1 root root 64 Feb 9 23:36 265 -> /opt/informix/datafile/testdbs4

  這里在PID 23864的FD(File Descriptor)為261即為我們所要的.將其dd出來(lái)到/tmp/testdbs0

  [root@netsky fd]# dd if=261 of=/tmp/testdbs0

  80000+0 records in

  80000+0 records out

  完成以上操作后,停止數(shù)據(jù)庫(kù).

  [informix@netsky datafile]$ onmode -ky

  將恢復(fù)的數(shù)據(jù)文件拷回原目錄,并修改權(quán)限

  [informix@netsky datafile]$ cp /tmp/testdbs0 /opt/informix/datafile/testdbs0

  [informix@netsky datafile]$ chmod 660 testdbs0 ;chown informix:informix testdbs0

  重新啟動(dòng)數(shù)據(jù)庫(kù)

  [informix@netsky datafile]$ oninit -vy

  驗(yàn)證數(shù)據(jù)文件恢復(fù).

  [informix@netsky datafile]$ dbaccess dbmon -

  Database selected.

  > select * from ttt;

  id

  000

  111

  333

  3 row(s) retrieved.

  例子驗(yàn)證,在testdbs0被刪除后,文件被刪除后,數(shù)據(jù)上并未完全刪除的,只是其inode信息在系統(tǒng)上被刪除.但正在使用其的程序仍保留了這個(gè)inode信息,程序仍可以往里面寫入信息..在程序關(guān)閉前,可通過(guò)FD(File Descriptor)的方式進(jìn)行恢復(fù).

  注意:要求的是文件必須仍被打開(kāi)..這樣的操作并不是十分保險(xiǎn)的,可能會(huì)造成數(shù)據(jù)損壞或者缺少.

  -rw-rw---- 1 informix informix 40960000 Nov 27 06:01 testdbs2

  -rw-rw---- 1 informix informix 40960000 Nov 27 06:01 testdbs3

  -rw-rw---- 1 informix informix 40960000 Nov 27 06:01 testdbs4

 
客戶服務(wù) +more
上門服務(wù)
服務(wù)承諾
異地恢復(fù)
收費(fèi)標(biāo)準(zhǔn)
付款方式
疑難解答
服務(wù)特色 +more
·免費(fèi)檢測(cè)
·免費(fèi)提供3天備份
·專業(yè)工程師提供服務(wù)
·免費(fèi)清潔送修的介質(zhì)
·數(shù)據(jù)恢復(fù)前報(bào)價(jià),客戶確認(rèn)后工程師開(kāi)始數(shù)據(jù)恢復(fù)
·數(shù)據(jù)恢復(fù)不成功不收費(fèi)
·與客戶簽訂保密協(xié)議,對(duì)客戶的數(shù)
 據(jù)嚴(yán)格保密,整個(gè)恢復(fù)過(guò)程不會(huì)對(duì)
 客戶的原盤有任何的寫操作,以確
 保原盤的數(shù)據(jù)完全

·免費(fèi)參觀恢復(fù)全過(guò)程

·工程師在線免費(fèi)咨詢

·專業(yè)工程師提供服務(wù)
服務(wù)器數(shù)據(jù)恢復(fù) 點(diǎn)擊這里給我發(fā)消

息
數(shù)據(jù)庫(kù)修復(fù)
點(diǎn)擊這里給我發(fā)

消息
硬盤數(shù)據(jù)恢復(fù)
點(diǎn)擊這里給我發(fā)消

息
主站蜘蛛池模板: 亚洲乱码日产一区三区| 欲色aV无码一区二区人妻 | 亚洲一区无码中文字幕| 精品福利一区二区三区| 无码精品人妻一区二区三区影院| 国产在线观看一区二区三区| 狠狠做深爱婷婷久久综合一区| 精品久久久久久中文字幕一区| 香蕉久久ac一区二区三区| 日韩精品一区二区三区影院| 一区二区三区在线观看免费| 中文字幕无码一区二区三区本日 | 日本一区午夜艳熟免费| 国产一区二区三区高清在线观看 | 亚洲日本va午夜中文字幕一区| 亚洲一区中文字幕在线电影网| 成人精品视频一区二区| 国产主播一区二区三区 | 国产成人精品视频一区二区不卡 | 亚洲AV无码一区二区一二区| 免费精品一区二区三区在线观看| 国产高清在线精品一区二区三区| 国产成人精品一区二区三区| 高清一区二区三区免费视频| 亚洲一区AV无码少妇电影| 午夜视频在线观看一区二区| 亚洲片国产一区一级在线观看| 国产精品一区二区av| 亚洲乱码一区av春药高潮| 日韩精品久久一区二区三区| 国产成人精品一区二区三区无码| 精品国产一区AV天美传媒| 色一情一乱一伦一区二区三区| 亚洲AV乱码一区二区三区林ゆな | 精品一区二区91| 91视频一区二区| 国产精品小黄鸭一区二区三区 | 国产香蕉一区二区在线网站| 精品一区二区三区影院在线午夜 | 麻豆AV天堂一区二区香蕉| 国精产品一区一区三区免费视频|