Archivelog does not require hot preparation and can completely restore damaged or deleted datafile (original)

Source: Internet
Author: User
Tags log sql require backup
Restore | original
Prerequisite: The deleted table space is created when the database is in Archivelog mode

Restore the specific actions as follows:
sql> archive log list;
Database Log Mode Archive mode
Automatic Archival Enabled
Archive Destination F:\oracle\ora92\RDBMS
Oldest online log sequence 23
Next Log sequence to archive 25
Current log Sequence 25

sql> alter tablespace backuptest offline;
Alter tablespace backuptest offline
*
ERROR at line 1:
Ora-01109:database not open


sql> ALTER DATABASE datafile ' F:\BACKUP.DBF ' offline;

Database altered.

sql> ALTER DATABASE open;

Database altered.

sql> alter tablespace backuptest offline immediate;

Tablespace altered.

Sql> select * from V$recover_file;

file# ONLINE online_ ERROR change# time
---------- ------- ------- ----------------------------------------------------------------- ---------- ---------
One OFFLINE OFFLINE FILE not FOUND 0

sql> ALTER DATABASE Create DataFile ' f:\backup.dbf ' as ' f:\backup.dbf ';

Database altered.

Sql> select * from V$recover_file;

file# ONLINE online_ ERROR change# time
---------- ------- ------- ----------------------------------------------------------------- ---------- ---------
One OFFLINE OFFLINE 3074706 03-nov-04

sql> recover tablespace backuptest;
Media recovery complete.
sql> alter tablespace backuptest online;

Tablespace altered.

Sql> select * from backup;

Id
----------
1
2

So far, ^_^ has been fully restored.


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.