If the ORACLE data file on the EXT4 file system is accidentally deleted, consider the following two recovery methods:
Use testdisk to restore data files from the perspective of the file system
Use prmscan to restore data files from the perspective of oracle data blocks
Here we will introduce how to use testdisk to restore data files on ext4:
Delete users data files
[Oracle @ dbdao01 ~] $ Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/VolGroup00-LogVol00
990G 14G 925G 2%/
/Dev/sda1 99 M 23 M 71 M 25%/boot
Tmpfs 2.0G 976 M 1.1G 49%/dev/shm
/Dev/sdb1 20G 3.2G 16G 17%/home/oracle/oradata
[Root @ dbdao01 ~] # Rm-rf/home/oracle/oradata/auchan/users01.dbf
SQL> select object_name, object_id, data_object_id from dba_objects where object_name = 'torder ';
OBJECT_NAME OBJECT_ID DATA_OBJECT_ID
---------------------------------------
TORDER 14162 14162
SQL> select count (*) from auchan. torder;
COUNT (*)
----------
91982
SQL> select object_name, object_id, data_object_id from dba_objects where object_name = 'TT ';
OBJECT_NAME OBJECT_ID DATA_OBJECT_ID
---------------------------------------
TT 14205 14205
SQL> select count (*) from auchan. tt;
COUNT (*)
----------
16383
TESTDISK test
Upload TESTDISK software and decompress it for installation
[Root @ dbdao01 ~] # Mkdir-p testdisk
[Root @ dbdao01 testdisk] # ls-l
Total 2740
-Rw-r -- 1 root 2801512 Apr 4 testdisk-6.14.linux26.tar.bz2
[Root @ dbdao01 testdisk] # tar-xf testdisk-6.14.linux26.tar.bz2
Detach a disk with deleted data to prevent overwriting.
[Root @ dbdao01 ~] # Umount-l/home/oracle/oradata
[Root @ dbdao01 ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/VolGroup00-LogVol00
990G 13G 927G 2%/
/Dev/sda1 99 M 23 M 71 M 25%/boot
Tmpfs 2.0G 492 M 1.5G 25%/dev/shm
Use testdisk for restoration
[Root @ dbdao01 testdisk-6.14] #./testdisk_static
Click CREATE to CREATE a log
Select the disk of the file to be restored
Select default here
Select Advanced
Select List
Find the file to be restored and copy it by C
Paste the file to another disk
[Root @ dbdao01 auchan] # ls-ll
Total 1360700
-Rw-r -- 1 root 1391992832 Apr 6 2015 users01.dbf
- Use PRM to scan the recovered data file
Non-dictionary mode