Restoration Method for accidental deletion of ORACLE data files on the EXT4 file system

Source: Internet
Author: User
Tags bz2 testdisk

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
 
 
  1. Use PRM to scan the recovered data file
 
Non-dictionary mode
 
 
Related Article

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.