linux中extundelete恢复已删除的数据文件

互联网十八般武艺 互联网十八般武艺

extundelete就是用来恢复文件了,只要我们删除后的文件没有被覆盖就可以常用使用此工具来恢复了,下面来看个例子.

因为人员离职闹得不愉快,系统工程师离职后,由于公司未及时关闭其vpn,数据库服务器(Linux 6.5 Oracle 11.2.0.1)帐号未及时被修改,最后直接上去rm ORACLE_BASE给干掉,悲剧的是ORADATA目录也在里面,更加悲剧的是所有数据文件都在里面.也就是说数据库彻底被删除,而且没有任何备份.朋友咨询了我,让我给予支持.最后比较幸运,文件没有被覆盖,inode都还在,通过extundelete顺利恢复所有数据文件,控制文件,redo文件(extundelete恢复Linux被删除文件),数据库顺利打开,实现0丢失,算是一次完美的恢复,代码如下:

  1. [root@DB1tmp]#tarxvfextundelete-0.2.4.tar
  2. extundelete-0.2.4/
  3. extundelete-0.2.4/acinclude.m4
  4. extundelete-0.2.4/missing
  5. extundelete-0.2.4/autogen.sh
  6. extundelete-0.2.4/aclocal.m4
  7. extundelete-0.2.4/configure
  8. extundelete-0.2.4/LICENSE
  9. extundelete-0.2.4/README
  10. extundelete-0.2.4/install-sh
  11. extundelete-0.2.4/config.h.in
  12. extundelete-0.2.4/src/
  13. extundelete-0.2.4/src/extundelete.cc
  14. extundelete-0.2.4/src/block.h
  15. extundelete-0.2.4/src/kernel-jbd.h
  16. extundelete-0.2.4/src/insertionops.cc
  17. extundelete-0.2.4/src/block.c
  18. extundelete-0.2.4/src/cli.cc
  19. extundelete-0.2.4/src/extundelete-priv.h
  20. extundelete-0.2.4/src/extundelete.h
  21. extundelete-0.2.4/src/jfs_compat.h
  22. extundelete-0.2.4/src/Makefile.in
  23. extundelete-0.2.4/src/Makefile.am
  24. extundelete-0.2.4/configure.ac
  25. extundelete-0.2.4/depcomp
  26. extundelete-0.2.4/Makefile.in
  27. extundelete-0.2.4/Makefile.am
  28. [root@DB1tmp]#cdextundelete-0.2.4
  29. [root@DB1extundelete-0.2.4]#./configure
  30. Configuringextundelete0.2.4
  31. Writinggeneratedfilestodisk
  32. [root@DB1extundelete-0.2.4]#make&&makeinstall
  33. make-sall-recursive
  34. Makingallinsrc
  35. Makinginstallinsrc
  36. /usr/bin/install-cextundelete'/usr/local/bin'
  37. [root@DB1extundelete-0.2.4]#df-h
  38. FilesystemSizeUsedAvailUse%Mountedon
  39. /dev/sda3244G11G221G5%/
  40. tmpfs16G72K16G1%/dev/shm
  41. /dev/sda1190M62M119M35%/boot
  42. /dev/sdb12.0T71M1.9T1%/home
  43. [root@DB1extundelete-0.2.4]#umount/dev/sdb1
  44. umount:/home:deviceisbusy.
  45. (Insomecasesusefulinfoaboutprocessesthatuse
  46. thedeviceisfoundbylsof(8)orfuser(1))
  47. [root@DB1extundelete-0.2.4]#fuser-m-u/home
  48. /home:3914c(oracle)8372c(oracle)
  49. [root@DB1extundelete-0.2.4]#kill-93914
  50. [root@DB1extundelete-0.2.4]#fuser-m-u/home
  51. /home:8372c(oracle)
  52. [root@DB1extundelete-0.2.4]#kill-98372
  53. [root@DB1extundelete-0.2.4]#fuser-m-u/home
  54. [root@DB1extundelete-0.2.4]#umount/dev/sdb1
  55. [root@DB1extundelete-0.2.4]#df-h
  56. FilesystemSizeUsedAvailUse%Mountedon
  57. /dev/sda3244G11G221G5%/
  58. tmpfs16G72K16G1%/dev/shm
  59. /dev/sda1190M62M119M35%/boot
  60. [root@DB1extundelete-0.2.4]#extundelete/dev/sdb1--restore-all
  61. NOTICE:Extendedattributesarenotrestored.
  62. Loadingfilesystemmetadata...16384groupsloaded.
  63. Loadingjournaldescriptors...26542descriptorsloaded.
  64. Searchingforrecoverableinodesindirectory/...
  65. 18896recoverableinodesfound.
  66. Lookingthroughthedirectorystructurefordeletedfiles...
  67. 2recoverableinodesstilllost.
  68. Unabletorestoreinode43778050(file.43778050):Spacehasbeenreallocated.
  69. [root@DB1extundelete-0.2.4]#ls
  70. acinclude.m4autogen.shconfig.h.inconfig.statusconfigure.acinstall-shMakefileMakefile.in
  71. aclocal.m4config.hconfig.logconfiguredepcompLICENSEMakefile.ammissing
  72. [root@DB1extundelete-0.2.4]#cdRECOVERED_FILES/
  73. [root@DB1RECOVERED_FILES]#ls
  74. appfile.43778051oracleoraInventory
  75. [root@DB1RECOVERED_FILES]#cdapp
  76. [root@DB1app]#ls
  77. admincfgtoollogsdiagoracleoradataorclORCL
  78. [root@DB1app]#cdoradata//phpfensi.com
  79. [root@DB1oradata]#ls
  80. orcl
  81. [root@DB1oradata]#cdorcl
  82. [root@DB1orcl]#ls
  83. control01.ctlredo01.logredo02.logredo03.logsysaux01.dbfsystem01.dbfundotbs01.dbfusers01.dbf
  84. [root@DB1orcl]#ls-ltr
  85. total2908776
  86. -rw-r--r--.1rootroot734011392Nov1802:06system01.dbf
  87. -rw-r--r--.1rootroot1069555712Nov1802:06sysaux01.dbf
  88. -rw-r--r--.1rootroot120594432Nov1802:06undotbs01.dbf
  89. -rw-r--r--.1rootroot887365632Nov1802:06users01.dbf
  90. -rw-r--r--.1rootroot9748480Nov1802:06control01.ctl
  91. -rw-r--r--.1rootroot52429312Nov1802:06redo01.log
  92. -rw-r--r--.1rootroot52429312Nov1802:06redo02.log
  93. -rw-r--r--.1rootroot52429312Nov1802:06redo03.log
  94. [root@DB1orcl]#

再次提醒各位:数据库备份重于一切,防天灾的同时还要防人灾,也希望圈子里面以后不要听到类似故障.

相关广告
  • linux中extundelete恢复已删除的数据文件 linux中extundelete恢复已删除的数据文件 linux中extundelete恢复已删除的数据文件
相关阅读

linux中extundelete恢复已删除的数据文件

2019/10/10 17:45:46 | 谷歌SEO算法 | 谷歌CEO