linux中extundelete恢複已刪除的數據文件

extundelete就是用來恢複文件了,只要我們刪除後的文件沒有被覆蓋就可以常用使用此工具來恢複了,下面來看個例子。


因爲人員離職鬧得不愉快,系統工程師離職後,由于公司未及時關閉其vpn,數據庫伺服器(Linux 6.5 Oracle 11.2.0.1)帳號未及時被修改,最後直接上去rm ORACLE_BASE給幹掉,悲劇的是ORADATA目錄也在裏面,更加悲劇的是所有數據文件都在裏面.也就是說數據庫徹底被刪除,而且沒有任何備份.朋友咨詢了我,讓我給予支持.最後比較幸運,文件沒有被覆蓋,inode都還在,通過extundelete順利恢複所有數據文件,控制文件,redo文件(extundelete恢複Linux被刪除文件),數據庫順利打開,實現0丟失,算是一次完美的恢複

代碼如下

[[email protected] tmp]# tar xvf extundelete-0.2.4.tar
extundelete-0.2.4/
extundelete-0.2.4/acinclude.m4
extundelete-0.2.4/missing
extundelete-0.2.4/autogen.sh
extundelete-0.2.4/aclocal.m4
extundelete-0.2.4/configure
extundelete-0.2.4/LICENSE
extundelete-0.2.4/README
extundelete-0.2.4/install-sh
extundelete-0.2.4/config.h.in
extundelete-0.2.4/src/
extundelete-0.2.4/src/extundelete.cc
extundelete-0.2.4/src/block.h
extundelete-0.2.4/src/kernel-jbd.h
extundelete-0.2.4/src/insertionops.cc
extundelete-0.2.4/src/block.c
extundelete-0.2.4/src/cli.cc
extundelete-0.2.4/src/extundelete-priv.h
extundelete-0.2.4/src/extundelete.h
extundelete-0.2.4/src/jfs_compat.h
extundelete-0.2.4/src/Makefile.in
extundelete-0.2.4/src/Makefile.am
extundelete-0.2.4/configure.ac
extundelete-0.2.4/depcomp
extundelete-0.2.4/Makefile.in
extundelete-0.2.4/Makefile.am
[[email protected] tmp]# cd extundelete-0.2.4
[[email protected] extundelete-0.2.4]# ./configure
Configuring extundelete 0.2.4
Writing generated files to disk
[[email protected] extundelete-0.2.4]# make && make install
make -s all-recursive
Making all in src
Making install in src
/usr/bin/install -c extundelete '/usr/local/bin'
[[email protected] extundelete-0.2.4]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 244G 11G 221G 5% /
tmpfs 16G 72K 16G 1% /dev/shm
/dev/sda1 190M 62M 119M 35% /boot
/dev/sdb1 2.0T 71M 1.9T 1% /home
[[email protected] extundelete-0.2.4]# umount /dev/sdb1
umount: /home: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
[[email protected] extundelete-0.2.4]# fuser -m -u /home
/home: 3914c(oracle) 8372c(oracle)
[[email protected] extundelete-0.2.4]# kill -9 3914
[[email protected] extundelete-0.2.4]# fuser -m -u /home
/home: 8372c(oracle)
[[email protected] extundelete-0.2.4]# kill -9 8372
[[email protected] extundelete-0.2.4]# fuser -m -u /home
[[email protected] extundelete-0.2.4]# umount /dev/sdb1
[[email protected] extundelete-0.2.4]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 244G 11G 221G 5% /
tmpfs 16G 72K 16G 1% /dev/shm
/dev/sda1 190M 62M 119M 35% /boot
[[email protected] extundelete-0.2.4]# extundelete /dev/sdb1 --restore-all
NOTICE: Extended attributes are not restored.
Loading filesystem metadata ... 16384 groups loaded.
Loading journal descriptors ... 26542 descriptors loaded.
Searching for recoverable inodes in directory / ...
18896 recoverable inodes found.
Looking through the directory structure for deleted files ...
2 recoverable inodes still lost.
Unable to restore inode 43778050 (file.43778050): Space has been reallocated.
[[email protected] extundelete-0.2.4]# ls
acinclude.m4 autogen.sh config.h.in config.status configure.ac install-sh Makefile Makefile.in
aclocal.m4 config.h config.log configure depcomp LICENSE Makefile.am missing
[[email protected] extundelete-0.2.4]# cd RECOVERED_FILES/
[[email protected] RECOVERED_FILES]# ls
app file.43778051 oracle oraInventory
[[email protected] RECOVERED_FILES]# cd app
[[email protected] app]# ls
admin cfgtoollogs diag oracle oradata orcl ORCL
[[email protected] app]# cd oradata
[[email protected] oradata]# ls
orcl
[[email protected] oradata]# cd orcl
[[email protected] orcl]# ls
control01.ctl redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf undotbs01.dbf users01.dbf
[[email protected] orcl]# ls -ltr
total 2908776
-rw-r--r--. 1 root root 734011392 Nov 18 02:06 system01.dbf
-rw-r--r--. 1 root root 1069555712 Nov 18 02:06 sysaux01.dbf
-rw-r--r--. 1 root root 120594432 Nov 18 02:06 undotbs01.dbf
-rw-r--r--. 1 root root 887365632 Nov 18 02:06 users01.dbf
-rw-r--r--. 1 root root 9748480 Nov 18 02:06 control01.ctl
-rw-r--r--. 1 root root 52429312 Nov 18 02:06 redo01.log
-rw-r--r--. 1 root root 52429312 Nov 18 02:06 redo02.log
-rw-r--r--. 1 root root 52429312 Nov 18 02:06 redo03.log
[[email protected] orcl]#

再次提醒各位:數據庫備份重于一切,防天災的同時還要防人災,也希望圈子裏面以後不要聽到類似故障.

原文來自:http://www.xifenfei.com/5640.html

更多相關文章
  • 恢複誤刪除磁盤組功能用到不多但有時因爲不小心誤刪除了一些組我們就需要進行恢複了,下面來爲各位介紹kfed恢複誤刪除磁盤組詳解,希望文章能夠幫助到大家在某些情況下,可能因爲誤操作,不小先drop diskgroup,這個時候千萬別緊張,出現此類故障,可以通過kfed進行完美恢複(數據0丟失).如果進一
  • 蘋果ios8.0.2中恢複已刪除的照片
    自從蘋果手機ios8出來之後我們就可以對己刪除的照片進行恢複操作了,下文一聚教程小編來告訴
  • lsof命令可以把在linux系統中誤刪除的文件進行恢複了,具體lsof命令是以什麽形式來恢複我們來看看下文就知道了.前提條件:該文件在刪除後,仍然被進程訪問著,所以,比較適合用于恢複日志類的文件.當Linux計算機受到入侵時,常見的情況是日志文件被刪除,以掩蓋攻擊者的蹤迹.管理錯誤也可能導致意外刪 ...
  • 電腦中怎麽找回並恢複誤刪的文件(win7/8)
    可能有時我們不小心把重要文件刪除了但還把回收站給清除了,那麽這些誤刪除的文件要怎麽恢複呢,
  • 今天小編來給各位同學簡單介紹一下在oracle中bbed恢複刪除數據實例,希望此教程 對各位同學會有所幫助哦.恢複己刪除數據一.創建模擬環境 代碼如下 SQL> create table hr.xifenfei (i
  • 小米手機恢複誤刪的圖片誤刪照片恢複方法(小米2S/小米3/紅米note)
    先申明一下此方法可用于小米所有系列手機中,包括有小米2S 小米3 紅米note 三款機型中
  • 本文章給各位同學介紹一些常用的在使用oracle 11g linux 建立表空間 用戶授權 數據庫導入導出語句,有需要了解的同學可進入參考.sqlplus/as sysdba-- 查看dbf存放位置 select *
  • oracle中fdisk 導致的ASM磁盤數據丟失 有需要的朋友可參考一下.11.2.0.3 數據庫因asm磁盤頭塊損壞宕機,出現錯誤ORA-15196.更詳細的錯誤如下:ORA-15196: invalid ASM block header [kfc.c:26076] [endian_kfbh]
一周排行