Oracle restores data by archiving logs

Source: Internet
Author: User

Oracle log modes include archivelog (enable archive log) and noarchivelog.
View the Database Log mode:
Select log_mode from v $ database;
 
 

Log_mode
-----------------------------------
Archivelog
 
How to enable Oracle Archiving:
1. Edit the init. ora file as follows:
Log_archive_start = true
Log_archive_dest_1 = "LOCATION = D: \ Oracle \ oradata \ ORCL \ archive"
Og_archive_format = % ORACLE_SID % T % TS % S. ARC
 
 
 
Oracle archive log restoration data (please make a cold backup before restoration ):
 
Sqlplus/nolog
Conn/as sysdba;
Archive log list; (view the log file list and view the strings xxx. dbf to xx.txt available for a single log file)
 
Recover database until time '2017-09-15: 15: 00: 00 ';
(Tip: use time-based recovery. The time format is YYYY/MM/DD HH24: MI: SS, which is enclosed in single quotes .)
Time-based recovery)
To use time-based recovery, you must know the time when the record replays log no. 387 (lost replays log) in the V $ log_history archive, run the query statement "select * from v $ log_history where sequence # = 387 ;"
 
 
Or
Recover database until change 9999;
 
Alter database open resetlogs; (before applying this command, make sure that the database has been backed up. If opening fails, the log will be unavailable)

Author "Study Notes"
 

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.