文档课题:oracle在线增加redo日志组成员.标签:log,app,50,----------,orcl,oracle,日志,redo From: https://blog.51cto.com/u_12991611/5996619
数据库:oracle 11.2.0.4
1、相关知识
oracle通过redo保证数据库事务可以被重演,从而使得在发生故障之后,数据可以被恢复.redo对于oracle数据库至关重要.为保证redo log的冗余性,一个日志组至少需配置两个成员,且最好放在不同的物理盘.在oracle日志条目过来时,会分别同时向两个成员文件写入.若其中一个发生损坏,此时还有另外一个相同的文件.
2、实际操作
SYS@orcl> select group#,bytes/1024/1024 "size(M)",status,archived from v$log;
GROUP# size(M) STATUS ARC
---------- ---------- ---------------- ---
1 50 INACTIVE YES
2 50 INACTIVE YES
3 50 CURRENT NO
SYS@orcl> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo03.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo01.log
SYS@orcl> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo01b.log' to group 1;
Database altered.
SYS@orcl> select group#,members,bytes/1024/1024 "size(M)",status,archived from v$log;
GROUP# MEMBERS size(M) STATUS ARC
---------- ---------- ---------- ---------------- ---
1 2 50 INACTIVE YES
2 1 50 INACTIVE YES
3 1 50 CURRENT NO
SYS@orcl> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo02b.log' to group 2;
Database altered.
SYS@orcl> select group#,members,bytes/1024/1024 "size(M)",status,archived from v$log;
GROUP# MEMBERS size(M) STATUS ARC
---------- ---------- ---------- ---------------- ---
1 2 50 INACTIVE YES
2 2 50 INACTIVE YES
3 1 50 CURRENT NO
SYS@orcl> alter system switch logfile
2 ;
System altered.
SYS@orcl> alter system checkpoint;
System altered.
SYS@orcl> select group#,members,bytes/1024/1024 "size(M)",status,archived from v$log;
GROUP# MEMBERS size(M) STATUS ARC
---------- ---------- ---------- ---------------- ---
1 2 50 CURRENT NO
2 2 50 INACTIVE YES
3 1 50 INACTIVE YES
SYS@orcl> alter database add logfile member '/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo03b.log' to group 3;
Database altered.
SYS@orcl> select group#,members,bytes/1024/1024 "size(M)",status,archived from v$log;
GROUP# MEMBERS size(M) STATUS ARC
---------- ---------- ---------- ---------------- ---
1 2 50 CURRENT NO
2 2 50 INACTIVE YES
3 2 50 INACTIVE YES
SYS@orcl> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/orcl/redo03.log
/u01/app/oracle/oradata/orcl/redo02.log
/u01/app/oracle/oradata/orcl/redo01.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo01b.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo02b.log
/u01/app/oracle/fast_recovery_area/ORCL/onlinelog/redo03b.log
6 rows selected.
说明:如上所示,成功添加日志组成员.