Show parameter recover -- view the path for storing archived log files
Alter database archive -- change the database to archive Mode
Archive log list/SQL> select name, log_mode from v $ database; view the current status of the database
Modify the path of an archived Log File
[Oracle @ localhost 2010_06_07] $ mkdir/home/oracle/yow./ archive
[Oracle @ localhost 2010_06_07] $ exit
Exit
SQL> alter system set log_archive_dest_1 = 'location =/home/oracle/yow./ archive 'scope = both;
System altered.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination/home/oracle/yow./ archive
Oldest online log sequence 40
Next log sequence to archive 43
Current log sequence 43
Recover principle:
In media recover, we are most concerned with the start and end of recover. So how does oracle determine where to start?
When the database is normally shut down, the scn of the control file and the scn of the data file should be consistent. If they are inconsistent, the system prompts that the database needs to be restored.
Note the following two views:
The content in V $ datafile_header comes from the header of the data file.
The content in V $ datafile comes from the control file.
The values of the checkpoint_change # Fields of the two views must be consistent. If not, the system prompts that recover is required during open.
Then, v $ datafile_header can determine the starting SCN value of application Redo, while v $ datafile can determine the ending SCN value of application redo)
If you are interested, please try it out!
In addition, the reason why oracle can locate the block starting from the log during recover is that the redo sequence and block of the log are recorded at the checkpoint of the datafile header.