Oracle的数据库日志称为redo log,所有数据改变都记录redo log,可以用于修复受损的数据库。Redo日志是分组的,,默认是三组。Redo日志是轮流使用的,一个redo log满了,LGWR会切换到下一组redo log,这种操作称为log switch,做log switch的同时也会做checkpoint,相应的信息还会写入控制文件。
1.查看系统的redo log信息:
SQL> select group#,sequence#,bytes,members,status from v$log;
SQL> select member from v$logfile;
2.添加日志组
alter database add logfile group 4 ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\redo04.log') size 50m;
3.添加日志组(指定日志已经存在)
alter database add logfile group 4 ('D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\redo04.log') size 50m reuse;
4.添加日志成员
alter database add logfile member 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\redo0401.log' to group 4;
5.添加日志成员(指定日志已经存在)
alter database add logfile member 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\redo0401.log' reuse to group 4;
6.删除日志组
alter database drop logfile group 4;
7.删除日志成员
alter database drop logfile member 'D:\ORACLE\PRODUCT\10.2.0\ORADATA\TEST\redo0401.log';
8.给日志组文件换一个位置
(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.归档Redo log文件