Oracle redo logs
Oracle 's database log is called Redo log, and all data changes are recorded redo log, which can be used to repair a damaged database. The redo log is grouped, and the default is three groups. Redo Log is used in turn, a redo log full, LGWR will switch to the next group of Redo log, this operation called log switch, do log Switch will also do checkpoint, the corresponding information will also be written to the control file.
Oracle has 2 kinds of logs, one called Redo log (redo logs), the other is called Archive log (archive log), but the role of these two logs in the Oracle9i database believes it's hard to say clearly, I'm going to take a look at the oracle9i. Redo logs Redo log file is a LGWR process written from redo log buffer in an Oracle instance and is recycled. This means that a redo log file (group) is full before the next one is written. Archive Logs archive log is when a database is running in archive mode, a redo log file (group) is full, and the ARCN process backs up the contents of the redo log to the archive log, and then the Redo log file (group) is used for the next time.
Redo logs are sure to be written regardless of whether the database is an archive mode. And only the database in archive mode, the redo log will be backed up to form an archive log.
Archived logs are combined with full backups for recovery use after a database problem occurs.
Redolog also known as online logs
Archivelog is the archive log, which is to file the Redolog. First there's redolog, then there's archivelog.
Oracle recovery requires redolog and Archivelog
1. View the system's redo log information:
Sql> select Group#,sequence#,bytes,members,status from V$log;
Sql> Select member from V$logfile;
2. Add a log group
ALTER DATABASE Add logfile Group 4 (' D:\ORACLE\product\10.2.0\oradata\test\redo04.log ') size 50m;
3. Add log Group (specified log already exists)
ALTER DATABASE Add logfile Group 4 (' D:\ORACLE\product\10.2.0\oradata\test\redo04.log ') size 50m reuse;
4. Add Log members
ALTER DATABASE add logfile member ' d:\ORACLE\product\10.2.0\oradata\test\redo0401.log ' to group 4;
5. Add log member (specified log already exists)
ALTER DATABASE add logfile member ' d:\ORACLE\product\10.2.0\oradata\test\redo0401.log ' reuse to Group 4;
6. Delete log Group
ALTER DATABASE drop logfile Group 4;
7. Delete Log members
ALTER DATABASE drop logfile member ' d:\ORACLE\product\10.2.0\oradata\test\redo0401.log ';
8. Change a location for the log group file
(1) Shutdown database
(2) Copy the online redo log files to the new location;
(3) Start database to mount;
(4) Execute the command
Alter DATABASE rename file ' d:\ORACLE\product\10.2.0\oradata\test\redo0401.log ' to ' d:\ ORACLE\product\10.2.0\oradata\test\redo0401.log ';
(5) Open database
9. Archive Redo log file startup Log Archive has two benefits:
1, database backups with archive log can be restored to any point in time.
2, you can back up the database online. By default, the database is not archived log mode. If your data is important, you should enable the archive log mode, or you will probably only revert to the state of the last backup when the database is corrupted. You can check the archive log mode of the database with the following two commands: Sql> select archiver from V$instance; sql> archive log list;