Data File deleted by rm can be restored without the rman Tool

Source: Internet
Author: User
When we accidentally rm data files in Linux, we must be calm. Do not shut down the database, restart the operating system, or perform other dangerous operations, because we do not know the database running status.

When we accidentally rm data files in Linux, we must be calm. Do not shut down the database, restart the operating system, or perform other dangerous operations, because we do not know the database running status.

Introduction: My friend used rm for a moment. I deleted the Oracle data file and asked for help. When I was helping my friend restore the database, When I encountered a recover, if an error is reported, the archive log no. 28739 cannot be found, so that I cannot synchronize the scn or open the database. This is a typical case of discontinuous archiving logs. I finally told him to be prepared. This real case has triggered my thinking. If my friend didn't take the rman rescue measures at the time, could it be impossible to restore the data file without using rman! Finally, I found the answer :)

Case
1. System solaris SunOS TJLT-YDWG6 5.9 Generic_122300-25 sun4u iSCSI SUNW, Sun-Fire-V890
DB OracleDatabase 10g Enterprise Edition Release 10.2.0.1.0-64bi
2. Case Description
The onsite engineer used the rm-rf *. dbf command to delete all the data files.
Now there is a backup in May 4
Restore database until time "to_date ('2017-05-04 12:00:00 ', 'yyyy-mm-dd hh24: mi: ss ')"; the recovery result shows that the file has been copied back to finish restore complete.
Synchronize
RMAN> recover database until time "to_date ('2017-05-04 11:00:00 ', 'yyyy-mm-dd hh24: mi: ss ')";
Starting recover at 14:02:42
Using channel ORA_DISK_1
Starting media recovery
Unable to find archive log
Archive log thread = 1 sequence = 28739 the archive log of 28739 is missing, resulting in inconsistent undotbs01.dbf files
Oracle Error:
ORA-01547: warning: RECOVER succeeded but open resetlogs wocould get error below
ORA-01194: file 2 needs more recovery to be consistent
ORA-01110: data file 2: '/opt/oradata/kpidb/undotbs01.dbf'
RMAN-00571: ========================================================== ==============================
RMAN-00569: ==================== error message stack follows ==========================
RMAN-00571: ========================================================== ==============================
RMAN-03002: failure of recover command at 14:02:51
RMAN-06054: media recovery requesting unknown log: thread 1 seq 28739 lowscn 1513525474
Leonarding
2012.7.26

This kind of emergency may happen frequently in our work. In this case, the first thing we need to do is to calm down. After the above problem comes to me, I found that the database has changed to the mount state, and it is too late to restore the data file using the file handle. So I adopted the conventional recovery method. I did not expect that the archiving logs are not complete, I immediately went to "Sparta" and finally told my friends that it would take courage to become a DBA.

Next, I will use my own test database to demonstrate how to use the file handle to restore the deleted data files when the database is still in the open state after the rm-level data files of the operating system are deleted, and finally open the database experiment! I am a rigorous person, so I first made a "compressed full database backup" to be prepared.

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.