REDO log in Oracle

Oracle's database log is called redo log, and all data changes are recorded in redo log, which can be used to repair damaged databases. Redo logs are grouped, and the default is three groups. Redo logs are used in turn. When a redo log is full, LGWR will switch to the next set of redo logs. This operation is called log switch. When log switch is performed, checkpoint is also performed, and the corresponding information will also be written to the control file. .

1. View the redo log information of the system :

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 a log group (the 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 the 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 the location of 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 files

启动日志归档有两个好处:
         1,带有归档日志的数据库备份可以恢复到任意时间点。
          2,可以在线备份数据库。 缺省情况下,数据库是非归档日志模式。如果你的数据很重要,应该启用归档日志模式,否则数据库损坏时很可能只能恢复到上一次备份时的状态了。可以用以下两条命令检查数据库的归档日志模式: SQL> select archiver from v$instance; SQL> archive log list; 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326772445&siteId=291194637