Recover deleted file on Ext4

Source: Internet
Author: User
If the filesystem is EXT4, the Ext3grep tool can ' t recover the deleted files,
But we can use the other tool to recover.

For example:
Sql> select name from V$datafile;

NAME
--------------------------------------------------------------------------------
/opt/app/oracle/oradata/goolen/system01.dbf
/opt/app/oracle/oradata/goolen/sysaux01.dbf
/opt/app/oracle/oradata/goolen/undotbs01.dbf
/opt/app/oracle/oradata/goolen/goolen01.dbf

+++delete One of DataFile
Sql>! Rm-rf/opt/app/oracle/oradata/goolen/goolen01.dbf

+++once the database is closed,the handle of the file was disappears
Sql> Shut Abort
ORACLE instance shut down.

[Root@localhost ~]# Df-h
Filesystem Size used Avail use% mounted on
/DEV/CCISS/C0D0P2 49G 17G 29G 38%/
Tmpfs 2.9G 895M 2.0G 31%/DEV/SHM
/dev/cciss/c0d0p1 97M 34M 59M 36%/boot
/DEV/CCISS/C0D1P1 135G 69G 59G 54%/tol

+++restore deleted file
[Root@localhost ~]# extundelete/dev/cciss/c0d0p2--restore-file '/opt/app/oracle/oradata/goolen/goolen01.dbf '
warning:extended attributes is not restored.
Warning:ext3_feature_incompat_recover is set.
The partition should is unmounted to undelete any files without further data loss.
If the partition is not a currently mounted, this message indicates
It is improperly unmounted, and you should run fsck before continuing.
If you decide to continue, Extundelete may overwrite some of the deleted
Files and make recovering those files impossible. You should unmount the
File system and check it with fsck before using Extundelete.
Would to continue? (y/n)
Y
Loading FileSystem metadata ... 391 groups loaded.
Loading Journal Descriptors ... 25090 descriptors loaded.
Writing Output to directory recovered_files/
Restored Inode 1065596 to file recovered_files/opt/app/oracle/oradata/goolen/goolen01.dbf

+++recovered data is saved in Recovered_files
[Root@localhost ~]# CD recovered_files/
[Root@localhost recovered_files]# ls
Opt
[Root@localhost recovered_files]# CD opt/
[Root@localhost opt]# ls
App
[Root@localhost opt]# CD app/
[Root@localhost app]# ls
Oracle
[Root@localhost app]# CD oracle/
[Root@localhost oracle]# ls
Oradata
[Root@localhost oracle]# CD oradata/
[Root@localhost oradata]# ls
Goolen
[Root@localhost oradata]# CD goolen/
[Root@localhost goolen]# ls
Goolen01.dbf
[Root@localhost goolen]# CP goolen01.dbf/opt/app/oracle/oradata/goolen/
[Root@localhost goolen]# chown oracle:oinstall/opt/app/oracle/oradata/goolen/goolen01.dbf

+++recover Database:
Sql> Startup
ORACLE instance started.

Total System Global area 1570009088 bytes
Fixed Size 2213696 bytes
Variable Size 1040189632 bytes
Database buffers 520093696 bytes
Redo buffers 7512064 bytes
Database mounted.
Ora-01157:cannot identify/lock data file 6-see DBWR trace file
Ora-01110:data file 6: '/OPT/APP/ORACLE/ORADATA/GOOLEN/GOOLEN01.DBF '

sql> recover datafile 6;
Media recovery complete.
sql> ALTER DATABASE open;

Database altered.


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.