All technological notes.
Redo Log FilesRedo Log FilesEnsure that there are at least two redo log members in each group.
edo log member is damaged or lost, recovery is easier when you have an additional member in the group.Redo log groups
redo log files.log file in a group is a duplicate of the others.redo log groups to protect against media failure and loss of data.
It is suggested that redo log groups have:
file system storage
file system storage, then each member should be distributed on separate disks or controllers so that no single equipment failure impacts an entire log group. 成员分散分布ASM
ASM storage, then each member should be in a separate disk group, such as +DATA and +FRA.
Impact of loss:
The loss of an entire current log group is one of the most serious media failures because it can result in loss of data. 全组丢失造成数据丢失
The loss of a single member of a multiple-member log group is trivial and does not affect database operation (other than causing an alert to be published in the alert log).个别成员丢失不影响.
Note: Multiplexing redo logs may impact overall database performance.
redo log files on your fastest disks served by your fastest controllers.database files on the same disks as your redo log files (unless you are using ASM). Because only one group is written to at a given time, there is no performance impact in having members from several groups on the same disk.Add a member to an exstng log group:
Navigate to the Redo Log Groups page in Enterprise Manager Database Express
Use the ALTER DATABASE command:
ALTER DATABASE
ADD LOGFILE MEMBER '/u0l/app/oracle/oradata/orcl/redola.log'
TO GROUP 1;
When you add the redo log member to a group, the member’s status is marked as INVALID (as can be seen in the V$LOGFILE view). 添加后可能显示 invalid, 直到 switch
CURRENT, the member’s status changes to null.ARCHIVELOG mode, the LGWR cannot overwrite data in the first log group if it has not been archived.LGWR.
redo log files on fastest disks served by fastest
controllers.database files on the same disks as your redo log files. Because only one group is written to at a given time, there is no performance impact in having members from several groups on the same disk.Redo Log GroupV$LOGFILE to determine the configuration (number of members) for each redo log group.
SELECT group#, status, member FROM v$logfile
order by 1;

redo log group.ALTER DATABASE ADD LOGFILE MEMBER
'/u01/app/oracle/oradata/fra/ORCL/redo0lb.log'
TO GROUP 1;
ALTER DATABASE ADD LOGFILE MEMBER
'/u01/app/oracle/oradata/fra/ORCL/redo02b.log'
TO GROUP 2;
ALTER DATABASE ADD LOGFILE MEMBER
'/u01/app/oracle/oradata/fra/ORCL/redo03b.log'
TO GROUP 3;

redo log files are now multiplexed.
redo log files are multiplexed.INVALID status of the newly added redo log members.
LGWR.log switch occurs and the group containing the new member becomes CURRENT, the new member’s status will change to null.SELECT group#, status, member FROM v$logfile ORDER BY 1, 3;


-- query log status
SELECT group#, members, status FROM v$log;
-- switch logfile 3 times, so the switch covers 3 groups.
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
ALTER SYSTEM SWITCH LOGFILE;
-- query logfile
SELECT group#, status, member FROM v$logfile ORDER BY 1, 3;

INACTIVE: the log group is no longer needed for database instance recovery.ACTIVE: the log group is active but not the current log group. It is needed for crash recovery. It may be in use for block recovery.SELECT group#, members, status FROM v$log;
ALTER SYSTEM SWITCH LOGFILE;
SELECT group#, members, status FROM v$log;
ALTER SYSTEM SWITCH LOGFILE;
SELECT group#, members, status FROM v$log;



LGWR background process write to only one member of the CURRENT group in case the other members are missing or damaged?Answer: Yes, it can. As long as there is one member left in the CURRENT group, LGWR can work.
SELECT group#, members, status FROM v$log;
-- 1 2 ACTIVE
-- 2 2 CURRENT
-- 3 2 INACTIVE
ALTER DATABASE DROP LOGFILE MEMBER
'/u01/app/oracle/oradata/fra/ORCL/redo0lb.log';
ALTER SYSTEM SWITCH LOGFILE;
ALTER DATABASE DROP LOGFILE MEMBER
'/u01/app/oracle/oradata/fra/ORCL/redo02b.log';
ALTER SYSTEM SWITCH LOGFILE;
ALTER DATABASE DROP LOGFILE MEMBER
'/u01/app/oracle/oradata/fra/ORCL/redo03b.log';
ALTER SYSTEM SWITCH LOGFILE;

SELECT group#, members, status FROM v$log;

Clean up
rm /u01/app/oracle/oradata/fra/ORCL/redo*.log
ls /u01/app/oracle/oradata/fra/ORCL