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"