Extundelete Recovery of deleted data files in Linux

Source: Internet
Author: User


Because the staff turnover is not pleasant, the system engineer after leaving, because the company did not close its VPN in time, the database server (Linux 6.5 Oracle 11.2.0.1) account is not modified, and finally directly up to RM oracle_base to kill, The tragedy is that the Oradata catalogue is also inside, and it is even more tragic that all the data files are in it. That is, the database was completely deleted, and there was no backup. My friend consulted me and let me give my support. Finally, it is lucky that the files are not covered and the inode is still there Through extundelete smoothly recover all data files, control files, redo files (extundelete restore Linux deleted files), the database smoothly open, achieve 0 lost, is a perfect recovery

The code is as follows Copy Code

[ROOT@DB1 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
[ROOT@DB1 tmp]# CD extundelete-0.2.4
[Root@db1 extundelete-0.2.4]#./configure
Configuring Extundelete 0.2.4
Writing generated files to disk
[ROOT@DB1 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 '
[ROOT@DB1 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
[ROOT@DB1 extundelete-0.2.4]# UMOUNT/DEV/SDB1
Umount:/home:device is busy.
(In some cases useful info about processes which use
The device is found by lsof (8) or fuser (1))
[ROOT@DB1 extundelete-0.2.4]# fuser-m-u/home
/HOME:3914C (Oracle) 8372c (Oracle)
[ROOT@DB1 extundelete-0.2.4]# kill-9 3914
[ROOT@DB1 extundelete-0.2.4]# fuser-m-u/home
/HOME:8372C (Oracle)
[ROOT@DB1 extundelete-0.2.4]# kill-9 8372
[ROOT@DB1 extundelete-0.2.4]# fuser-m-u/home
[ROOT@DB1 extundelete-0.2.4]# UMOUNT/DEV/SDB1
[ROOT@DB1 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
[ROOT@DB1 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.
[ROOT@DB1 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
[ROOT@DB1 extundelete-0.2.4]# CD recovered_files/
[ROOT@DB1 recovered_files]# ls
App file.43778051 Oracle Orainventory
[ROOT@DB1 recovered_files]# CD App
[ROOT@DB1 app]# ls
Admin cfgtoollogs diag Oracle Oradata ORCL ORCL
[ROOT@DB1 app]# CD Oradata
[ROOT@DB1 oradata]# ls
Orcl
[ROOT@DB1 oradata]# CD ORCL
[ROOT@DB1 orcl]# ls
Control01.ctl redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf undotbs01.dbf users01.dbf
[ROOT@DB1 orcl]# ls-ltr
Total 2908776
-rw-r--r--. 1 root root 734011392 Nov 02:06 system01.dbf
-rw-r--r--. 1 root root 1069555712 Nov 02:06 sysaux01.dbf
-rw-r--r--. 1 root root 120594432 Nov 02:06 undotbs01.dbf
-rw-r--r--. 1 root root 887365632 Nov 02:06 users01.dbf
-rw-r--r--. 1 root root 9748480 Nov 02:06 control01.ctl
-rw-r--r--. 1 root root 52429312 Nov 02:06 redo01.log
-rw-r--r--. 1 root root 52429312 Nov 02:06 redo02.log
-rw-r--r--. 1 root root 52429312 Nov 02:06 redo03.log
[ROOT@DB1 orcl]#

Remind you again: database backup is more than everything, against natural disasters at the same time to prevent people from disaster, but also hope that the circle in the future do not hear similar failures.

Original from: http://www.xifenfei.com/5640.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.