Oracle database files are mistakenly deleted how to recover

Source: Internet
Author: User
Tags header oracle database

First, recover via file descriptor (descriptor) (RM delete data file not backed up)

Scene: misoperation Delete data file tp10.dbf

Rm-rf/u01/app/oracle/oradata/bxdb/tp10.dbf

Select Ts#,file#,name,bytes,status from V$datafile;

Ps-ef |grep dBW |grep-v grep

Cd/proc/12308/fd

1. Method One: Online recovery
Cp/proc/13979/fd/264/u01/app/oracle/oradata/ocp/newtp12.dbf
ALTER DATABASE datafile 7 offline;
Alter DATABASE rename file '/u01/app/oracle/oradata/oca/tp12.dbf ' to '/u01/app/oracle/oradata/ocp/newtp12.dbf ';
Recover DataFile 7;
ALTER DATABASE datafile online;

2. Method Two: Off-line recovery
Cp/proc/13979/fd/264/u01/app/oracle/oradata/ocp/newtp12.dbf
Shutdown immediate;
Shutdown abort;
Startup
Recover database;
ALTER DATABASE open;

Ii. Access to document number

1. Method One: bbed get file Number
Set filename '/proc/13979/fd/264 '
Set BlockSize 8192
Set filename '/proc/13979/fd/264 '
P KCVFH--a position in bbed
P KCVFH.KCVFHRFN--Display relative file number information (print)
Exit

2, method Two: Through the OD command file number information
9i file number offset is 280, plus the data file header of an operating system block 8192,od Skip 8472 to get the file number
Od-j 8472-t X1 262|head-1--16 output
Od-j 8472-t D2 262|head-1--Decimal output

The offset of the 10g/11g file number is 368, plus an operating system block on the header of the data file 8192,od skip 8560 to get the file number
Od-j 8560-t X1 264|head-1--16 output
Od-j 8560-t D2 264|head-1--Decimal output

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/database/storage/

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.