Oracle redo log maintenance and oracleredo log
Environment
OS: Red Hat Linux As 5
DB: 10.2.0.1
1. add the log group alter database add logfile group 4 ('/u01/app/oracle/oradata/logs L/redo04.log') size 50 m;
2. add a log group (specified log already exists) alter database add logfile group 4 ('/u01/app/oracle/oradata/logs L/redo04.log') size 50 m reuse;
3. add the log member alter database add logfile member '/u01/app/oracle/oradata/logs L/redo0401.log' to group 4;
4. add a log member (specified log already exists) alter database add logfile member '/u01/app/oracle/oradata/logs L/redo0401.log' reuse to group 4;
5. Delete the log group alter database drop logfile group 4;
6. Delete the log member alter database drop logfile member '/u01/app/oracle/oradata/logs L/redo0401.log ';
7. To change the location of a log group file, follow these steps:
(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 '/u01/app/oracle/oradata/logs L/redo0401.log' to '/u02/app/oracle/oradata/logs L/redo0401.log ';
(5) open database
-- The End --
In Oracle databases, there is a log file called redo log file, which is commonly known as redolog. There are two types of redolog: Online redo logs and archived logs. ONLINE Redo log online redo log is mainly used for: the Oracle database server suddenly loses power, suddenly restarts, or executes shutdown abort and other commands so that after the server restarts, oracle Database cannot start the instance normally. At this point, online redo logs are useful. Oracle will use online redo logs to restore the database to the time before the server power loss, so that the database can be started normally. In Oracle databases, by default, there are at least two redo log groups, and each group contains at least one redo log file. The log group is not automatically added. After a full log is written, the next log is automatically written. After the next one is fully written, it will start from the first one.
Archive redo log archive log is mainly used for hardware-level errors: the disk's Bad Sectors cause read and write failures, disk damage, and database data loss. Archive log files are used to restore the database to the time point where the archive log is located, and then restore the database to the current time point through online redo log files. Archive log files can be considered as backups of online redo log files. That is, when a redo log file is filled up, the archived log file will keep a copy of its backup. (As mentioned above, online redo log files will be automatically overwritten). Therefore, archiving log files are backups of old online log files.